- // We catch SIGTERM and SIGINT (caused by Ctrl+C) to graceful shutdown Quassel.
- signal(SIGTERM, handle_signal);
- signal(SIGINT, handle_signal);
-
- qRegisterMetaType<QVariant>("QVariant");
- qRegisterMetaType<Message>("Message");
- qRegisterMetaType<BufferInfo>("BufferInfo");
- qRegisterMetaTypeStreamOperators<QVariant>("QVariant");
- qRegisterMetaTypeStreamOperators<Message>("Message");
- qRegisterMetaTypeStreamOperators<BufferInfo>("BufferInfo");
-
-#if defined BUILD_CORE
- Global::runMode = Global::CoreOnly;
- QCoreApplication app(argc, argv);
-#elif defined BUILD_QTUI
- Global::runMode = Global::ClientOnly;
- QApplication app(argc, argv);
+ Q_INIT_RESOURCE(i18n);
+
+ // 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.setOrganizationDomain(Quassel::buildInfo().organizationDomain.toUtf8());
+ KCmdLineArgs::init(argc, argv, &aboutData);
+
+ cliParser = new KCmdLineWrapper();