X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fcoreinfo.h;h=284336cbbb31dc2f0de5fc2b131d8c327cff49f5;hp=185e6eec3302b6511d7d6788f6569b7c3009b792;hb=e375f7a6a6de045735a897ef05bf6dcc82770ff5;hpb=694f9bfbf7f1af19108461c7e00d133e55082bce diff --git a/src/common/coreinfo.h b/src/common/coreinfo.h index 185e6eec..284336cb 100644 --- a/src/common/coreinfo.h +++ b/src/common/coreinfo.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-09 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,31 +15,45 @@ * 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 "syncableobject.h" /* - * gather various informations about the core. + * gather various information about the core. */ class 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) {} +public: + explicit CoreInfo(QObject *parent = nullptr); + inline QVariant &at(const QString &key) { return _coreData[key]; } -public slots: - virtual inline QVariantMap coreData() const { return QVariantMap(); } - virtual inline void setCoreData(const QVariantMap &) {} -}; + void setConnectedClientData(int, QVariantList); + + /** + * Reset the core info state, clearing anything saved + */ + void reset(); +signals: + /** + * Signals that core information has changed + */ + void coreDataChanged(QVariantMap); -#endif //COREINFO_H +public slots: + QVariantMap coreData() const; + void setCoreData(const QVariantMap &); + +private: + QVariantMap _coreData; +};