mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-05 09:35:39 -05:00
fixed QuickView filtering
This commit is contained in:
parent
5820364b0d
commit
1d4934b71e
@ -810,6 +810,8 @@ void MessagesDialog::changeQuickView(int newrow)
|
|||||||
f = RsMessageModel::QuickViewFilter( (int)RsMessageModel::QUICK_VIEW_USER + newrow - 0x07);
|
f = RsMessageModel::QuickViewFilter( (int)RsMessageModel::QUICK_VIEW_USER + newrow - 0x07);
|
||||||
}
|
}
|
||||||
mMessageModel->setQuickViewFilter(f);
|
mMessageModel->setQuickViewFilter(f);
|
||||||
|
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model
|
||||||
|
|
||||||
insertMsgTxtAndFiles(ui.messageTreeWidget->currentIndex());
|
insertMsgTxtAndFiles(ui.messageTreeWidget->currentIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1062,7 +1064,7 @@ void MessagesDialog::filterChanged(const QString& text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mMessageModel->setFilter(f,items);
|
mMessageModel->setFilter(f,items);
|
||||||
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString));
|
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model
|
||||||
|
|
||||||
QCoreApplication::processEvents();
|
QCoreApplication::processEvents();
|
||||||
}
|
}
|
||||||
@ -1087,7 +1089,7 @@ void MessagesDialog::filterColumnChanged(int column)
|
|||||||
|
|
||||||
QStringList items = ui.filterLineEdit->text().split(' ',QString::SkipEmptyParts);
|
QStringList items = ui.filterLineEdit->text().split(' ',QString::SkipEmptyParts);
|
||||||
mMessageModel->setFilter(f,items);
|
mMessageModel->setFilter(f,items);
|
||||||
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString));
|
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model
|
||||||
|
|
||||||
// save index
|
// save index
|
||||||
Settings->setValueToGroup("MessageDialog", "filterColumn", column);
|
Settings->setValueToGroup("MessageDialog", "filterColumn", column);
|
||||||
|
@ -337,7 +337,10 @@ bool RsMessageModel::passesFilter(const Rs::Msgs::MsgInfoSummary& fmpe,int colum
|
|||||||
|| (mQuickViewFilter==QUICK_VIEW_STARRED && (fmpe.msgflags & RS_MSG_STAR))
|
|| (mQuickViewFilter==QUICK_VIEW_STARRED && (fmpe.msgflags & RS_MSG_STAR))
|
||||||
|| (mQuickViewFilter==QUICK_VIEW_SYSTEM && (fmpe.msgflags & RS_MSG_SYSTEM));
|
|| (mQuickViewFilter==QUICK_VIEW_SYSTEM && (fmpe.msgflags & RS_MSG_SYSTEM));
|
||||||
|
|
||||||
std::cerr << "Passes filter: type=" << mFilterType << " s=\"" << s.toStdString() << "\" strings:" << passes_strings << " quick_view:" << passes_quick_view << std::endl;
|
std::cerr << "Passes filter: type=" << mFilterType << " s=\"" << s.toStdString()
|
||||||
|
<< "MsgFlags=" << fmpe.msgflags << " msgtags=" ;
|
||||||
|
foreach(uint32_t i,fmpe.msgtags) std::cerr << i << " " ;
|
||||||
|
std::cerr << "\" strings:" << passes_strings << " quick_view:" << passes_quick_view << std::endl;
|
||||||
|
|
||||||
return passes_quick_view && passes_strings;
|
return passes_quick_view && passes_strings;
|
||||||
}
|
}
|
||||||
@ -598,6 +601,8 @@ void RsMessageModel::setQuickViewFilter(QuickViewFilter fn)
|
|||||||
{
|
{
|
||||||
if(fn != mQuickViewFilter)
|
if(fn != mQuickViewFilter)
|
||||||
{
|
{
|
||||||
|
std::cerr << "Changing new quickview filter to " << fn << std::endl;
|
||||||
|
|
||||||
preMods();
|
preMods();
|
||||||
mQuickViewFilter = fn ;
|
mQuickViewFilter = fn ;
|
||||||
postMods();
|
postMods();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user