mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-03 11:00:14 -05:00
fixed bug causing impossibility to display thumbnails with one post only
This commit is contained in:
parent
405fd2b5ca
commit
32050af8da
@ -52,10 +52,12 @@ void RsGxsChannelPostsModel::initEmptyHierarchy()
|
||||
{
|
||||
preMods();
|
||||
|
||||
mPosts.resize(1); // adds a sentinel item
|
||||
mPosts[0].mMeta.mMsgName = "Root sentinel post" ;
|
||||
mFilteredPosts.resize(1);
|
||||
mFilteredPosts[0] = 1;
|
||||
mPosts.clear();
|
||||
mFilteredPosts.clear();
|
||||
// mPosts.resize(1); // adds a sentinel item
|
||||
// mPosts[0].mMeta.mMsgName = "Root sentinel post" ;
|
||||
// mFilteredPosts.resize(1);
|
||||
// mFilteredPosts[0] = 1;
|
||||
|
||||
postMods();
|
||||
}
|
||||
@ -105,9 +107,9 @@ void RsGxsChannelPostsModel::setFilter(const QStringList& strings, uint32_t& cou
|
||||
else
|
||||
{
|
||||
mFilteredPosts.clear();
|
||||
mFilteredPosts.push_back(0);
|
||||
//mFilteredPosts.push_back(0);
|
||||
|
||||
for(int i=1;i<mPosts.size();++i)
|
||||
for(int i=0;i<mPosts.size();++i)
|
||||
{
|
||||
bool passes_strings = true;
|
||||
|
||||
@ -137,7 +139,7 @@ int RsGxsChannelPostsModel::rowCount(const QModelIndex& parent) const
|
||||
return 0;
|
||||
|
||||
if(!parent.isValid())
|
||||
return (mFilteredPosts.size()-1 + mColumns-1)/mColumns; // mFilteredPosts always has an item at 0, so size()>=1, and mColumn>=1
|
||||
return (mFilteredPosts.size() + mColumns-1)/mColumns; // mFilteredPosts always has an item at 0, so size()>=1, and mColumn>=1
|
||||
|
||||
RsErr() << __PRETTY_FUNCTION__ << " rowCount cannot figure out the porper number of rows." << std::endl;
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user