Fix failing to change the favourite status of a save crashing the game

I have no idea where the code that used to handle PreviewModelException went but it's pointless anyway; out the window it goes.
This commit is contained in:
Tamás Bálint Misius 2023-08-29 17:09:39 +02:00
parent 9ea09d129d
commit 3388094110
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2
3 changed files with 2 additions and 19 deletions

View File

@ -1,7 +1,6 @@
#include "PreviewController.h"
#include "Controller.h"
#include "PreviewModel.h"
#include "PreviewModelException.h"
#include "PreviewView.h"
#include "client/Client.h"
#include "client/SaveInfo.h"

View File

@ -9,7 +9,6 @@
#include "client/GameSave.h"
#include "client/SaveInfo.h"
#include "gui/dialogues/ErrorMessage.h"
#include "PreviewModelException.h"
#include "PreviewView.h"
#include "Config.h"
#include <cmath>
@ -244,11 +243,11 @@ void PreviewModel::Update()
{
if (favouriteSaveRequest->Favourite())
{
throw PreviewModelException("Error, could not fav. the save: " + ByteString(ex.what()).FromUtf8());
new ErrorMessage("Error", "Could not favourite the save: " + ByteString(ex.what()).FromUtf8());
}
else
{
throw PreviewModelException("Error, could not unfav. the save: " + ByteString(ex.what()).FromUtf8());
new ErrorMessage("Error", "Could not unfavourite the save: " + ByteString(ex.what()).FromUtf8());
}
}
favouriteSaveRequest.reset();

View File

@ -1,15 +0,0 @@
#pragma once
#include "common/String.h"
#include <exception>
struct PreviewModelException: public std::exception
{
ByteString message;
public:
PreviewModelException(String message_): message(message_.ToUtf8()) {}
const char * what() const throw() override
{
return message.c_str();
}
~PreviewModelException() throw() {}
};