Fitting the SyncableObjects to the new Style
[quassel.git] / src / common / bufferviewconfig.cpp
index 0b9ab96..14e4d04 100644 (file)
@@ -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),
@@ -48,6 +49,7 @@ void BufferViewConfig::setBufferViewName(const QString &bufferViewName) {
     return;
 
   _bufferViewName = bufferViewName;
+  SYNC(ARG(bufferViewName))
   emit bufferViewNameSet(bufferViewName);
 }
 
@@ -56,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) {
@@ -64,7 +68,8 @@ void BufferViewConfig::setAddNewBuffersAutomatically(bool addNewBuffersAutomatic
     return;
 
   _addNewBuffersAutomatically = addNewBuffersAutomatically;
-  emit addNewBuffersAutomaticallySet(addNewBuffersAutomatically);
+  SYNC(ARG(addNewBuffersAutomatically))
+  emit configChanged();
 }
 
 void BufferViewConfig::setSortAlphabetically(bool sortAlphabetically) {
@@ -72,7 +77,8 @@ void BufferViewConfig::setSortAlphabetically(bool sortAlphabetically) {
     return;
 
   _sortAlphabetically = sortAlphabetically;
-  emit sortAlphabeticallySet(sortAlphabetically);
+  SYNC(ARG(sortAlphabetically))
+  emit configChanged();
 }
 
 void BufferViewConfig::setDisableDecoration(bool disableDecoration) {
@@ -80,7 +86,7 @@ void BufferViewConfig::setDisableDecoration(bool disableDecoration) {
     return;
 
   _disableDecoration = disableDecoration;
-  emit disableDecorationSet(disableDecoration);
+  SYNC(ARG(disableDecoration))
 }
 
 void BufferViewConfig::setAllowedBufferTypes(int bufferTypes) {
@@ -88,7 +94,8 @@ void BufferViewConfig::setAllowedBufferTypes(int bufferTypes) {
     return;
 
   _allowedBufferTypes = bufferTypes;
-  emit allowedBufferTypesSet(bufferTypes);
+  SYNC(ARG(bufferTypes))
+  emit configChanged();
 }
 
 void BufferViewConfig::setMinimumActivity(int activity) {
@@ -96,7 +103,8 @@ void BufferViewConfig::setMinimumActivity(int activity) {
     return;
 
   _minimumActivity = activity;
-  emit minimumActivitySet(activity);
+  SYNC(ARG(activity))
+  emit configChanged();
 }
 
 void BufferViewConfig::setHideInactiveBuffers(bool hideInactiveBuffers) {
@@ -104,7 +112,8 @@ void BufferViewConfig::setHideInactiveBuffers(bool hideInactiveBuffers) {
     return;
 
   _hideInactiveBuffers = hideInactiveBuffers;
-  emit hideInactiveBuffersSet(hideInactiveBuffers);
+  SYNC(ARG(hideInactiveBuffers))
+  emit configChanged();
 }
 
 QVariantList BufferViewConfig::initBufferList() const {
@@ -124,8 +133,7 @@ void BufferViewConfig::initSetBufferList(const QVariantList &buffers) {
     _buffers << buffer.value<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
 }
 
 void BufferViewConfig::initSetBufferList(const QList<BufferId> &buffers) {
@@ -135,8 +143,7 @@ void BufferViewConfig::initSetBufferList(const QList<BufferId> &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,6 +199,7 @@ void BufferViewConfig::addBuffer(const BufferId &bufferId, int pos) {
 
   _buffers.insert(pos, bufferId);
   emit bufferAdded(bufferId, pos);
+  emit configChanged();
 }
 
 void BufferViewConfig::moveBuffer(const BufferId &bufferId, int pos) {
@@ -205,6 +213,7 @@ void BufferViewConfig::moveBuffer(const BufferId &bufferId, int pos) {
 
   _buffers.move(_buffers.indexOf(bufferId), pos);
   emit bufferMoved(bufferId, pos);
+  emit configChanged();
 }
 
 void BufferViewConfig::removeBuffer(const BufferId &bufferId) {
@@ -217,6 +226,7 @@ void BufferViewConfig::removeBuffer(const BufferId &bufferId) {
   _temporarilyRemovedBuffers << bufferId;
 
   emit bufferRemoved(bufferId);
+  emit configChanged();
 }
 
 void BufferViewConfig::removeBufferPermanently(const BufferId &bufferId) {
@@ -229,4 +239,5 @@ void BufferViewConfig::removeBufferPermanently(const BufferId &bufferId) {
   _removedBuffers << bufferId;
 
   emit bufferPermanentlyRemoved(bufferId);
+  emit configChanged();
 }