X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fcoreinfo.cpp;h=5e8a78e1bc53616b474a87fdbec11236ac30ec1b;hp=f32a5a814c18e2ac67f5c98b1c861d2ef165d7c6;hb=95848fd9232d92f388e0e533adb15f6ba9d2d492;hpb=5b686746c880e5cda6d5de3e08180ea4332ff222 diff --git a/src/common/coreinfo.cpp b/src/common/coreinfo.cpp index f32a5a81..5e8a78e1 100644 --- a/src/common/coreinfo.cpp +++ b/src/common/coreinfo.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2012 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 * @@ -20,4 +20,33 @@ #include "coreinfo.h" -// this file is needed to make automoc work +CoreInfo::CoreInfo(QObject* parent) + : SyncableObject(parent) +{} + +QVariantMap CoreInfo::coreData() const +{ + return _coreData; +} + +void CoreInfo::setCoreData(const QVariantMap& coreData) +{ + _coreData = coreData; + SYNC(ARG(coreData)); + emit coreDataChanged(coreData); +} + +void CoreInfo::setConnectedClientData(const int peerCount, const QVariantList peerData) +{ + _coreData["sessionConnectedClients"] = peerCount; + _coreData["sessionConnectedClientData"] = peerData; + setCoreData(_coreData); +} + +void CoreInfo::reset() +{ + // Clear any stored data + _coreData.clear(); + // Propagate changes to listeners + emit coreDataChanged(_coreData); +}