int main(int argc, char *argv[]) { KLocalizedString::setApplicationDomain("ktp-text-ui"); Kdelibs4ConfigMigrator migrator(QLatin1String("ktp-text-ui")); migrator.setConfigFiles(QStringList() << QLatin1String("ktp-text-uirc")); migrator.setUiFiles(QStringList() << QLatin1String("chatwindow.rc")); migrator.migrate(); // KAboutData is in telepathy-chat-ui.cpp, read there why Tp::registerTypes(); KTp::registerOtrTypes(); Tp::SharedPtr<TelepathyChatUi> app(new TelepathyChatUi(argc, argv)); Tp::ChannelFactoryPtr channelFactory = Tp::ChannelFactory::create(QDBusConnection::sessionBus()); channelFactory->addCommonFeatures(Tp::Channel::FeatureCore); Tp::Features textFeatures = Tp::Features() << Tp::TextChannel::FeatureMessageQueue << Tp::TextChannel::FeatureMessageSentSignal << Tp::TextChannel::FeatureChatState << Tp::TextChannel::FeatureMessageCapabilities; channelFactory->addFeaturesForTextChats(textFeatures); channelFactory->addFeaturesForTextChatrooms(textFeatures); channelFactory->addFeaturesForOutgoingFileTransfers(Tp::OutgoingFileTransferChannel::FeatureCore); Tp::ClientRegistrarPtr registrar = Tp::ClientRegistrar::create(KTp::accountFactory(), KTp::connectionFactory(), channelFactory, KTp::contactFactory()); Tp::AbstractClientPtr handler = Tp::AbstractClientPtr(app); registrar->registerClient(handler, QLatin1String(KTP_TEXTUI_CLIENT_NAME)); return app->exec(); }
int main(int argc, char **argv) { #if QT_VERSION < 0x050000 // All our source files are in UTF-8, and Qt5 even requires that QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); #endif Quassel::setupBuildInfo(); QCoreApplication::setApplicationName(Quassel::buildInfo().applicationName); QCoreApplication::setApplicationVersion(Quassel::buildInfo().plainVersionString); QCoreApplication::setOrganizationName(Quassel::buildInfo().organizationName); QCoreApplication::setOrganizationDomain(Quassel::buildInfo().organizationDomain); // on OSX with Qt4, raster seems to fix performance issues #if QT_VERSION < 0x050000 && defined Q_OS_MAC && !defined BUILD_CORE QApplication::setGraphicsSystem("raster"); #endif // We need to explicitly initialize the required resources when linking statically #ifndef BUILD_QTUI Q_INIT_RESOURCE(sql); #endif #ifndef BUILD_CORE Q_INIT_RESOURCE(pics); Q_INIT_RESOURCE(hicolor); #endif #ifdef EMBED_DATA Q_INIT_RESOURCE(i18n); # ifndef BUILD_CORE Q_INIT_RESOURCE(data); # ifdef WITH_OXYGEN Q_INIT_RESOURCE(oxygen); # endif # endif #endif // Migrate settings from KDE4 to KF5 if appropriate #ifdef HAVE_KF5 Kdelibs4ConfigMigrator migrator(QCoreApplication::applicationName()); migrator.setConfigFiles(QStringList() << "quasselrc" << "quassel.notifyrc"); migrator.migrate(); #endif AbstractCliParser *cliParser; #ifdef HAVE_KDE4 // We need to init KCmdLineArgs first KAboutData aboutData("quassel", "kdelibs4", ki18n("Quassel IRC"), Quassel::buildInfo().plainVersionString.toUtf8(), ki18n("A modern, distributed IRC client")); aboutData.addLicense(KAboutData::License_GPL_V2); aboutData.addLicense(KAboutData::License_GPL_V3); aboutData.setBugAddress("http://bugs.quassel-irc.org/projects/quassel-irc/issues/new"); aboutData.setOrganizationDomain(Quassel::buildInfo().organizationDomain.toUtf8()); KCmdLineArgs::init(argc, argv, &aboutData); cliParser = new KCmdLineWrapper(); #elif defined HAVE_QT5 cliParser = new Qt5CliParser(); #else cliParser = new CliParser(); #endif Quassel::setCliParser(cliParser); // Initialize CLI arguments // NOTE: We can't use tr() at this point, since app is not yet created // TODO: Change this once we get rid of KDE4 and can initialize the parser after creating the app // put shared client&core arguments here cliParser->addSwitch("debug", 'd', "Enable debug output"); cliParser->addSwitch("help", 'h', "Display this help and exit"); cliParser->addSwitch("version", 'v', "Display version information"); #ifdef BUILD_QTUI cliParser->addOption("configdir", 'c', "Specify the directory holding the client configuration", "path"); #else cliParser->addOption("configdir", 'c', "Specify the directory holding configuration files, the SQlite database and the SSL certificate", "path"); #endif cliParser->addOption("datadir", 0, "DEPRECATED - Use --configdir instead", "path"); #ifndef BUILD_CORE // put client-only arguments here cliParser->addOption("icontheme", 0, "Override the system icon theme ('oxygen' is recommended)", "theme"); cliParser->addOption("qss", 0, "Load a custom application stylesheet", "file.qss"); cliParser->addSwitch("debugbufferswitches", 0, "Enables debugging for bufferswitches"); cliParser->addSwitch("debugmodel", 0, "Enables debugging for models"); cliParser->addSwitch("hidewindow", 0, "Start the client minimized to the system tray"); #endif #ifndef BUILD_QTUI // put core-only arguments here cliParser->addOption("listen", 0, "The address(es) quasselcore will listen on", "<address>[,<address>[,...]]", "::,0.0.0.0"); cliParser->addOption("port", 'p', "The port quasselcore will listen at", "port", "4242"); cliParser->addSwitch("norestore", 'n', "Don't restore last core's state"); cliParser->addOption("loglevel", 'L', "Loglevel Debug|Info|Warning|Error", "level", "Info"); #ifdef HAVE_SYSLOG cliParser->addSwitch("syslog", 0, "Log to syslog"); #endif cliParser->addOption("logfile", 'l', "Log to a file", "path"); cliParser->addOption("select-backend", 0, "Switch storage backend (migrating data if possible)", "backendidentifier"); cliParser->addSwitch("add-user", 0, "Starts an interactive session to add a new core user"); cliParser->addOption("change-userpass", 0, "Starts an interactive session to change the password of the user identified by <username>", "username"); cliParser->addSwitch("oidentd", 0, "Enable oidentd integration"); cliParser->addOption("oidentd-conffile", 0, "Set path to oidentd configuration file", "file"); #ifdef HAVE_SSL cliParser->addSwitch("require-ssl", 0, "Require SSL for remote (non-loopback) client connections"); #endif cliParser->addSwitch("enable-experimental-dcc", 0, "Enable highly experimental and unfinished support for CTCP DCC (DANGEROUS)"); #endif #ifdef HAVE_KDE4 // the KDE version needs this extra call to parse argc/argv before app is instantiated if (!cliParser->init()) { cliParser->usage(); return EXIT_FAILURE; } #endif # if defined BUILD_CORE CoreApplication app(argc, argv); # elif defined BUILD_QTUI QtUiApplication app(argc, argv); # elif defined BUILD_MONO MonolithicApplication app(argc, argv); # endif #ifndef HAVE_KDE4 // the non-KDE version parses after app has been instantiated if (!cliParser->init(app.arguments())) { cliParser->usage(); return false; } #endif #ifdef HAVE_KF5 // FIXME: This should be done after loading the translation catalogue, but still in main() AboutData aboutData; AboutData::setQuasselPersons(&aboutData); KAboutData::setApplicationData(aboutData.kAboutData()); #endif if (!app.init()) return EXIT_FAILURE; return app.exec(); }
int main(int argc, char **argv) { QApplication app(argc, argv); QStringList configFiles; configFiles << QStringLiteral("khangmanrc"); Kdelibs4ConfigMigrator migrator(QStringLiteral("khangman")); migrator.setConfigFiles(configFiles); migrator.migrate(); KLocalizedString::setApplicationDomain("khangman"); QApplication::setApplicationName(QStringLiteral("khangman")); QApplication::setApplicationVersion(KHM_VERSION); QApplication::setOrganizationDomain(QStringLiteral("kde.org")); QApplication::setApplicationDisplayName(i18n("KHangMan")); QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("khangman"))); app.connect(&app, &QGuiApplication::lastWindowClosed, &app, &QCoreApplication::quit); KAboutData aboutData(I18N_NOOP("khangman"), i18n("KHangMan"), I18N_NOOP(KHM_VERSION), i18n(description), KAboutLicense::GPL, i18n("(c) 2001-2011, Anne-Marie Mahfouf")); aboutData.addAuthor(i18n("Primoz Anzur"), i18n("Previous maintainer"), QStringLiteral("*****@*****.**")); // Write the names with accents and all and this file save with // utf8 encoding. aboutData.addAuthor(i18n("Anne-Marie Mahfouf"), i18n("Original Author"), QStringLiteral("*****@*****.**"), QStringLiteral("http://annma.blogspot.com"), QStringLiteral("annma")); aboutData.addAuthor(i18n("Rahul Chowdhury"), i18n("Developer"), QStringLiteral("*****@*****.**"), QStringLiteral("http://rahulc93.wordpress.com/"), QStringLiteral("rahulch")); aboutData.addCredit(i18n("Stefan Böhmann"), i18n("Coding help"), QStringLiteral("*****@*****.**"), QStringLiteral("http://www.hilefoks.org"), QStringLiteral("hilefoks")); aboutData.addCredit(i18n("Stefan Asserhäll"), i18n("Swedish data files, coding help, transparent pictures and i18n fixes"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("eXParTaKus"), i18n("Spanish data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Erik Kjær Pedersenn"), i18n("Danish data files"), QStringLiteral("*****@*****.**") ); aboutData.addCredit(i18n("Niko Lewman"), i18n("Finnish data files"), QStringLiteral("*****@*****.**") ); aboutData.addCredit(i18n("João Sebastião de Oliveira Bueno"), i18n("Brazilian Portuguese data files"), QStringLiteral("*****@*****.**") ); aboutData.addCredit(i18n("Antoni Bella"), i18n("Catalan data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Giovanni Venturi"), i18n("Italian data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Rinse"), i18n("Dutch data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Lukáš Tinkl"), i18n("Czech data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Kristóf Kiszel"), i18n("Hungarian data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Torger Åge Sinnes"), i18n("Norwegian (Bokmål) data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Roger Kovacs"), i18n("Tajik data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Chusslove Illich"), i18n("Serbian (Cyrillic and Latin) data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Jure Repinc"), i18n("Slovenian data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Pedro Morais"), i18n("Portuguese data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Gaute Hvoslef Kvalnes"), i18n("Norwegian (Nynorsk) data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Mehmet Özel"), i18n("Turkish data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Черепанов Андрей"), i18n("Russian data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Radostin Radnev"), i18n("Bulgarian data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Kevin Patrick Scannell"), i18n("Irish (Gaelic) data files"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Matt Howe"), i18n("Softer Hangman Pictures"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Benjamin Meyer"), i18n("Coding help"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Robert Gogolok"), i18n("Coding help"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Lubos Lunàk"), i18n("Coding help"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Albert Astals Cid"), i18n("Coding help, fixed a lot of things"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Peter Hedlund"), i18n("Code for generating icons for the characters toolbar"), QStringLiteral("*****@*****.**")); aboutData.addCredit(i18n("Inge Wallin"), i18n("Code cleaning"), QStringLiteral("*****@*****.**")); aboutData.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"), i18nc("EMAIL OF TRANSLATORS", "Your emails")); KAboutData::setApplicationData(aboutData); KCrash::initialize(); QFont f(QStringLiteral("Domestic Manners"), 12, QFont::Normal, true); if (!QFontInfo(f).exactMatch()) { QFontDatabase::addApplicationFont(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("fonts/Domestic_Manners.ttf"))); } QFont fd(QStringLiteral("Dustismo Roman"), 12, QFont::Normal, true); if (!QFontInfo(fd).exactMatch()) { QFontDatabase::addApplicationFont(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("fonts/Dustismo_Roman.ttf"))); } KHangMan hangman; QObject::connect(hangman.getEngine(), &QQmlEngine::quit, &app, &QCoreApplication::quit); hangman.show(); return app.exec(); }