summaryrefslogtreecommitdiff
path: root/src/preview/PreviewModel.h
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-06-08 21:04:14 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-06-08 21:04:14 (GMT)
commit0ee1e1875d00876b946f358308f39dc33ef96ea4 (patch)
treec0ea64b19f03541cb71b96ed3acc4c6c3e2e1834 /src/preview/PreviewModel.h
parent1dadb11fc218786a36cc46714a0478e229ca44a9 (diff)
downloadpowder-0ee1e1875d00876b946f358308f39dc33ef96ea4.zip
powder-0ee1e1875d00876b946f358308f39dc33ef96ea4.tar.gz
Load save data when showing the save preview
Diffstat (limited to 'src/preview/PreviewModel.h')
-rw-r--r--src/preview/PreviewModel.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/preview/PreviewModel.h b/src/preview/PreviewModel.h
index af94af3..5a0fd53 100644
--- a/src/preview/PreviewModel.h
+++ b/src/preview/PreviewModel.h
@@ -9,6 +9,7 @@
#define PREVIEWMODEL_H_
#include <vector>
+#include <iostream>
#include <pthread.h>
#include "PreviewView.h"
#include "client/SaveInfo.h"
@@ -17,14 +18,19 @@
using namespace std;
+struct SaveData
+{
+ unsigned char * data;
+ int length;
+};
+
class PreviewView;
class PreviewModel {
bool doOpen;
vector<PreviewView*> observers;
SaveInfo * save;
- Thumbnail * savePreview;
+ vector<char> saveDataBuffer;
std::vector<SaveComment*> * saveComments;
- void notifyPreviewChanged();
void notifySaveChanged();
void notifySaveCommentsChanged();
@@ -32,11 +38,11 @@ class PreviewModel {
int tSaveID;
int tSaveDate;
- bool updateSavePreviewWorking;
- volatile bool updateSavePreviewFinished;
- pthread_t updateSavePreviewThread;
- static void * updateSavePreviewTHelper(void * obj);
- void * updateSavePreviewT();
+ bool updateSaveDataWorking;
+ volatile bool updateSaveDataFinished;
+ pthread_t updateSaveDataThread;
+ static void * updateSaveDataTHelper(void * obj);
+ void * updateSaveDataT();
bool updateSaveInfoWorking;
volatile bool updateSaveInfoFinished;
@@ -51,7 +57,6 @@ class PreviewModel {
void * updateSaveCommentsT();
public:
PreviewModel();
- Thumbnail * GetPreview();
SaveInfo * GetSave();
std::vector<SaveComment*> * GetComments();
void AddObserver(PreviewView * observer);