X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fbufferviewconfig.cpp;h=5cae5f8fad44abf7e0c250930769412332b295fb;hp=935d175f8f51f310f1235a04c334d9acca43a26b;hb=93c7fd515792062d325a0d7fd03a965997e62f10;hpb=731ec69d4608ba95e3ae4f154b8ca1852e1db2e5 diff --git a/src/common/bufferviewconfig.cpp b/src/common/bufferviewconfig.cpp index 935d175f..5cae5f8f 100644 --- a/src/common/bufferviewconfig.cpp +++ b/src/common/bufferviewconfig.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -22,6 +22,7 @@ #include "bufferinfo.h" +INIT_SYNCABLE_OBJECT(BufferViewConfig) BufferViewConfig::BufferViewConfig(int bufferViewId, QObject *parent) : SyncableObject(parent), _bufferViewId(bufferViewId), @@ -37,8 +38,7 @@ BufferViewConfig::BufferViewConfig(int bufferViewId, QObject *parent) BufferViewConfig::BufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent) : SyncableObject(parent), - _bufferViewId(bufferViewId), - _disableDecoration(false) // FIXME remove as soon as we have bumped the protocol version to v8 + _bufferViewId(bufferViewId) { fromVariantMap(properties); setObjectName(QString::number(bufferViewId)); @@ -49,6 +49,7 @@ void BufferViewConfig::setBufferViewName(const QString &bufferViewName) { return; _bufferViewName = bufferViewName; + SYNC(ARG(bufferViewName)) emit bufferViewNameSet(bufferViewName); } @@ -57,7 +58,9 @@ void BufferViewConfig::setNetworkId(const NetworkId &networkId) { return; _networkId = networkId; + SYNC(ARG(networkId)) emit networkIdSet(networkId); + emit configChanged(); } void BufferViewConfig::setAddNewBuffersAutomatically(bool addNewBuffersAutomatically) { @@ -65,7 +68,8 @@ void BufferViewConfig::setAddNewBuffersAutomatically(bool addNewBuffersAutomatic return; _addNewBuffersAutomatically = addNewBuffersAutomatically; - emit addNewBuffersAutomaticallySet(addNewBuffersAutomatically); + SYNC(ARG(addNewBuffersAutomatically)) + emit configChanged(); } void BufferViewConfig::setSortAlphabetically(bool sortAlphabetically) { @@ -73,7 +77,8 @@ void BufferViewConfig::setSortAlphabetically(bool sortAlphabetically) { return; _sortAlphabetically = sortAlphabetically; - emit sortAlphabeticallySet(sortAlphabetically); + SYNC(ARG(sortAlphabetically)) + emit configChanged(); } void BufferViewConfig::setDisableDecoration(bool disableDecoration) { @@ -81,7 +86,7 @@ void BufferViewConfig::setDisableDecoration(bool disableDecoration) { return; _disableDecoration = disableDecoration; - emit disableDecorationSet(disableDecoration); + SYNC(ARG(disableDecoration)) } void BufferViewConfig::setAllowedBufferTypes(int bufferTypes) { @@ -89,7 +94,8 @@ void BufferViewConfig::setAllowedBufferTypes(int bufferTypes) { return; _allowedBufferTypes = bufferTypes; - emit allowedBufferTypesSet(bufferTypes); + SYNC(ARG(bufferTypes)) + emit configChanged(); } void BufferViewConfig::setMinimumActivity(int activity) { @@ -97,7 +103,8 @@ void BufferViewConfig::setMinimumActivity(int activity) { return; _minimumActivity = activity; - emit minimumActivitySet(activity); + SYNC(ARG(activity)) + emit configChanged(); } void BufferViewConfig::setHideInactiveBuffers(bool hideInactiveBuffers) { @@ -105,7 +112,8 @@ void BufferViewConfig::setHideInactiveBuffers(bool hideInactiveBuffers) { return; _hideInactiveBuffers = hideInactiveBuffers; - emit hideInactiveBuffersSet(hideInactiveBuffers); + SYNC(ARG(hideInactiveBuffers)) + emit configChanged(); } QVariantList BufferViewConfig::initBufferList() const { @@ -125,8 +133,7 @@ void BufferViewConfig::initSetBufferList(const QVariantList &buffers) { _buffers << buffer.value(); } - // normaly initSeters don't need an emit. this one is to track changes in the settingspage - emit bufferListSet(); + emit configChanged(); // used to track changes in the settingspage } void BufferViewConfig::initSetBufferList(const QList &buffers) { @@ -136,8 +143,7 @@ void BufferViewConfig::initSetBufferList(const QList &buffers) { _buffers << bufferId; } - // normaly initSeters don't need an emit. this one is to track changes in the settingspage - emit bufferListSet(); + emit configChanged(); // used to track changes in the settingspage } QVariantList BufferViewConfig::initRemovedBuffers() const { @@ -192,7 +198,9 @@ void BufferViewConfig::addBuffer(const BufferId &bufferId, int pos) { _temporarilyRemovedBuffers.remove(bufferId); _buffers.insert(pos, bufferId); + SYNC(ARG(bufferId), ARG(pos)) emit bufferAdded(bufferId, pos); + emit configChanged(); } void BufferViewConfig::moveBuffer(const BufferId &bufferId, int pos) { @@ -205,7 +213,9 @@ void BufferViewConfig::moveBuffer(const BufferId &bufferId, int pos) { pos = _buffers.count() - 1; _buffers.move(_buffers.indexOf(bufferId), pos); + SYNC(ARG(bufferId), ARG(pos)) emit bufferMoved(bufferId, pos); + emit configChanged(); } void BufferViewConfig::removeBuffer(const BufferId &bufferId) { @@ -216,8 +226,9 @@ void BufferViewConfig::removeBuffer(const BufferId &bufferId) { _removedBuffers.remove(bufferId); _temporarilyRemovedBuffers << bufferId; - + SYNC(ARG(bufferId)) emit bufferRemoved(bufferId); + emit configChanged(); } void BufferViewConfig::removeBufferPermanently(const BufferId &bufferId) { @@ -229,5 +240,7 @@ void BufferViewConfig::removeBufferPermanently(const BufferId &bufferId) { _removedBuffers << bufferId; + SYNC(ARG(bufferId)) emit bufferPermanentlyRemoved(bufferId); + emit configChanged(); }