Fix message loading for standar root.

This commit is contained in:
Martin Rotter 2015-12-09 20:32:55 +01:00
parent dca3f31f76
commit b7349140ee

View File

@ -590,13 +590,14 @@ QList<QAction*> StandardServiceRoot::contextMenu() {
bool StandardServiceRoot::loadMessagesForItem(RootItem *item, QSqlTableModel *model) { bool StandardServiceRoot::loadMessagesForItem(RootItem *item, QSqlTableModel *model) {
if (item->kind() == RootItemKind::Bin) { if (item->kind() == RootItemKind::Bin) {
model->setFilter(QSL("is_deleted = 1 AND is_pdeleted = 0")); model->setFilter(QString("is_deleted = 1 AND is_pdeleted = 0 AND account_id = %1").arg(accountId()));
} }
else { else {
QList<Feed*> children = item->getSubTreeFeeds(); QList<Feed*> children = item->getSubTreeFeeds();
QString filter_clause = textualFeedIds(children).join(QSL(", ")); QString filter_clause = textualFeedIds(children).join(QSL(", "));
model->setFilter(QString(QSL("feed IN (%1) AND is_deleted = 0 AND is_pdeleted = 0")).arg(filter_clause)); model->setFilter(QString(QSL("feed IN (%1) AND is_deleted = 0 AND is_pdeleted = 0 AND account_id = %1")).arg(filter_clause,
accountId()));
qDebug("Loading messages from feeds: %s.", qPrintable(filter_clause)); qDebug("Loading messages from feeds: %s.", qPrintable(filter_clause));
} }