X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fcoreinfo.h;h=17db3cb129efba52fe896506e46cdcdb470b0358;hp=e7b924427569f1ee91428a606202e8ea72cc64ba;hb=3a3e844f9fcfd12235a0086af75ecd503b621ef4;hpb=52df0969e22249e6758714eec9e5afd7d4fe9b83 diff --git a/src/common/coreinfo.h b/src/common/coreinfo.h index e7b92442..17db3cb1 100644 --- a/src/common/coreinfo.h +++ b/src/common/coreinfo.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,29 +15,47 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef COREINFO_H -#define COREINFO_H +#pragma once + +#include "common-export.h" #include "syncableobject.h" /* - * gather various informations about the core. + * gather various information about the core. */ -class CoreInfo : public SyncableObject { - Q_OBJECT +class COMMON_EXPORT CoreInfo : public SyncableObject +{ + Q_OBJECT + SYNCABLE_OBJECT - Q_PROPERTY(QVariantMap coreData READ coreData WRITE setCoreData STORED false) + Q_PROPERTY(QVariantMap coreData READ coreData WRITE setCoreData) public: - CoreInfo(QObject *parent = 0) : SyncableObject(parent) {} + explicit CoreInfo(QObject *parent = nullptr); + inline QVariant &at(const QString &key) { return _coreData[key]; } + + void setConnectedClientData(int, QVariantList); + + /** + * Reset the core info state, clearing anything saved + */ + void reset(); + +signals: + /** + * Signals that core information has changed + */ + void coreDataChanged(QVariantMap); public slots: - virtual inline QVariantMap coreData() const { return QVariantMap(); } - virtual inline void setCoreData(const QVariantMap &) {} -}; + QVariantMap coreData() const; + void setCoreData(const QVariantMap &); -#endif //COREINFO_H +private: + QVariantMap _coreData; +};