X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fcoreinfo.h;h=b5eff67ebe96d5f1743dfa65c9d55ab806e3c708;hp=185e6eec3302b6511d7d6788f6569b7c3009b792;hb=c0d6dc0dec628f2e143e37ecc95cec45e636f8a5;hpb=694f9bfbf7f1af19108461c7e00d133e55082bce diff --git a/src/common/coreinfo.h b/src/common/coreinfo.h index 185e6eec..b5eff67e 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-2020 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,31 +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 +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) {} +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; +};