summaryrefslogtreecommitdiff
path: root/src/preview/PreviewModel.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-04-14 18:00:24 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-04-14 18:00:24 (GMT)
commit4c6be4ff2cc822d9c1ed36c9c88261771775dc02 (patch)
tree9e07f4871b68ea5e0edc7fdfc56894c26bfba9bf /src/preview/PreviewModel.cpp
parent64063fbc0f070a0731c896394e30abebd848f358 (diff)
downloadpowder-4c6be4ff2cc822d9c1ed36c9c88261771775dc02.zip
powder-4c6be4ff2cc822d9c1ed36c9c88261771775dc02.tar.gz
Graphics:: Extra icons for Report and Favourite. Client:: Get favourite status in GetSave, FavouriteSave, ReportSave, Preview:: Failure state when loading save
Diffstat (limited to 'src/preview/PreviewModel.cpp')
-rw-r--r--src/preview/PreviewModel.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/preview/PreviewModel.cpp b/src/preview/PreviewModel.cpp
index 371d917..71c4d4a 100644
--- a/src/preview/PreviewModel.cpp
+++ b/src/preview/PreviewModel.cpp
@@ -7,6 +7,7 @@
#include "PreviewModel.h"
#include "client/Client.h"
+#include "PreviewModelException.h"
PreviewModel::PreviewModel():
save(NULL),
@@ -60,6 +61,16 @@ void * PreviewModel::updateSaveCommentsT()
return tempComments;
}
+void PreviewModel::SetFavourite(bool favourite)
+{
+ //if(save)
+ {
+ Client::Ref().FavouriteSave(save->id, favourite);
+ save->Favourite = favourite;
+ notifySaveChanged();
+ }
+}
+
void PreviewModel::UpdateSave(int saveID, int saveDate)
{
this->tSaveID = saveID;
@@ -192,6 +203,8 @@ void PreviewModel::Update()
updateSaveInfoWorking = false;
pthread_join(updateSaveInfoThread, (void**)(&save));
notifySaveChanged();
+ if(!save)
+ throw PreviewModelException("Unable to load save");
}
}