[Kde-pim] KDE - Counting Number of Address Books

GOO Creations goocreations at gmail.com
Tue Jun 29 08:56:50 BST 2010


Dear KDEPIM Developers

I want to get the number of address books a user has.
The following code returns 0 (even with more than 0 address books):

Code:
<http://forum.kde.org/viewtopic.php?f=43&t=88767&p=162708#>
    |Akonadi::ChangeRecorder *changeRecorder = new
    Akonadi::ChangeRecorder();
    changeRecorder->setCollectionMonitored( Akonadi::Collection::root() );
    changeRecorder->setMimeTypeMonitored( KABC::Addressee::mimeType() );
    changeRecorder->fetchCollection( true );

    Akonadi::EntityTreeModel *model = new Akonadi::EntityTreeModel(
    changeRecorder);
    model->setItemPopulationStrategy(
    Akonadi::EntityTreeModel::NoItemPopulation );

    QMessageBox msgBox;
    msgBox.setText(QString::number(model->rowCount()));
    msgBox.exec();|



Does anyone have an clue what I'm doing wrong, or is the another/easier 
way of getting the number of address books?

Thanks for any suggestions.

Christoph Stallmann
goocreations at gmail.com <mailto:goocreations at gmail.com>
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list