diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2013-10-16 23:03:10 (GMT) |
|---|---|---|
| committer | jacksonmj <mj-pt@jacksonmj.co.uk> | 2013-10-17 15:09:28 (GMT) |
| commit | 132755525c3360c84109468ecf3984486f6e5837 (patch) | |
| tree | c456a864394e7f26db3521c1447e6924c29da8a0 /src/gui | |
| parent | c4dcb37de40eda86871ba4e0992877528a208e39 (diff) | |
| download | powder-132755525c3360c84109468ecf3984486f6e5837.zip powder-132755525c3360c84109468ecf3984486f6e5837.tar.gz | |
Fix incorrect search page count
Diffstat (limited to 'src/gui')
| -rw-r--r-- | src/gui/search/SearchModel.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/search/SearchModel.h b/src/gui/search/SearchModel.h index 0fe9480..61f51d0 100644 --- a/src/gui/search/SearchModel.h +++ b/src/gui/search/SearchModel.h @@ -61,7 +61,13 @@ public: vector<SaveInfo*> GetSaveList(); vector<pair<string, int> > GetTagList(); string GetLastError() { return lastError; } - int GetPageCount() { return max(1, (int)(ceil(resultCount/16.0f))); } + int GetPageCount() + { + if (!showOwn && !showFavourite && currentSort == "best" && lastQuery == "") + return max(1, (int)(ceil((resultCount+5)/20.0f))); + else + return max(1, (int)(ceil(resultCount/20.0f))); + } int GetPageNum() { return currentPage; } std::string GetLastQuery() { return lastQuery; } void SetSort(string sort) { if(!updateSaveListWorking) { currentSort = sort; } notifySortChanged(); } |
