X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=main%2Fquassel.h;fp=core%2Fquassel.h;h=b3c942bab278b6070d0e2ca3909e6324b967851c;hp=a054e0881b9419d58d2bfcf5fb85f33adbcb7606;hb=e368a1672c4f917bfa6adb52dae3b5ebfcd0db18;hpb=8a46d2fb3b2f409b80642cd6fe30645017c980bc diff --git a/core/quassel.h b/main/quassel.h similarity index 76% rename from core/quassel.h rename to main/quassel.h index a054e088..b3c942ba 100644 --- a/core/quassel.h +++ b/main/quassel.h @@ -21,35 +21,51 @@ #ifndef _QUASSEL_H_ #define _QUASSEL_H_ -class Logger; +class Quassel; -#include -#include +#include +//#include +/* Some global stuff */ +typedef QMap VarMap; +extern Quassel *quassel; /** * A static class containing global data. * This is used in both core and GUI modules. Where appropriate, accessors are thread-safe * to account for that fact. */ -class Quassel { +class Quassel : public QObject { Q_OBJECT public: - static void init(); - static Logger *getLogger(); - static void setLogger(Logger *); + static Quassel * init(); + //static Logger *getLogger(); + //static void setLogger(Logger *); // static QIcon *getIcon(QString symbol); + QVariant getData(QString key); + + public slots: + void putData(QString key, const QVariant &data); + + signals: + void dataChanged(QString key, const QVariant &data); + + public: + enum RunMode { Monolithic, GUIOnly, CoreOnly }; + static RunMode runMode; + private: static void initIconMap(); - static Logger *logger; + //static Logger *logger; // static QString iconPath; static QHash iconMap; - + static QMutex mutex; + static QHash data; }; class Exception {