X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoreapplication.h;fp=src%2Fcommon%2Fglobal.h;h=14eec29534af6f2d6e5c9c620f5f2a5f9cea1e17;hp=26f9f6b90afecd2df135c32e7909b54c20c67c8a;hb=5c6804f291a63f978e328aeddcc8448e3443b45e;hpb=85b55cf023c96f4dbd61ec415a15214f99e281b3 diff --git a/src/common/global.h b/src/core/coreapplication.h similarity index 52% rename from src/common/global.h rename to src/core/coreapplication.h index 26f9f6b9..14eec295 100644 --- a/src/common/global.h +++ b/src/core/coreapplication.h @@ -1,5 +1,5 @@ /*************************************************************************** - * 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 * @@ -18,48 +18,36 @@ * 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 -#include "cliparser.h" +#include "quassel.h" -#include +/// 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