summaryrefslogtreecommitdiff
path: root/src/search/SearchModel.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-14 16:00:12 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-14 16:00:12 (GMT)
commit03188e58538f5d2490ee8f054270b74d0cb9d7fe (patch)
tree0ac32b3ecc974622a063f23b8453b7b59827c8d5 /src/search/SearchModel.cpp
parent66fffe649d1d173bcccf2763883bd361ef6cb0ed (diff)
downloadpowder-03188e58538f5d2490ee8f054270b74d0cb9d7fe.zip
powder-03188e58538f5d2490ee8f054270b74d0cb9d7fe.tar.gz
Ensure comments page count is loaded correctly, fixes #117
Diffstat (limited to 'src/search/SearchModel.cpp')
-rw-r--r--src/search/SearchModel.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/search/SearchModel.cpp b/src/search/SearchModel.cpp
index d05bf1d..f6a9480 100644
--- a/src/search/SearchModel.cpp
+++ b/src/search/SearchModel.cpp
@@ -54,25 +54,25 @@ void * SearchModel::updateSaveListT()
void SearchModel::UpdateSaveList(int pageNumber, std::string query)
{
- lastQuery = query;
- lastError = "";
- saveListLoaded = false;
- saveList.clear();
- //resultCount = 0;
- currentPage = pageNumber;
- notifySaveListChanged();
- notifyPageChanged();
- selected.clear();
- notifySelectedChanged();
-
- if(pageNumber == 1 && !showOwn && !showFavourite && currentSort == "best" && query == "")
- SetShowTags(true);
- else
- SetShowTags(false);
-
//Threading
if(!updateSaveListWorking)
{
+ lastQuery = query;
+ lastError = "";
+ saveListLoaded = false;
+ saveList.clear();
+ //resultCount = 0;
+ currentPage = pageNumber;
+ notifySaveListChanged();
+ notifyPageChanged();
+ selected.clear();
+ notifySelectedChanged();
+
+ if(pageNumber == 1 && !showOwn && !showFavourite && currentSort == "best" && query == "")
+ SetShowTags(true);
+ else
+ SetShowTags(false);
+
updateSaveListFinished = false;
updateSaveListWorking = true;
pthread_create(&updateSaveListThread, 0, &SearchModel::updateSaveListTHelper, this);
@@ -119,7 +119,8 @@ void SearchModel::Update()
void ** tempInformation;
//vector<SaveInfo*> * tempSaveList;
pthread_join(updateSaveListThread, (void**)(&tempInformation));
- resultCount = thResultCount;
+
+
saveList = *(vector<SaveInfo*>*)tempInformation[0];
delete (vector<SaveInfo*>*)tempInformation[0];
@@ -140,7 +141,8 @@ void SearchModel::Update()
{
lastError = Client::Ref().GetLastError();
}
- //currentPage = pageNumber;
+
+ resultCount = thResultCount;
notifyPageChanged();
notifySaveListChanged();
}