1 /***************************************************************************
2 * Copyright (C) 2005 by The Quassel Team *
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) any later version. *
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 ***************************************************************************/
29 /* Some global stuff */
30 typedef QMap<QString, QVariant> VarMap;
31 extern Quassel *quassel;
34 * A static class containing global data.
35 * This is used in both core and GUI modules. Where appropriate, accessors are thread-safe
36 * to account for that fact.
38 class Quassel : public QObject {
43 //static Logger *getLogger();
44 //static void setLogger(Logger *);
46 // static QIcon *getIcon(QString symbol);
48 QVariant getData(QString key);
51 void putData(QString key, const QVariant &data);
54 void dataChanged(QString key, const QVariant &data);
57 enum RunMode { Monolithic, GUIOnly, CoreOnly };
58 static RunMode runMode;
61 static void initIconMap();
63 //static Logger *logger;
65 // static QString iconPath;
66 QHash<QString, QString> iconMap;
68 QHash<QString, QVariant> data;
73 Exception(QString msg = "Unknown Exception") : _msg(msg) {};
74 virtual inline QString msg() { return _msg; }