/***************************************************************************
- * Copyright (C) 2005-08 by the Quassel Project *
+ * Copyright (C) 2005-08 by the Quassel IRC Team *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-// This file needs probably to go away at some point. Not much left anymore.
+#ifndef COREAPPLICATION_H_
+#define COREAPPLICATION_H_
-#ifndef _GLOBAL_H_
-#define _GLOBAL_H_
+#include <QCoreApplication>
-#include "cliparser.h"
+#include "quassel.h"
-#include <QString>
+/// Encapsulates CoreApplication's logic.
+/** This allows it to be reused within MonolithicApplication as well.
+ */
+class CoreApplicationInternal {
+ Q_DECLARE_TR_FUNCTIONS(CoreApplicationInternal)
-// Enable some shortcuts and stuff
-//#define DEVELMODE
+ public:
+ CoreApplicationInternal();
+ ~CoreApplicationInternal();
-/* Some global stuff */
-
-namespace Global {
-
- extern QString quasselVersion;
- extern QString quasselBaseVersion;
- extern QString quasselBuildDate;
- extern QString quasselBuildTime;
- extern QString quasselCommit;
- extern uint quasselArchiveDate;
- extern uint protocolVersion;
-
- extern uint clientNeedsProtocol; //< Minimum protocol version the client needs
- extern uint coreNeedsProtocol; //< Minimum protocol version the core needs
-
- extern QString quasselGeneratedVersion; //< This is possibly set in version.gen
+ bool init();
+};
- // We need different config (QSettings) files for client and gui, since the core cannot work with GUI types
- // Set these here. They're used in ClientSettings and CoreSettings.
- const QString coreApplicationName = "Quassel Core";
- const QString clientApplicationName = "Quassel Client";
+class CoreApplication : public QCoreApplication, public Quassel {
+ Q_OBJECT
+ public:
+ CoreApplication(int &argc, char **argv);
+ ~CoreApplication();
- enum RunMode { Monolithic, ClientOnly, CoreOnly };
- extern RunMode runMode;
- extern unsigned int defaultPort;
+ bool init();
- extern bool DEBUG;
- extern CliParser parser;
- void registerMetaTypes();
- void setupVersion();
+ private:
+ CoreApplicationInternal *_internal;
};
#endif