mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-28 08:54:13 -04:00
fixed bug causing impossibility to display thumbnails with one post only
This commit is contained in:
parent
405fd2b5ca
commit
32050af8da
1 changed files with 9 additions and 7 deletions
|
@ -52,10 +52,12 @@ void RsGxsChannelPostsModel::initEmptyHierarchy()
|
||||||
{
|
{
|
||||||
preMods();
|
preMods();
|
||||||
|
|
||||||
mPosts.resize(1); // adds a sentinel item
|
mPosts.clear();
|
||||||
mPosts[0].mMeta.mMsgName = "Root sentinel post" ;
|
mFilteredPosts.clear();
|
||||||
mFilteredPosts.resize(1);
|
// mPosts.resize(1); // adds a sentinel item
|
||||||
mFilteredPosts[0] = 1;
|
// mPosts[0].mMeta.mMsgName = "Root sentinel post" ;
|
||||||
|
// mFilteredPosts.resize(1);
|
||||||
|
// mFilteredPosts[0] = 1;
|
||||||
|
|
||||||
postMods();
|
postMods();
|
||||||
}
|
}
|
||||||
|
@ -105,9 +107,9 @@ void RsGxsChannelPostsModel::setFilter(const QStringList& strings, uint32_t& cou
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mFilteredPosts.clear();
|
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;
|
bool passes_strings = true;
|
||||||
|
|
||||||
|
@ -137,7 +139,7 @@ int RsGxsChannelPostsModel::rowCount(const QModelIndex& parent) const
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if(!parent.isValid())
|
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;
|
RsErr() << __PRETTY_FUNCTION__ << " rowCount cannot figure out the porper number of rows." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue