X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fglobal.cpp;h=300d182778cbdc6afd36ba953242b5eebd23dd0c;hp=cdb337652116171ff5e516883d6943860eacb62d;hb=351e8bd985011abf721e2beffd9b8eeee74bf4e1;hpb=902c95728306e5ba115de84800fc8d5d239c9d62 diff --git a/src/common/global.cpp b/src/common/global.cpp index cdb33765..300d1827 100644 --- a/src/common/global.cpp +++ b/src/common/global.cpp @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005-07 by The Quassel IRC Development Team * + * Copyright (C) 2005-08 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * (at your option) version 3. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -18,12 +18,16 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include -#include +#include #include "global.h" #include "logger.h" #include "message.h" -#include "util.h" +#include "identity.h" +#include "network.h" +#include "bufferinfo.h" +#include "types.h" +#include "syncableobject.h" extern void messageHandler(QtMsgType type, const char *msg); @@ -59,5 +63,53 @@ void Global::initIconMap() { // return 0; //} +//! Register our custom types with Qt's Meta Object System. +/** This makes them available for QVariant and in signals/slots, among other things. + * + */ +void Global::registerMetaTypes() { + // Complex types + qRegisterMetaType("QVariant"); + qRegisterMetaType("Message"); + qRegisterMetaType("BufferInfo"); + qRegisterMetaType("NetworkInfo"); + qRegisterMetaType("Identity"); + qRegisterMetaType("Network::ConnectionState"); + + qRegisterMetaTypeStreamOperators("QVariant"); + qRegisterMetaTypeStreamOperators("Message"); + qRegisterMetaTypeStreamOperators("BufferInfo"); + qRegisterMetaTypeStreamOperators("NetworkInfo"); + qRegisterMetaTypeStreamOperators("Identity"); + qRegisterMetaTypeStreamOperators("Network::ConnectionState"); + + qRegisterMetaType("IdentityId"); + qRegisterMetaType("BufferId"); + qRegisterMetaType("NetworkId"); + qRegisterMetaType("UserId"); + qRegisterMetaType("AccountId"); + qRegisterMetaType("MsgId"); + + qRegisterMetaTypeStreamOperators("IdentityId"); + qRegisterMetaTypeStreamOperators("BufferId"); + qRegisterMetaTypeStreamOperators("NetworkId"); + qRegisterMetaTypeStreamOperators("UserId"); + qRegisterMetaTypeStreamOperators("AccountId"); + qRegisterMetaTypeStreamOperators("MsgId"); + +} + +// Static variables + +QString Global::quasselVersion; +QString Global::quasselDate; +uint Global::quasselBuild; +uint Global::clientBuildNeeded; +QString Global::clientVersionNeeded; +uint Global::coreBuildNeeded; +QString Global::coreVersionNeeded; + Global::RunMode Global::runMode; -QString Global::quasselDir; +uint Global::defaultPort; + +bool Global::SPUTDEV;