fixed small bug in box initialization

This commit is contained in:
csoler 2019-03-12 16:59:45 +01:00
parent a67a35624d
commit 14d29a4490
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
4 changed files with 2 additions and 23 deletions

View File

@ -142,7 +142,7 @@ MessagesDialog::MessagesDialog(QWidget *parent)
mMessageProxyModel->setSortRole(RsMessageModel::SortRole);
ui.messageTreeWidget->setModel(mMessageProxyModel);
changeBox(RsMessageModel::BOX_INBOX);
changeBox(0); // set to inbox
mMessageProxyModel->setFilterRole(RsMessageModel::FilterRole);
//mMessageProxyModel->setFilterRegExp(QRegExp(QString(RsMessageModel::FilterString))) ;
@ -782,14 +782,9 @@ void MessagesDialog::changeBox(int box_row)
inChange = true;
// ui.messageTreeWidget->clear();
ui.quickViewWidget->setCurrentItem(NULL);
listMode = LIST_BOX;
// insertMessages();
// insertMsgTxtAndFiles(ui.messageTreeWidget->currentItem());
switch(box_row)
{
case 0: mMessageModel->setCurrentBox(RsMessageModel::BOX_INBOX ); break;

View File

@ -146,11 +146,6 @@ public:
QIcon icon ;
if(id.isNull())
{
str = tr("[Retroshare]");
icon = QIcon();
}
if(rsPeers->isFriend(RsPeerId(id))) // horrible trick because some widgets still use locations as IDs (e.g. messages)
{
str = QString::fromUtf8(rsPeers->getPeerName(RsPeerId(id)).c_str()) ;
@ -186,7 +181,6 @@ public:
mLoading = true;
++mReloadPeriod;
std::cerr << "Re-loading" << std::endl;
QTimer::singleShot(1000,this,SLOT(reload()));
}

View File

@ -48,10 +48,10 @@ const QString RsMessageModel::FilterString("filtered");
RsMessageModel::RsMessageModel(QObject *parent)
: QAbstractItemModel(parent)
{
mFilteringEnabled=false;
mCurrentBox = BOX_NONE;
mQuickViewFilter = QUICK_VIEW_ALL;
mFilterType = FILTER_TYPE_NONE;
mFilterStrings.clear();
}
void RsMessageModel::preMods()
@ -63,15 +63,6 @@ void RsMessageModel::postMods()
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(mMessages.size()-1,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL));
}
// void RsGxsForumModel::setSortMode(SortMode mode)
// {
// preMods();
//
// mSortMode = mode;
//
// postMods();
// }
int RsMessageModel::rowCount(const QModelIndex& parent) const
{
if(!parent.isValid())

View File

@ -181,7 +181,6 @@ private:
QuickViewFilter mQuickViewFilter ;
QStringList mFilterStrings;
FilterType mFilterType;
bool mFilteringEnabled;
std::vector<Rs::Msgs::MsgInfoSummary> mMessages;
};