Created
May 31, 2011 14:28
-
-
Save kovrov/1000591 to your computer and use it in GitHub Desktop.
QMF config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEMPLATE = app | |
TARGET = config | |
QT += core | |
QT -= gui | |
CONFIG += console | |
CONFIG -= app_bundle | |
LIBS += -lqmfclient | |
SOURCES += main.cpp | |
QMAKE_CXXFLAGS += -std=c++0x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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