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.
68 void Global::registerMetaTypes() {
70 qRegisterMetaType<QVariant>("QVariant");
71 qRegisterMetaType<Message>("Message");
72 qRegisterMetaType<BufferInfo>("BufferInfo");
73 qRegisterMetaType<Identity>("Identity");
75 qRegisterMetaTypeStreamOperators<QVariant>("QVariant");
76 qRegisterMetaTypeStreamOperators<Message>("Message");
77 qRegisterMetaTypeStreamOperators<BufferInfo>("BufferInfo");
78 qRegisterMetaTypeStreamOperators<Identity>("Identity");
80 // Basic types (typedefs)
81 // These use the standard stream operators
82 qRegisterMetaType<IdentityId>("IdentityId");
83 qRegisterMetaType<BufferId>("BufferId");
84 qRegisterMetaType<NetworkId>("NetworkId");
86 qRegisterMetaTypeStreamOperators<IdentityId>("IdentityId");
87 qRegisterMetaTypeStreamOperators<BufferId>("BufferId");
88 qRegisterMetaTypeStreamOperators<NetworkId>("NetworkId");
92 Global::RunMode Global::runMode;
93 uint Global::defaultPort;