X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fmain.cpp;h=3f6cab541661c9b0d37b89c9998ca743396b08e2;hp=48b45c28042233e8422edfeb001699af620d022b;hb=6538dce32fd66ee5274197f16bc9b75f09ef4aae;hpb=985657b9e4d8b2b22a775d34320fc65d14df4858 diff --git a/src/common/main.cpp b/src/common/main.cpp index 48b45c28..3f6cab54 100644 --- a/src/common/main.cpp +++ b/src/common/main.cpp @@ -20,11 +20,15 @@ #include +#include + #ifdef BUILD_CORE # include "coreapplication.h" #elif defined BUILD_QTUI +# include "aboutdata.h" # include "qtuiapplication.h" #elif defined BUILD_MONO +# include "aboutdata.h" # include "monoapplication.h" #else @@ -35,10 +39,17 @@ #if defined HAVE_KDE4 && defined BUILD_CORE # undef HAVE_KDE4 #endif +// We don't want quasselcore to depend on KDE +#if defined HAVE_KF5 && defined BUILD_CORE +# undef HAVE_KF5 +#endif #ifdef HAVE_KDE4 # include # include "kcmdlinewrapper.h" +#elif defined HAVE_KF5 +# include +# include "qt5cliparser.h" #elif defined HAVE_QT5 # include "qt5cliparser.h" #else @@ -55,6 +66,12 @@ Q_IMPORT_PLUGIN(qgif) 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); @@ -89,7 +106,6 @@ int main(int argc, char **argv) #ifdef HAVE_KDE4 // We need to init KCmdLineArgs first - // TODO: build an AboutData compat class to replace our aboutDlg strings KAboutData aboutData("quassel", "kdelibs4", ki18n("Quassel IRC"), Quassel::buildInfo().plainVersionString.toUtf8(), ki18n("A modern, distributed IRC client")); aboutData.addLicense(KAboutData::License_GPL_V2); @@ -108,6 +124,7 @@ int main(int argc, char **argv) // 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"); @@ -173,6 +190,15 @@ int main(int argc, char **argv) } #endif - if (!app.init()) return EXIT_FAILURE; +#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(); }