/***************************************************************************
- * Copyright (C) 2005-08 by the Quassel Project *
+ * Copyright (C) 2005-2019 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* 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
+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) {}
+ 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;
+};