Skip to content

Instantly share code, notes, and snippets.

@kovrov
Created May 31, 2011 14:28
Show Gist options
  • Save kovrov/1000591 to your computer and use it in GitHub Desktop.
Save kovrov/1000591 to your computer and use it in GitHub Desktop.
QMF config
TEMPLATE = app
TARGET = config
QT += core
QT -= gui
CONFIG += console
CONFIG -= app_bundle
LIBS += -lqmfclient
SOURCES += main.cpp
QMAKE_CXXFLAGS += -std=c++0x
#include <QCoreApplication>
#include <qmfclient/qmailstore.h>
#include <qmfclient/qmailaccountconfiguration.h>
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QMailStore *store = QMailStore::instance();
foreach (const QMailAccountId &id, store->queryAccounts()) {
const QMailAccountConfiguration account(id);
Q_ASSERT (account.id().isValid());
qDebug() << "Account" << account.id() << ":";
foreach (const QString& service_str, account.services()) {
const QMailAccountConfiguration::ServiceConfiguration config(account.serviceConfiguration(service_str));
qDebug() << "\tService" << service_str << ":";
foreach (const QString &name, config.values().keys()) {
qDebug() << "\t\t" << name << ":" << config.value(name);
}
}
}
app.metaObject()->invokeMethod(&app, "quit", Qt::QueuedConnection);
return app.exec();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment