summaryrefslogtreecommitdiff
path: root/src/search
diff options
context:
space:
mode:
Diffstat (limited to 'src/search')
-rw-r--r--src/search/SearchController.cpp4
-rw-r--r--src/search/SearchController.h4
-rw-r--r--src/search/SearchModel.cpp12
-rw-r--r--src/search/SearchModel.h12
-rw-r--r--src/search/SearchView.cpp2
5 files changed, 17 insertions, 17 deletions
diff --git a/src/search/SearchController.cpp b/src/search/SearchController.cpp
index ec5f805..aff9636 100644
--- a/src/search/SearchController.cpp
+++ b/src/search/SearchController.cpp
@@ -21,7 +21,7 @@ public:
{
if(cc->activePreview->GetDoOpen() && cc->activePreview->GetSave())
{
- cc->searchModel->SetLoadedSave(new Save(*(cc->activePreview->GetSave())));
+ cc->searchModel->SetLoadedSave(new SaveInfo(*(cc->activePreview->GetSave())));
}
}
};
@@ -45,7 +45,7 @@ SearchController::SearchController(ControllerCallback * callback):
//windowPanel.AddChild();
}
-Save * SearchController::GetLoadedSave()
+SaveInfo * SearchController::GetLoadedSave()
{
return searchModel->GetLoadedSave();
}
diff --git a/src/search/SearchController.h b/src/search/SearchController.h
index ae13431..16b4039 100644
--- a/src/search/SearchController.h
+++ b/src/search/SearchController.h
@@ -6,7 +6,7 @@
#include "SearchView.h"
#include "preview/PreviewController.h"
#include "Controller.h"
-#include "Save.h"
+#include "client/SaveInfo.h"
class SearchView;
class SearchModel;
@@ -43,7 +43,7 @@ public:
void RemoveSelected();
void UnpublishSelected();
void FavouriteSelected();
- Save * GetLoadedSave();
+ SaveInfo * GetLoadedSave();
};
#endif // SEARCHCONTROLLER_H
diff --git a/src/search/SearchModel.cpp b/src/search/SearchModel.cpp
index 76d0bb7..112adba 100644
--- a/src/search/SearchModel.cpp
+++ b/src/search/SearchModel.cpp
@@ -1,5 +1,5 @@
#include "SearchModel.h"
-#include "Save.h"
+#include "client/SaveInfo.h"
#include "client/Client.h"
@@ -28,7 +28,7 @@ void * SearchModel::updateSaveListT()
category = "Favourites";
if(showOwn && Client::Ref().GetAuthUser().ID)
category = "by:"+Client::Ref().GetAuthUser().Username;
- vector<Save*> * tempSaveList = Client::Ref().SearchSaves((currentPage-1)*20, 20, lastQuery, currentSort=="new"?"date":"votes", category, resultCount);
+ vector<SaveInfo*> * tempSaveList = Client::Ref().SearchSaves((currentPage-1)*20, 20, lastQuery, currentSort=="new"?"date":"votes", category, resultCount);
updateSaveListFinished = true;
return tempSaveList;
}
@@ -55,16 +55,16 @@ void SearchModel::UpdateSaveList(int pageNumber, std::string query)
}
}
-void SearchModel::SetLoadedSave(Save * save)
+void SearchModel::SetLoadedSave(SaveInfo * save)
{
loadedSave = save;
}
-Save * SearchModel::GetLoadedSave(){
+SaveInfo * SearchModel::GetLoadedSave(){
return loadedSave;
}
-vector<Save*> SearchModel::GetSaveList()
+vector<SaveInfo*> SearchModel::GetSaveList()
{
return saveList;
}
@@ -78,7 +78,7 @@ void SearchModel::Update()
updateSaveListWorking = false;
lastError = "";
saveListLoaded = true;
- vector<Save*> * tempSaveList;
+ vector<SaveInfo*> * tempSaveList;
pthread_join(updateSaveListThread, (void**)(&tempSaveList));
saveList = *tempSaveList;
delete tempSaveList;
diff --git a/src/search/SearchModel.h b/src/search/SearchModel.h
index fef9f6a..831e141 100644
--- a/src/search/SearchModel.h
+++ b/src/search/SearchModel.h
@@ -5,7 +5,7 @@
#include <string>
#include <pthread.h>
#include <cmath>
-#include "Save.h"
+#include "client/SaveInfo.h"
#include "SearchView.h"
using namespace std;
@@ -14,13 +14,13 @@ class SearchView;
class SearchModel
{
private:
- Save * loadedSave;
+ SaveInfo * loadedSave;
string currentSort;
string lastQuery;
string lastError;
vector<int> selected;
vector<SearchView*> observers;
- vector<Save*> saveList;
+ vector<SaveInfo*> saveList;
int currentPage;
int resultCount;
bool showOwn;
@@ -45,7 +45,7 @@ public:
void AddObserver(SearchView * observer);
void UpdateSaveList(int pageNumber, std::string query);
- vector<Save*> GetSaveList();
+ vector<SaveInfo*> GetSaveList();
string GetLastError() { return lastError; }
int GetPageCount() { return max(1, (int)(ceil(resultCount/16))); }
int GetPageNum() { return currentPage; }
@@ -56,8 +56,8 @@ public:
bool GetShowOwn() { return showOwn; }
void SetShowFavourite(bool show) { if(show!=showFavourite) { showFavourite = show; } notifyShowFavouriteChanged(); }
bool GetShowFavourite() { return showFavourite; }
- void SetLoadedSave(Save * save);
- Save * GetLoadedSave();
+ void SetLoadedSave(SaveInfo * save);
+ SaveInfo * GetLoadedSave();
bool GetSavesLoaded() { return saveListLoaded; }
vector<int> GetSelected() { return selected; }
void ClearSelected() { selected.clear(); notifySelectedChanged(); }
diff --git a/src/search/SearchView.cpp b/src/search/SearchView.cpp
index bf4418a..47392fa 100644
--- a/src/search/SearchView.cpp
+++ b/src/search/SearchView.cpp
@@ -286,7 +286,7 @@ void SearchView::NotifySaveListChanged(SearchModel * sender)
int buttonWidth, buttonHeight, saveX = 0, saveY = 0, savesX = 5, savesY = 4, buttonPadding = 2;
int buttonAreaWidth, buttonAreaHeight, buttonXOffset, buttonYOffset;
- vector<Save*> saves = sender->GetSaveList();
+ vector<SaveInfo*> saves = sender->GetSaveList();
Client::Ref().ClearThumbnailRequests();
for(i = 0; i < saveButtons.size(); i++)
{