-int main(int argc, char **argv) {
-
- // Setup build information and version string
- # include "version.gen"
- buildinfo.append(QString(",%1,%2").arg(__DATE__, __TIME__));
- Quassel::setupBuildInfo(buildinfo);
- QCoreApplication::setApplicationName(Quassel::buildInfo().applicationName);
- QCoreApplication::setOrganizationName(Quassel::buildInfo().organizationName);
- QCoreApplication::setOrganizationDomain(Quassel::buildInfo().organizationDomain);
-
- AbstractCliParser *cliParser;
-
-#ifdef HAVE_KDE
- // 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);
- 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();
+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
+
+ 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();