1 /***************************************************************************
2 * Copyright (C) 2005-08 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
28 #include "bufferinfo.h"
30 #include "syncableobject.h"
32 extern void messageHandler(QtMsgType type, const char *msg);
36 void Global::initIconMap() {
37 // Do not depend on GUI in core!
38 QDomDocument doc("IconMap");
39 QFile file("images/iconmap.xml");
40 if(!file.open(QIODevice::ReadOnly)) {
41 qDebug() << "Error opening iconMap file!";
43 } else if(!doc.setContent(&file)) {
45 qDebug() << "Error parsing iconMap file!";
54 * Retrieves an icon determined by its symbolic name. The mapping shall later
55 * be performed by a theme manager or something like that.
56 * @param symbol Symbol of requested icon
57 * @return Pointer to a newly created QIcon
60 //QIcon *Global::getIcon(QString /*symbol*/) {
61 //if(symbol == "connect"
66 //! Register our custom types with Qt's Meta Object System.
67 /** This makes them available for QVariant and in signals/slots, among other things.
70 void Global::registerMetaTypes() {
72 qRegisterMetaType<QVariant>("QVariant");
73 qRegisterMetaType<Message>("Message");
74 qRegisterMetaType<BufferInfo>("BufferInfo");
75 qRegisterMetaType<NetworkInfo>("NetworkInfo");
76 qRegisterMetaType<Identity>("Identity");
77 qRegisterMetaType<Network::ConnectionState>("Network::ConnectionState");
79 qRegisterMetaTypeStreamOperators<QVariant>("QVariant");
80 qRegisterMetaTypeStreamOperators<Message>("Message");
81 qRegisterMetaTypeStreamOperators<BufferInfo>("BufferInfo");
82 qRegisterMetaTypeStreamOperators<NetworkInfo>("NetworkInfo");
83 qRegisterMetaTypeStreamOperators<Identity>("Identity");
84 qRegisterMetaTypeStreamOperators<qint8>("Network::ConnectionState");
86 qRegisterMetaType<IdentityId>("IdentityId");
87 qRegisterMetaType<BufferId>("BufferId");
88 qRegisterMetaType<NetworkId>("NetworkId");
89 qRegisterMetaType<UserId>("UserId");
90 qRegisterMetaType<AccountId>("AccountId");
92 qRegisterMetaTypeStreamOperators<IdentityId>("IdentityId");
93 qRegisterMetaTypeStreamOperators<BufferId>("BufferId");
94 qRegisterMetaTypeStreamOperators<NetworkId>("NetworkId");
95 qRegisterMetaTypeStreamOperators<UserId>("UserId");
96 qRegisterMetaTypeStreamOperators<AccountId>("AccountId");
102 QString Global::quasselVersion;
103 QString Global::quasselDate;
104 uint Global::quasselBuild;
105 uint Global::clientBuildNeeded;
106 QString Global::clientVersionNeeded;
107 uint Global::coreBuildNeeded;
108 QString Global::coreVersionNeeded;
110 Global::RunMode Global::runMode;
111 uint Global::defaultPort;