Exemplo n.º 1
0
void tst_QMailLog::test_qmaillog()
{
    // enable stderr logging and off syslog
    QSettings settings("nokia", "qmf");
    settings.setValue("SysLog/Enabled", false);
    settings.setValue("StdStreamLog/StdErrEnabled", true);

    qMailLoggersRecreate(settings.organizationName(), settings.applicationName(), 0);

    char newmod[] = "NewModule";
    qmf_registerLoggingFlag(newmod); // no way to verify if it is registered

    QDebug dbg = QLogBase::log(newmod);
    // no way to verify if the category existed or not - check output messages??
}
Exemplo n.º 2
0
int main(int argc, char** argv)
{
    QApplication app(argc,argv);

    // This is ~/.config/QtProject/Qtmail.conf
    qMailLoggersRecreate("QtProject", "Qtmail", "Qtmail");

    if(QMail::fileLock("qtmail-instance.lock") == -1)
        qFatal("Qtmail already running!\n");

    app.setWindowIcon(QIcon(":icon/qtmail"));

    EmailClient appWindow;
    appWindow.show();

    return app.exec();
}