diff --git a/retroshare-gui/src/gui/Posted/PostedPostsModel.cpp b/retroshare-gui/src/gui/Posted/PostedPostsModel.cpp index baa7ed0d7..5ca140091 100644 --- a/retroshare-gui/src/gui/Posted/PostedPostsModel.cpp +++ b/retroshare-gui/src/gui/Posted/PostedPostsModel.cpp @@ -172,9 +172,7 @@ void RsPostedPostsModel::setFilter(const QStringList& strings, uint32_t& count) count = mFilteredPosts.size(); mDisplayedStartIndex = 0; - - if(mDisplayedNbPosts > count) - mDisplayedNbPosts = count ; + mDisplayedNbPosts = std::min(count,DEFAULT_DISPLAYED_NB_POSTS) ; std::cerr << "After filtering: " << count << " posts remain." << std::endl; diff --git a/retroshare-gui/src/gui/Posted/PostedPostsModel.h b/retroshare-gui/src/gui/Posted/PostedPostsModel.h index cabd420de..0aab99b01 100644 --- a/retroshare-gui/src/gui/Posted/PostedPostsModel.h +++ b/retroshare-gui/src/gui/Posted/PostedPostsModel.h @@ -157,7 +157,8 @@ public: // Helper functions bool getPostData(const QModelIndex& i,RsPostedPost& fmpe) const ; - uint32_t postsCount() const { return mPosts.size() ; } + uint32_t totalPostsCount() const { return mPosts.size() ; } + uint32_t filteredPostsCount() const { return mFilteredPosts.size() ; } uint32_t displayedStartPostIndex() const { return mDisplayedStartIndex ; } void clear() ;