[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-pim
Subject: [Kde-pim] Using an EntityMimeTypeFilterModel to show Items only
From: Marcus Harrison <marcus.harrison () harrisonland ! co ! uk>
Date: 2012-08-25 22:40:36
Message-ID: 5380481.IJ2nPtoGxU () lunacy
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
Hello everyone,
I've started writing an E-mail client using Akonadi and I'm having trouble.
I'm trying to configure a model that only contains E-mail items, not
collections.
To do this, I'm trying to use an EntityMimeTypeFilterModel on top of an
EntityTreeModel, but it's behaving very oddly.
If I don't configure it at all, the documentation says it should have all
mimetypes in the include filters, but in practice it's only showing
Collections. It should show Items as well, shouldn't it?
Anyway, adding an inclusion filter of "message/rfc822" filters the Collections
out, but because it's not including any Items anyway it then just displays
nothing.
Can anyone explain just what's going on, please?
A paste of my test code so far:
MainWindow::MainWindow()
{
foldersDock = new FoldersDock(this); // Some other configured widget
changeRecorder = new Akonadi::ChangeRecorder(this);
changeRecorder->setCollectionMonitored(Akonadi::Collection::root());
model = new Akonadi::EntityTreeModel(changeRecorder, this);
mailsModel = new Akonadi::EntityMimeTypeFilterModel(this);
mailsModel->setSourceModel(model);
mailsModel->addMimeTypeInclusionFilter("message/rfc822");
mailsView = new Akonadi::EntityTreeView(this, this);
mailsView->setModel(mailsModel);
connect(foldersDock, SIGNAL(currentChanged(Akonadi::Collection)),
this, SLOT(currentChanged(Akonadi::Collection)));
addDockWidget(Qt::LeftDockWidgetArea, foldersDock);
setCentralWidget(mailsView);
setupGUI();
}
Marcus Harrison
["signature.asc" (application/pgp-signature)]
_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic