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 ***************************************************************************/
27 #include "bufferinfo.h"
29 #include "syncableobject.h"
31 extern void messageHandler(QtMsgType type, const char *msg);
35 void Global::initIconMap() {
36 // Do not depend on GUI in core!
37 QDomDocument doc("IconMap");
38 QFile file("images/iconmap.xml");
39 if(!file.open(QIODevice::ReadOnly)) {
40 qDebug() << "Error opening iconMap file!";
42 } else if(!doc.setContent(&file)) {
44 qDebug() << "Error parsing iconMap file!";
53 * Retrieves an icon determined by its symbolic name. The mapping shall later
54 * be performed by a theme manager or something like that.
55 * @param symbol Symbol of requested icon
56 * @return Pointer to a newly created QIcon
59 //QIcon *Global::getIcon(QString /*symbol*/) {
60 //if(symbol == "connect"
65 //! Register our custom types with Qt's Meta Object System.
66 /** This makes them available for QVariant and in signals/slots, among other things.
69 void Global::registerMetaTypes() {
71 qRegisterMetaType<QVariant>("QVariant");
72 qRegisterMetaType<Message>("Message");
73 qRegisterMetaType<BufferInfo>("BufferInfo");
74 qRegisterMetaType<Identity>("Identity");
76 qRegisterMetaTypeStreamOperators<QVariant>("QVariant");
77 qRegisterMetaTypeStreamOperators<Message>("Message");
78 qRegisterMetaTypeStreamOperators<BufferInfo>("BufferInfo");
79 qRegisterMetaTypeStreamOperators<Identity>("Identity");
81 // Basic types (typedefs)
82 // These use the standard stream operators
83 qRegisterMetaType<IdentityId>("IdentityId");
84 qRegisterMetaType<BufferId>("BufferId");
85 qRegisterMetaType<NetworkId>("NetworkId");
86 qRegisterMetaType<UserId>("UserId");
88 qRegisterMetaTypeStreamOperators<IdentityId>("IdentityId");
89 qRegisterMetaTypeStreamOperators<BufferId>("BufferId");
90 qRegisterMetaTypeStreamOperators<NetworkId>("NetworkId");
91 qRegisterMetaTypeStreamOperators<UserId>("UserId");
97 QString Global::quasselVersion;
98 QString Global::quasselDate;
99 uint Global::quasselBuild;
100 uint Global::clientBuildNeeded;
101 QString Global::clientVersionNeeded;
102 uint Global::coreBuildNeeded;
103 QString Global::coreVersionNeeded;
105 Global::RunMode Global::runMode;
106 uint Global::defaultPort;