fixed QuickView filtering

This commit is contained in:
csoler 2019-03-26 11:32:43 +01:00
parent 5820364b0d
commit 1d4934b71e
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
2 changed files with 10 additions and 3 deletions

View File

@ -810,6 +810,8 @@ void MessagesDialog::changeQuickView(int newrow)
f = RsMessageModel::QuickViewFilter( (int)RsMessageModel::QUICK_VIEW_USER + newrow - 0x07);
}
mMessageModel->setQuickViewFilter(f);
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model
insertMsgTxtAndFiles(ui.messageTreeWidget->currentIndex());
}
@ -1062,7 +1064,7 @@ void MessagesDialog::filterChanged(const QString& text)
}
mMessageModel->setFilter(f,items);
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString));
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model
QCoreApplication::processEvents();
}
@ -1087,7 +1089,7 @@ void MessagesDialog::filterColumnChanged(int column)
QStringList items = ui.filterLineEdit->text().split(' ',QString::SkipEmptyParts);
mMessageModel->setFilter(f,items);
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString));
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model
// save index
Settings->setValueToGroup("MessageDialog", "filterColumn", column);

View File

@ -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_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;
}
@ -598,6 +601,8 @@ void RsMessageModel::setQuickViewFilter(QuickViewFilter fn)
{
if(fn != mQuickViewFilter)
{
std::cerr << "Changing new quickview filter to " << fn << std::endl;
preMods();
mQuickViewFilter = fn ;
postMods();