Make MsgId work properly with QVariant
[quassel.git] / src / common / global.cpp
index a2742d8..300d182 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-07 by the Quassel IRC 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  *
 #include "logger.h"
 #include "message.h"
 #include "identity.h"
+#include "network.h"
 #include "bufferinfo.h"
 #include "types.h"
+#include "syncableobject.h"
 
 extern void messageHandler(QtMsgType type, const char *msg);
 
@@ -63,31 +65,51 @@ void Global::initIconMap() {
 
 //! 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>("QVariant");
   qRegisterMetaType<Message>("Message");
   qRegisterMetaType<BufferInfo>("BufferInfo");
+  qRegisterMetaType<NetworkInfo>("NetworkInfo");
   qRegisterMetaType<Identity>("Identity");
+  qRegisterMetaType<Network::ConnectionState>("Network::ConnectionState");
 
   qRegisterMetaTypeStreamOperators<QVariant>("QVariant");
   qRegisterMetaTypeStreamOperators<Message>("Message");
   qRegisterMetaTypeStreamOperators<BufferInfo>("BufferInfo");
+  qRegisterMetaTypeStreamOperators<NetworkInfo>("NetworkInfo");
   qRegisterMetaTypeStreamOperators<Identity>("Identity");
+  qRegisterMetaTypeStreamOperators<qint8>("Network::ConnectionState");
 
-  // Basic types (typedefs)
-  // These use the standard stream operators
   qRegisterMetaType<IdentityId>("IdentityId");
   qRegisterMetaType<BufferId>("BufferId");
   qRegisterMetaType<NetworkId>("NetworkId");
+  qRegisterMetaType<UserId>("UserId");
+  qRegisterMetaType<AccountId>("AccountId");
+  qRegisterMetaType<MsgId>("MsgId");
 
   qRegisterMetaTypeStreamOperators<IdentityId>("IdentityId");
   qRegisterMetaTypeStreamOperators<BufferId>("BufferId");
   qRegisterMetaTypeStreamOperators<NetworkId>("NetworkId");
+  qRegisterMetaTypeStreamOperators<UserId>("UserId");
+  qRegisterMetaTypeStreamOperators<AccountId>("AccountId");
+  qRegisterMetaTypeStreamOperators<MsgId>("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;
 uint Global::defaultPort;
 
+bool Global::SPUTDEV;