diff --git a/src/ispdb/main.cpp b/src/ispdb/main.cpp index e1da426..b2339b6 100644 --- a/src/ispdb/main.cpp +++ b/src/ispdb/main.cpp @@ -1,141 +1,142 @@ /* Copyright (c) 2010 Omat Holding B.V. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "ispdb.h" #include "../accountwizard_debug.h" #include #include #include #include #include #include #include QString socketTypeToStr(Ispdb::socketType socketType) { QString enc = QStringLiteral("None"); if (socketType == Ispdb::SSL) { enc = QStringLiteral("SSL"); } else if (socketType == Ispdb::StartTLS) { enc = QStringLiteral("TLS"); } return enc; } QString authTypeToStr(Ispdb::authType authType) { QString auth = QStringLiteral("unknown"); switch (authType) { case Ispdb::Plain: auth = QStringLiteral("plain"); break; case Ispdb::CramMD5: auth = QStringLiteral("CramMD5"); break; case Ispdb::NTLM: auth = QStringLiteral("NTLM"); break; case Ispdb::GSSAPI: auth = QStringLiteral("GSSAPI"); break; case Ispdb::ClientIP: auth = QStringLiteral("ClientIP"); break; case Ispdb::NoAuth: auth = QStringLiteral("NoAuth"); break; case Ispdb::Basic: auth = QStringLiteral("Basic"); break; case Ispdb::OAuth2: auth = QStringLiteral("OAuth2"); break; } return auth; } int main(int argc, char **argv) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); KAboutData aboutData(QStringLiteral("ispdb"), i18n("ISPDB Assistant"), QStringLiteral("0.1"), i18n("Helps setting up PIM accounts"), KAboutLicense::LGPL, i18n("(c) 2010 Omat Holding B.V."), + QString(), QStringLiteral("https://community.kde.org/KDE_PIM/Akonadi")); aboutData.addAuthor(i18n("Tom Albers"), i18n("Author"), QStringLiteral("toma@kde.org")); app.setWindowIcon(QIcon::fromTheme(QStringLiteral("akonadi"))); QCommandLineParser parser; KAboutData::setApplicationData(aboutData); aboutData.setupCommandLine(&parser); parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("email"), i18n("Tries to fetch the settings for that email address"), QStringLiteral("emailaddress"))); parser.process(app); aboutData.processCommandLine(&parser); QString email(QStringLiteral("blablabla@gmail.com")); const QString argEmail = parser.value(QStringLiteral("email")); if (!argEmail.isEmpty()) { email = argEmail; } QEventLoop loop; Ispdb ispdb; ispdb.setEmail(email); loop.connect(&ispdb, SIGNAL(finished(bool)), SLOT(quit())); ispdb.start(); loop.exec(); qCDebug(ACCOUNTWIZARD_LOG) << "Domains" << ispdb.relevantDomains(); qCDebug(ACCOUNTWIZARD_LOG) << "Name" << ispdb.name(Ispdb::Long) << "(" << ispdb.name(Ispdb::Short) << ")"; qCDebug(ACCOUNTWIZARD_LOG) << "Imap servers:"; foreach (const Server &s, ispdb.imapServers()) { qCDebug(ACCOUNTWIZARD_LOG) << "\thostname:" << s.hostname << "- port:" << s.port << "- encryption:" << socketTypeToStr(s.socketType) << "- username:" << s.username << "- authentication:" << authTypeToStr(s.authentication); } qCDebug(ACCOUNTWIZARD_LOG) << "pop3 servers:"; foreach (const Server &s, ispdb.pop3Servers()) { qCDebug(ACCOUNTWIZARD_LOG) << "\thostname:" << s.hostname << "- port:" << s.port << "- encryption:" << socketTypeToStr(s.socketType) << "- username:" << s.username << "- authentication:" << authTypeToStr(s.authentication); } qCDebug(ACCOUNTWIZARD_LOG) << "smtp servers:"; foreach (const Server &s, ispdb.smtpServers()) { qCDebug(ACCOUNTWIZARD_LOG) << "\thostname:" << s.hostname << "- port:" << s.port << "- encryption:" << socketTypeToStr(s.socketType) << "- username:" << s.username << "- authentication:" << authTypeToStr(s.authentication); } return 0; } diff --git a/src/main.cpp b/src/main.cpp index aaea806..e7a26af 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,88 +1,89 @@ /* Copyright (c) 2009 Volker Krause This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "dialog.h" #include "global.h" #include #include #include #include #include #include #include #include #include #include #include int main(int argc, char **argv) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); QApplication app(argc, argv); app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); KLocalizedString::setApplicationDomain("accountwizard"); KCrash::initialize(); KAboutData aboutData(QStringLiteral("accountwizard"), i18n("Account Assistant"), QStringLiteral("0.2"), i18n("Helps setting up PIM accounts"), KAboutLicense::LGPL, i18n("(c) 2009-2019 the Akonadi developers"), + QString(), QStringLiteral("https://community.kde.org/KDE_PIM/Akonadi")); aboutData.addAuthor(i18n("Volker Krause"), i18n("Author"), QStringLiteral("vkrause@kde.org")); aboutData.addAuthor(i18n("Laurent Montel"), QString(), QStringLiteral("montel@kde.org")); app.setOrganizationDomain(QStringLiteral("kde.org")); app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kontact"))); QCommandLineParser parser; KAboutData::setApplicationData(aboutData); parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("type"), i18n("Only offer accounts that support the given type."), QStringLiteral("type"))); parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("assistant"), i18n("Run the specified assistant."), QStringLiteral("assistant"))); parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("package"), i18n("unpack fullpath on startup and launch that assistant"), QStringLiteral("fullpath"))); aboutData.setupCommandLine(&parser); parser.process(app); aboutData.processCommandLine(&parser); KDBusService service(KDBusService::Unique); Akonadi::ControlGui::start(nullptr); const QString packageArgument = parser.value(QStringLiteral("package")); if (!packageArgument.isEmpty()) { Global::setAssistant(Global::unpackAssistant(QUrl::fromLocalFile(packageArgument))); } else { Global::setAssistant(parser.value(QStringLiteral("assistant"))); } QString typeValue = parser.value(QStringLiteral("type")); if (!typeValue.isEmpty()) { Global::setTypeFilter(typeValue.split(QLatin1Char(','))); } Dialog dlg(nullptr); dlg.show(); // Unregister once the UI is closed, even if the app will continue running // and generating keys in the background. QObject::connect(&dlg, &Dialog::accepted, &service, &KDBusService::unregister); return app.exec(); }