mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-26 07:55:44 -04:00
fixed small bug in box initialization
This commit is contained in:
parent
a67a35624d
commit
14d29a4490
4 changed files with 2 additions and 23 deletions
|
@ -142,7 +142,7 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
||||||
mMessageProxyModel->setSortRole(RsMessageModel::SortRole);
|
mMessageProxyModel->setSortRole(RsMessageModel::SortRole);
|
||||||
ui.messageTreeWidget->setModel(mMessageProxyModel);
|
ui.messageTreeWidget->setModel(mMessageProxyModel);
|
||||||
|
|
||||||
changeBox(RsMessageModel::BOX_INBOX);
|
changeBox(0); // set to inbox
|
||||||
|
|
||||||
mMessageProxyModel->setFilterRole(RsMessageModel::FilterRole);
|
mMessageProxyModel->setFilterRole(RsMessageModel::FilterRole);
|
||||||
//mMessageProxyModel->setFilterRegExp(QRegExp(QString(RsMessageModel::FilterString))) ;
|
//mMessageProxyModel->setFilterRegExp(QRegExp(QString(RsMessageModel::FilterString))) ;
|
||||||
|
@ -782,14 +782,9 @@ void MessagesDialog::changeBox(int box_row)
|
||||||
|
|
||||||
inChange = true;
|
inChange = true;
|
||||||
|
|
||||||
// ui.messageTreeWidget->clear();
|
|
||||||
|
|
||||||
ui.quickViewWidget->setCurrentItem(NULL);
|
ui.quickViewWidget->setCurrentItem(NULL);
|
||||||
listMode = LIST_BOX;
|
listMode = LIST_BOX;
|
||||||
|
|
||||||
// insertMessages();
|
|
||||||
// insertMsgTxtAndFiles(ui.messageTreeWidget->currentItem());
|
|
||||||
|
|
||||||
switch(box_row)
|
switch(box_row)
|
||||||
{
|
{
|
||||||
case 0: mMessageModel->setCurrentBox(RsMessageModel::BOX_INBOX ); break;
|
case 0: mMessageModel->setCurrentBox(RsMessageModel::BOX_INBOX ); break;
|
||||||
|
|
|
@ -146,11 +146,6 @@ public:
|
||||||
|
|
||||||
QIcon icon ;
|
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)
|
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()) ;
|
str = QString::fromUtf8(rsPeers->getPeerName(RsPeerId(id)).c_str()) ;
|
||||||
|
@ -186,7 +181,6 @@ public:
|
||||||
|
|
||||||
mLoading = true;
|
mLoading = true;
|
||||||
++mReloadPeriod;
|
++mReloadPeriod;
|
||||||
std::cerr << "Re-loading" << std::endl;
|
|
||||||
|
|
||||||
QTimer::singleShot(1000,this,SLOT(reload()));
|
QTimer::singleShot(1000,this,SLOT(reload()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,10 +48,10 @@ const QString RsMessageModel::FilterString("filtered");
|
||||||
RsMessageModel::RsMessageModel(QObject *parent)
|
RsMessageModel::RsMessageModel(QObject *parent)
|
||||||
: QAbstractItemModel(parent)
|
: QAbstractItemModel(parent)
|
||||||
{
|
{
|
||||||
mFilteringEnabled=false;
|
|
||||||
mCurrentBox = BOX_NONE;
|
mCurrentBox = BOX_NONE;
|
||||||
mQuickViewFilter = QUICK_VIEW_ALL;
|
mQuickViewFilter = QUICK_VIEW_ALL;
|
||||||
mFilterType = FILTER_TYPE_NONE;
|
mFilterType = FILTER_TYPE_NONE;
|
||||||
|
mFilterStrings.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RsMessageModel::preMods()
|
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));
|
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
|
int RsMessageModel::rowCount(const QModelIndex& parent) const
|
||||||
{
|
{
|
||||||
if(!parent.isValid())
|
if(!parent.isValid())
|
||||||
|
|
|
@ -181,7 +181,6 @@ private:
|
||||||
QuickViewFilter mQuickViewFilter ;
|
QuickViewFilter mQuickViewFilter ;
|
||||||
QStringList mFilterStrings;
|
QStringList mFilterStrings;
|
||||||
FilterType mFilterType;
|
FilterType mFilterType;
|
||||||
bool mFilteringEnabled;
|
|
||||||
|
|
||||||
std::vector<Rs::Msgs::MsgInfoSummary> mMessages;
|
std::vector<Rs::Msgs::MsgInfoSummary> mMessages;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue