Fitting the SyncableObjects to the new Style
authorMarcus Eggenberger <egs@quassel-irc.org>
Sun, 23 Aug 2009 17:08:44 +0000 (19:08 +0200)
committerMarcus Eggenberger <egs@quassel-irc.org>
Mon, 24 Aug 2009 19:54:07 +0000 (21:54 +0200)
... now that was tiresome...

61 files changed:
src/client/bufferviewoverlay.cpp
src/client/clientaliasmanager.cpp
src/client/clientaliasmanager.h
src/client/clientbufferviewconfig.cpp
src/client/clientbufferviewconfig.h
src/client/clientbufferviewmanager.cpp
src/client/clientbufferviewmanager.h
src/client/clientcoreinfo.h
src/client/clientidentity.cpp
src/client/clientidentity.h
src/client/clientirclisthelper.cpp
src/client/clientirclisthelper.h
src/common/CMakeLists.txt
src/common/aliasmanager.cpp
src/common/aliasmanager.h
src/common/buffersyncer.cpp
src/common/buffersyncer.h
src/common/bufferviewconfig.cpp
src/common/bufferviewconfig.h
src/common/bufferviewmanager.cpp
src/common/bufferviewmanager.h
src/common/identity.cpp
src/common/identity.h
src/common/ircchannel.cpp
src/common/ircchannel.h
src/common/irclisthelper.cpp [new file with mode: 0644]
src/common/irclisthelper.h
src/common/ircuser.cpp
src/common/ircuser.h
src/common/network.cpp
src/common/network.h
src/common/networkconfig.cpp
src/common/networkconfig.h
src/common/signalproxy.cpp
src/common/signalproxy.h
src/common/syncableobject.cpp
src/common/syncableobject.h
src/core/corealiasmanager.cpp
src/core/corealiasmanager.h
src/core/corebacklogmanager.cpp
src/core/corebacklogmanager.h
src/core/corebuffersyncer.cpp
src/core/corebuffersyncer.h
src/core/corebufferviewconfig.cpp
src/core/corebufferviewconfig.h
src/core/corebufferviewmanager.cpp
src/core/corebufferviewmanager.h
src/core/corecoreinfo.cpp
src/core/corecoreinfo.h
src/core/coreidentity.cpp
src/core/coreidentity.h
src/core/coreircchannel.cpp
src/core/coreircchannel.h
src/core/coreirclisthelper.cpp
src/core/coreirclisthelper.h
src/core/corenetwork.cpp
src/core/corenetwork.h
src/core/corenetworkconfig.cpp
src/core/corenetworkconfig.h
src/qtui/settingspages/bufferviewsettingspage.cpp
src/uisupport/bufferviewfilter.cpp

index dc439dc..b1938d1 100644 (file)
@@ -98,16 +98,17 @@ void BufferViewOverlay::viewInitialized(BufferViewConfig *config) {
   }
   disconnect(config, SIGNAL(initDone()), this, SLOT(viewInitialized()));
 
-  connect(config, SIGNAL(networkIdSet(const NetworkId &)), this, SLOT(update()));
-  connect(config, SIGNAL(addNewBuffersAutomaticallySet(bool)), this, SLOT(update()));
-  connect(config, SIGNAL(sortAlphabeticallySet(bool)), this, SLOT(update()));
-  connect(config, SIGNAL(hideInactiveBuffersSet(bool)), this, SLOT(update()));
-  connect(config, SIGNAL(allowedBufferTypesSet(int)), this, SLOT(update()));
-  connect(config, SIGNAL(minimumActivitySet(int)), this, SLOT(update()));
-  connect(config, SIGNAL(bufferListSet()), this, SLOT(update()));
-  connect(config, SIGNAL(bufferAdded(const BufferId &, int)), this, SLOT(update()));
-  connect(config, SIGNAL(bufferRemoved(const BufferId &)), this, SLOT(update()));
-  connect(config, SIGNAL(bufferPermanentlyRemoved(const BufferId &)), this, SLOT(update()));
+  connect(config, SIGNAL(configChanged()), this, SLOT(update()));  
+//   connect(config, SIGNAL(networkIdSet(const NetworkId &)), this, SLOT(update()));
+//   connect(config, SIGNAL(addNewBuffersAutomaticallySet(bool)), this, SLOT(update()));
+//   connect(config, SIGNAL(sortAlphabeticallySet(bool)), this, SLOT(update()));
+//   connect(config, SIGNAL(hideInactiveBuffersSet(bool)), this, SLOT(update()));
+//   connect(config, SIGNAL(allowedBufferTypesSet(int)), this, SLOT(update()));
+//   connect(config, SIGNAL(minimumActivitySet(int)), this, SLOT(update()));
+//   connect(config, SIGNAL(bufferListSet()), this, SLOT(update()));
+//   connect(config, SIGNAL(bufferAdded(const BufferId &, int)), this, SLOT(update()));
+//   connect(config, SIGNAL(bufferRemoved(const BufferId &)), this, SLOT(update()));
+//   connect(config, SIGNAL(bufferPermanentlyRemoved(const BufferId &)), this, SLOT(update()));
 
   // check if the view was removed in the meantime...
   if(_bufferViewIds.contains(config->bufferViewId()))
index e8fc361..3b4a953 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "client.h"
 
+INIT_SYNCABLE_OBJECT(ClientAliasManager)
 ClientAliasManager::ClientAliasManager(QObject *parent)
   : AliasManager(parent)
 {
index 47ffe07..8b6aa37 100644 (file)
@@ -24,6 +24,7 @@
 #include "aliasmanager.h"
 
 class ClientAliasManager : public AliasManager {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index 76a6316..1e7f816 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "clientbufferviewconfig.h"
 
+INIT_SYNCABLE_OBJECT(ClientBufferViewConfig)
 ClientBufferViewConfig::ClientBufferViewConfig(int bufferViewId, QObject *parent)
   : BufferViewConfig(bufferViewId, parent),
     _locked(false)
index cac0be7..5f6c0ed 100644 (file)
@@ -24,6 +24,7 @@
 #include "bufferviewconfig.h"
 
 class ClientBufferViewConfig : public BufferViewConfig {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index b31f69e..166cda1 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "clientbufferviewconfig.h"
 
+INIT_SYNCABLE_OBJECT(ClientBufferViewManager)
 ClientBufferViewManager::ClientBufferViewManager(SignalProxy *proxy, QObject *parent)
   : BufferViewManager(proxy, parent)
 {
index f190362..912c540 100644 (file)
@@ -27,6 +27,7 @@ class ClientBufferViewConfig;
 class BufferViewOverlay;
 
 class ClientBufferViewManager : public BufferViewManager {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index 54e2909..3bd08a4 100644 (file)
@@ -29,6 +29,7 @@
  */ 
 class ClientCoreInfo : public CoreInfo {
   Q_OBJECT
+  SYNCABLE_OBJECT
 
 public:
   ClientCoreInfo(QObject *parent = 0) : CoreInfo(parent) {}
index 9a1e0a6..4849bdb 100644 (file)
@@ -23,6 +23,7 @@
 #include "client.h"
 #include "signalproxy.h"
 
+INIT_SYNCABLE_OBJECT(CertIdentity)
 CertIdentity::CertIdentity(IdentityId id, QObject *parent)
   : Identity(id, parent)
 #ifdef HAVE_SSL
index 5935d41..730b662 100644 (file)
@@ -26,6 +26,7 @@
 class ClientCertManager;
 
 class CertIdentity : public Identity {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index c515dd1..fd52b9a 100644 (file)
@@ -25,6 +25,7 @@
 #include "client.h"
 #include "irclistmodel.h"
 
+INIT_SYNCABLE_OBJECT(ClientIrcListHelper)
 QVariantList ClientIrcListHelper::requestChannelList(const NetworkId &netId, const QStringList &channelFilters) {
   _netId = netId;
   return IrcListHelper::requestChannelList(netId, channelFilters);
index 9a60ec1..3cc5b7b 100644 (file)
@@ -24,6 +24,7 @@
 #include "irclisthelper.h"
 
 class ClientIrcListHelper : public IrcListHelper {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
@@ -35,9 +36,12 @@ public slots:
   virtual QVariantList requestChannelList(const NetworkId &netId, const QStringList &channelFilters);
   virtual void receiveChannelList(const NetworkId &netId, const QStringList &channelFilters, const QVariantList &channels);
   virtual void reportFinishedList(const NetworkId &netId);
+  inline virtual void reportError(const QString &error) { emit errorReported(error); }
 
 signals:
   void channelListReceived(const NetworkId &netId, const QStringList &channelFilters, const QList<IrcListHelper::ChannelDescription> &channelList);
+  void finishedListReported(const NetworkId &netId);
+  void errorReported(const QString &error);
 
 private:
   NetworkId _netId;
index 7c883a9..819077a 100644 (file)
@@ -14,6 +14,7 @@ set(SOURCES
     cliparser.cpp
     identity.cpp
     ircchannel.cpp
+    irclisthelper.cpp
     ircuser.cpp
     logger.cpp
     message.cpp
index b398b8b..9815b58 100644 (file)
@@ -25,6 +25,7 @@
 #include "aliasmanager.h"
 #include "network.h"
 
+INIT_SYNCABLE_OBJECT(AliasManager)
 AliasManager &AliasManager::operator=(const AliasManager &other) {
   if(this == &other)
     return *this;
@@ -80,7 +81,7 @@ void AliasManager::addAlias(const QString &name, const QString &expansion) {
 
   _aliases << Alias(name, expansion);
 
-  emit aliasAdded(name, expansion);
+  SYNC(ARG(name), ARG(expansion))
 }
 
 AliasManager::AliasList AliasManager::defaults() {
index c72f57d..67a5620 100644 (file)
@@ -29,6 +29,7 @@
 class Network;
 
 class AliasManager : public SyncableObject {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
@@ -67,9 +68,6 @@ protected:
   void setAliases(const QList<Alias> &aliases) { _aliases = aliases; }
   virtual const Network *network(NetworkId) const = 0; // core and client require different access
 
-signals:
-  void aliasAdded(const QString &name, const QString &expansion);
-
 private:
   void processInput(const BufferInfo &info, const QString &message, CommandList &previousCommands);
   void expand(const QString &alias, const BufferInfo &bufferInfo, const QString &msg, CommandList &previousCommands);
index f05d163..82fe0da 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "buffersyncer.h"
 
+INIT_SYNCABLE_OBJECT(BufferSyncer)
 BufferSyncer::BufferSyncer(QObject *parent)
   : SyncableObject(parent)
 {
@@ -44,6 +45,7 @@ bool BufferSyncer::setLastSeenMsg(BufferId buffer, const MsgId &msgId) {
   const MsgId oldLastSeenMsg = lastSeenMsg(buffer);
   if(!oldLastSeenMsg.isValid() || oldLastSeenMsg < msgId) {
     _lastSeenMsg[buffer] = msgId;
+    SYNC(ARG(buffer), ARG(msgId))
     emit lastSeenMsgSet(buffer, msgId);
     return true;
   }
@@ -72,12 +74,13 @@ void BufferSyncer::initSetLastSeenMsg(const QVariantList &list) {
 void BufferSyncer::removeBuffer(BufferId buffer) {
   if(_lastSeenMsg.contains(buffer))
     _lastSeenMsg.remove(buffer);
+  SYNC(ARG(buffer))
   emit bufferRemoved(buffer);
 }
 
-
 void BufferSyncer::mergeBuffersPermanently(BufferId buffer1, BufferId buffer2) {
   if(_lastSeenMsg.contains(buffer2))
     _lastSeenMsg.remove(buffer2);
+  SYNC(ARG(buffer1), ARG(buffer2))
   emit buffersPermanentlyMerged(buffer1, buffer2);
 }
index 0973828..4893189 100644 (file)
@@ -25,6 +25,7 @@
 #include "types.h"
 
 class BufferSyncer : public SyncableObject {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
@@ -39,34 +40,25 @@ public slots:
   QVariantList initLastSeenMsg() const;
   void initSetLastSeenMsg(const QVariantList &);
 
-  virtual inline void requestSetLastSeenMsg(BufferId buffer, const MsgId &msgId) { emit setLastSeenMsgRequested(buffer, msgId); }
+  virtual inline void requestSetLastSeenMsg(BufferId buffer, const MsgId &msgId) { REQUEST(ARG(buffer), ARG(msgId)) }
 
-  virtual inline void requestRemoveBuffer(BufferId buffer) { emit removeBufferRequested(buffer); }
+  virtual inline void requestRemoveBuffer(BufferId buffer) { REQUEST(ARG(buffer)) }
   virtual void removeBuffer(BufferId buffer);
 
-  virtual inline void requestRenameBuffer(BufferId buffer, QString newName) { emit renameBufferRequested(buffer, newName); }
-  virtual inline void renameBuffer(BufferId buffer, QString newName) { emit bufferRenamed(buffer, newName); }
+  virtual inline void requestRenameBuffer(BufferId buffer, QString newName) { REQUEST(ARG(buffer), ARG(newName)) }
+  virtual inline void renameBuffer(BufferId buffer, QString newName) { SYNC(ARG(buffer), ARG(newName)) emit bufferRenamed(buffer, newName); }
 
-  virtual inline void requestMergeBuffersPermanently(BufferId buffer1, BufferId buffer2) { emit mergeBuffersPermanentlyRequested(buffer1, buffer2); }
+  virtual inline void requestMergeBuffersPermanently(BufferId buffer1, BufferId buffer2) { emit REQUEST(ARG(buffer1), ARG(buffer2)) }
   virtual void mergeBuffersPermanently(BufferId buffer1, BufferId buffer2);
 
-  virtual inline void requestPurgeBufferIds() { emit purgeBufferIdsRequested(); }
+  virtual inline void requestPurgeBufferIds() { REQUEST(NO_ARG); }
 
 signals:
   void lastSeenMsgSet(BufferId buffer, const MsgId &msgId);
-  void setLastSeenMsgRequested(BufferId buffer, const MsgId &msgId);
-
-  void removeBufferRequested(BufferId buffer);
   void bufferRemoved(BufferId buffer);
-
-  void renameBufferRequested(BufferId buffer, QString newName);
   void bufferRenamed(BufferId buffer, QString newName);
-
-  void mergeBuffersPermanentlyRequested(BufferId buffer1, BufferId buffer2);
   void buffersPermanentlyMerged(BufferId buffer1, BufferId buffer2);
 
-  void purgeBufferIdsRequested();
-
 protected slots:
   bool setLastSeenMsg(BufferId buffer, const MsgId &msgId);
   QList<BufferId> bufferIds() const { return _lastSeenMsg.keys(); }
index 0ec0348..14e4d04 100644 (file)
@@ -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();
 }
index 9142053..75ca9cf 100644 (file)
@@ -26,7 +26,9 @@
 #include "types.h"
 
 class BufferViewConfig : public SyncableObject {
+  SYNCABLE_OBJECT
   Q_OBJECT
+
   Q_PROPERTY(QString bufferViewName READ bufferViewName WRITE setBufferViewName)
   Q_PROPERTY(NetworkId networkId READ networkId WRITE setNetworkId)
   Q_PROPERTY(bool addNewBuffersAutomatically READ addNewBuffersAutomatically WRITE setAddNewBuffersAutomatically)
@@ -69,7 +71,7 @@ public slots:
   inline bool hideInactiveBuffers() const { return _hideInactiveBuffers; }
   void setHideInactiveBuffers(bool hideInactiveBuffers);
 
-  virtual inline void requestSetBufferViewName(const QString &bufferViewName) { emit setBufferViewNameRequested(bufferViewName); }
+  virtual inline void requestSetBufferViewName(const QString &bufferViewName) { REQUEST(ARG(bufferViewName)) }
 
   const QList<BufferId> &bufferList() const { return _buffers; }
   const QSet<BufferId> &removedBuffers() const { return _removedBuffers; }
@@ -86,36 +88,37 @@ public slots:
   void initSetTemporarilyRemovedBuffers(const QVariantList &buffers);
 
   void addBuffer(const BufferId &bufferId, int pos);
-  virtual inline void requestAddBuffer(const BufferId &bufferId, int pos) { emit addBufferRequested(bufferId, pos); }
+  virtual inline void requestAddBuffer(const BufferId &bufferId, int pos) { REQUEST(ARG(bufferId), ARG(pos)) }
   void moveBuffer(const BufferId &bufferId, int pos);
-  virtual inline void requestMoveBuffer(const BufferId &bufferId, int pos) { emit moveBufferRequested(bufferId, pos); }
+  virtual inline void requestMoveBuffer(const BufferId &bufferId, int pos) { REQUEST(ARG(bufferId), ARG(pos)) }
   void removeBuffer(const BufferId &bufferId);
-  virtual inline void requestRemoveBuffer(const BufferId &bufferId) { emit removeBufferRequested(bufferId); }
+  virtual inline void requestRemoveBuffer(const BufferId &bufferId) { REQUEST(ARG(bufferId)) }
   void removeBufferPermanently(const BufferId &bufferId);
-  virtual inline void requestRemoveBufferPermanently(const BufferId &bufferId) { emit removeBufferPermanentlyRequested(bufferId); }
+  virtual inline void requestRemoveBufferPermanently(const BufferId &bufferId) { REQUEST(ARG(bufferId)) }
 
 
 signals:
-  void bufferViewNameSet(const QString &bufferViewName);
+  void bufferViewNameSet(const QString &bufferViewName); // invalidate
+  void configChanged();
   void networkIdSet(const NetworkId &networkId);
-  void addNewBuffersAutomaticallySet(bool addNewBuffersAutomatically);
-  void sortAlphabeticallySet(bool sortAlphabetically);
-  void disableDecorationSet(bool disableDecoration);
-  void allowedBufferTypesSet(int allowedBufferTypes);
-  void minimumActivitySet(int activity);
-  void hideInactiveBuffersSet(bool hideInactiveBuffers);
-  void bufferListSet();
+//   void addNewBuffersAutomaticallySet(bool addNewBuffersAutomatically); // invalidate
+//   void sortAlphabeticallySet(bool sortAlphabetically); // invalidate
+//   //  void disableDecorationSet(bool disableDecoration); // invalidate
+//   void allowedBufferTypesSet(int allowedBufferTypes); // invalidate
+//   void minimumActivitySet(int activity); // invalidate
+//   void hideInactiveBuffersSet(bool hideInactiveBuffers); // invalidate
+  void bufferListSet(); // invalidate
 
   void bufferAdded(const BufferId &bufferId, int pos);
-  void addBufferRequested(const BufferId &bufferId, int pos);
+//   void addBufferRequested(const BufferId &bufferId, int pos);
   void bufferMoved(const BufferId &bufferId, int pos);
-  void moveBufferRequested(const BufferId &bufferId, int pos);
+//   void moveBufferRequested(const BufferId &bufferId, int pos);
   void bufferRemoved(const BufferId &bufferId);
   void bufferPermanentlyRemoved(const BufferId &bufferId);
-  void removeBufferRequested(const BufferId &bufferId);
-  void removeBufferPermanentlyRequested(const BufferId &bufferId);
+//   void removeBufferRequested(const BufferId &bufferId);
+//   void removeBufferPermanentlyRequested(const BufferId &bufferId);
 
-  void setBufferViewNameRequested(const QString &bufferViewName);
+//   void setBufferViewNameRequested(const QString &bufferViewName);
 
 private:
   int _bufferViewId;
index 59d3a9b..42cb6ad 100644 (file)
@@ -23,6 +23,7 @@
 #include "bufferviewconfig.h"
 #include "signalproxy.h"
 
+INIT_SYNCABLE_OBJECT(BufferViewManager)
 BufferViewManager::BufferViewManager(SignalProxy *proxy, QObject *parent)
   : SyncableObject(parent),
     _proxy(proxy)
@@ -47,7 +48,9 @@ void BufferViewManager::addBufferViewConfig(BufferViewConfig *config) {
 
   _proxy->synchronize(config);
   _bufferViewConfigs[config->bufferViewId()] = config;
-  emit bufferViewConfigAdded(config->bufferViewId());
+  int bufferViewId = config->bufferViewId();
+  SYNC_OTHER(addBufferViewConfig, ARG(bufferViewId))
+  emit bufferViewConfigAdded(bufferViewId);
 }
 
 void BufferViewManager::addBufferViewConfig(int bufferViewConfigId) {
@@ -63,6 +66,7 @@ void BufferViewManager::deleteBufferViewConfig(int bufferViewConfigId) {
 
   _bufferViewConfigs[bufferViewConfigId]->deleteLater();
   _bufferViewConfigs.remove(bufferViewConfigId);
+  SYNC(ARG(bufferViewConfigId))
   emit bufferViewConfigDeleted(bufferViewConfigId);
 }
 
index 6281a44..23322ab 100644 (file)
@@ -30,6 +30,7 @@ class BufferViewConfig;
 class SignalProxy;
 
 class BufferViewManager : public SyncableObject {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
@@ -50,18 +51,18 @@ public slots:
   QVariantList initBufferViewIds() const;
   void initSetBufferViewIds(const QVariantList bufferViewIds);
 
-  virtual inline void requestCreateBufferView(const QVariantMap &properties) { emit createBufferViewRequested(properties); }
-  virtual inline void requestCreateBufferViews(const QVariantList &properties) { emit createBufferViewsRequested(properties); }
-  virtual inline void requestDeleteBufferView(int bufferViewId) { emit deleteBufferViewRequested(bufferViewId); }
-  virtual inline void requestDeleteBufferViews(const QVariantList &bufferViews) { emit deleteBufferViewsRequested(bufferViews); }
+  virtual inline void requestCreateBufferView(const QVariantMap &properties) { REQUEST(ARG(properties)) }
+  virtual inline void requestCreateBufferViews(const QVariantList &properties) { REQUEST(ARG(properties)) }
+  virtual inline void requestDeleteBufferView(int bufferViewId) { REQUEST(ARG(bufferViewId)) }
+  virtual inline void requestDeleteBufferViews(const QVariantList &bufferViews) { REQUEST(ARG(bufferViews)) }
 
 signals:
   void bufferViewConfigAdded(int bufferViewConfigId);
   void bufferViewConfigDeleted(int bufferViewConfigId);
-  void createBufferViewRequested(const QVariantMap &properties);
-  void createBufferViewsRequested(const QVariantList &properties);
-  void deleteBufferViewRequested(int bufferViewId);
-  void deleteBufferViewsRequested(const QVariantList &bufferViews);
+//   void createBufferViewRequested(const QVariantMap &properties);
+//   void createBufferViewsRequested(const QVariantList &properties);
+//   void deleteBufferViewRequested(int bufferViewId);
+//   void deleteBufferViewsRequested(const QVariantList &bufferViews);
 
 protected:
   typedef QHash<int, BufferViewConfig *> BufferViewConfigHash;
index 0569178..728cff1 100644 (file)
@@ -42,6 +42,7 @@
 #  include <Security.h>
 #endif
 
+INIT_SYNCABLE_OBJECT(Identity)
 Identity::Identity(IdentityId id, QObject *parent)
   : SyncableObject(parent),
     _identityId(id)
@@ -171,98 +172,100 @@ void Identity::setToDefaults() {
 
 void Identity::setId(IdentityId _id) {
   _identityId = _id;
+  SYNC(ARG(_id))
   emit idSet(_id);
   renameObject(QString::number(id().toInt()));
 }
 
 void Identity::setIdentityName(const QString &identityName) {
   _identityName = identityName;
-  emit identityNameSet(identityName);
+  SYNC(ARG(identityName))
 }
 
 void Identity::setRealName(const QString &realName) {
   _realName = realName;
-  emit realNameSet(realName);
+  SYNC(ARG(realName))
 }
 
 void Identity::setNicks(const QStringList &nicks) {
   _nicks = nicks;
+  SYNC(ARG(nicks))
   emit nicksSet(nicks);
 }
 
 void Identity::setAwayNick(const QString &nick) {
   _awayNick = nick;
-  emit awayNickSet(nick);
+  SYNC(ARG(nick))
 }
 
 void Identity::setAwayReason(const QString &reason) {
   _awayReason = reason;
-  emit awayReasonSet(reason);
+  SYNC(ARG(reason))
 }
 
 void Identity::setAwayNickEnabled(bool enabled) {
   _awayNickEnabled = enabled;
-  emit awayNickEnabledSet(enabled);
+  SYNC(ARG(enabled))
 }
 
 void Identity::setAwayReasonEnabled(bool enabled) {
   _awayReasonEnabled = enabled;
-  emit awayReasonEnabledSet(enabled);
+  SYNC(ARG(enabled))
 }
 
 void Identity::setAutoAwayEnabled(bool enabled) {
   _autoAwayEnabled = enabled;
-  emit autoAwayEnabledSet(enabled);
+  SYNC(ARG(enabled))
 }
 
 void Identity::setAutoAwayTime(int time) {
   _autoAwayTime = time;
-  emit autoAwayTimeSet(time);
+  SYNC(ARG(time))
 }
 
 void Identity::setAutoAwayReason(const QString &reason) {
   _autoAwayReason = reason;
-  emit autoAwayReasonSet(reason);
+  SYNC(ARG(reason))
 }
 
 void Identity::setAutoAwayReasonEnabled(bool enabled) {
   _autoAwayReasonEnabled = enabled;
-  emit autoAwayReasonEnabledSet(enabled);
+  SYNC(ARG(enabled))
 }
 
 void Identity::setDetachAwayEnabled(bool enabled) {
   _detachAwayEnabled = enabled;
-  emit detachAwayEnabledSet(enabled);
+  SYNC(ARG(enabled))
 }
 
 void Identity::setDetachAwayReason(const QString &reason) {
   _detachAwayReason = reason;
-  emit detachAwayReasonSet(reason);
+  SYNC(ARG(reason))
 }
 
 void Identity::setDetachAwayReasonEnabled(bool enabled) {
   _detachAwayReasonEnabled = enabled;
-  emit detachAwayReasonEnabledSet(enabled);
+  SYNC(ARG(enabled))
 }
 
 void Identity::setIdent(const QString &ident) {
   _ident = ident;
-  emit identSet(ident);
+  SYNC(ARG(ident))
 }
 
 void Identity::setKickReason(const QString &reason) {
   _kickReason = reason;
-  emit kickReasonSet(reason);
+  SYNC(ARG(reason))
 }
 
 void Identity::setPartReason(const QString &reason) {
   _partReason = reason;
-  emit partReasonSet(reason);
+  SYNC(ARG(reason))
 }
 
 void Identity::setQuitReason(const QString &reason) {
   _quitReason = reason;
-  emit quitReasonSet(reason);
+  SYNC(ARG(reason))
 }
 
 /***  ***/
@@ -312,3 +315,4 @@ QDataStream &operator>>(QDataStream &in, Identity &id) {
   return in;
 }
 
+INIT_SYNCABLE_OBJECT(CertManager)
index 3e9a560..6345046 100644 (file)
@@ -31,6 +31,7 @@
 #include "syncableobject.h"
 
 class Identity : public SyncableObject {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
   Q_PROPERTY(IdentityId identityId READ id WRITE setId STORED false)
@@ -110,24 +111,24 @@ public slots:
 
 signals:
   void idSet(IdentityId id);
-  void identityNameSet(const QString &name);
-  void realNameSet(const QString &realName);
+//   void identityNameSet(const QString &name);
+//   void realNameSet(const QString &realName);
   void nicksSet(const QStringList &nicks);
-  void awayNickSet(const QString &awayNick);
-  void awayNickEnabledSet(bool);
-  void awayReasonSet(const QString &awayReason);
-  void awayReasonEnabledSet(bool);
-  void autoAwayEnabledSet(bool);
-  void autoAwayTimeSet(int);
-  void autoAwayReasonSet(const QString &);
-  void autoAwayReasonEnabledSet(bool);
-  void detachAwayEnabledSet(bool);
-  void detachAwayReasonSet(const QString &);
-  void detachAwayReasonEnabledSet(bool);
-  void identSet(const QString &);
-  void kickReasonSet(const QString &);
-  void partReasonSet(const QString &);
-  void quitReasonSet(const QString &);
+//   void awayNickSet(const QString &awayNick);
+//   void awayNickEnabledSet(bool);
+//   void awayReasonSet(const QString &awayReason);
+//   void awayReasonEnabledSet(bool);
+//   void autoAwayEnabledSet(bool);
+//   void autoAwayTimeSet(int);
+//   void autoAwayReasonSet(const QString &);
+//   void autoAwayReasonEnabledSet(bool);
+//   void detachAwayEnabledSet(bool);
+//   void detachAwayReasonSet(const QString &);
+//   void detachAwayReasonEnabledSet(bool);
+//   void identSet(const QString &);
+//   void kickReasonSet(const QString &);
+//   void partReasonSet(const QString &);
+//   void quitReasonSet(const QString &);
 
 private:
   IdentityId _identityId;
@@ -163,6 +164,7 @@ Q_DECLARE_METATYPE(Identity)
 #include <QSslCertificate>
 
 class CertManager : public SyncableObject {
+  SYNCABLE_OBJECT
   Q_OBJECT
   Q_PROPERTY(QByteArray sslKey READ sslKeyPem WRITE setSslKey STORED false)
   Q_PROPERTY(QByteArray sslCert READ sslCertPem WRITE setSslCert STORED false)
@@ -177,12 +179,8 @@ public:
   inline QByteArray sslCertPem() const { return sslCert().toPem(); }
 
 public slots:
-  inline virtual void setSslKey(const QByteArray &encoded) { emit sslKeySet(encoded); }
-  inline virtual void setSslCert(const QByteArray &encoded) { emit sslCertSet(encoded); }
-
-signals:
-  void sslKeySet(const QByteArray &);
-  void sslCertSet(const QByteArray &);
+  inline virtual void setSslKey(const QByteArray &encoded) { SYNC(ARG(encoded)) }
+  inline virtual void setSslCert(const QByteArray &encoded) { SYNC(ARG(encoded)) }
 };
 
 #endif // HAVE_SSL
index 5c2ba72..88d1e85 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <QDebug>
 
-
+INIT_SYNCABLE_OBJECT(IrcChannel)
 IrcChannel::IrcChannel(const QString &channelname, Network *network)
   : SyncableObject(network),
     _initialized(false),
@@ -121,7 +121,7 @@ void IrcChannel::setTopic(const QString &topic) {
 
 void IrcChannel::setPassword(const QString &password) {
   _password = password;
-  emit passwordSet(password);
+  SYNC(ARG(password))
 }
 
 void IrcChannel::joinIrcUsers(const QList<IrcUser *> &users, const QStringList &modes) {
@@ -148,6 +148,7 @@ void IrcChannel::joinIrcUsers(const QList<IrcUser *> &users, const QStringList &
     _userModes[ircuser] = modes[i];
     ircuser->joinChannel(this);
     connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickSet(QString)));
+
     // connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed()));
     // if you wonder why there is no counterpart to ircUserJoined:
     // the joines are propagted by the ircuser. the signal ircUserJoined is only for convenience
@@ -159,9 +160,9 @@ void IrcChannel::joinIrcUsers(const QList<IrcUser *> &users, const QStringList &
 
   if(newNicks.isEmpty())
     return;
-  
+
+  SYNC_OTHER(joinIrcUsers, ARG(newNicks), ARG(newModes));
   emit ircUsersJoined(newUsers);
-  emit ircUsersJoined(newNicks, newModes);
 }
 
 void IrcChannel::joinIrcUsers(const QStringList &nicks, const QStringList &modes) {
@@ -171,7 +172,7 @@ void IrcChannel::joinIrcUsers(const QStringList &nicks, const QStringList &modes
   joinIrcUsers(users, modes);
 }
                      
-void IrcChannel::joinIrcUsers(IrcUser *ircuser) {
+void IrcChannel::joinIrcUser(IrcUser *ircuser) {
   QList <IrcUser *> users;
   users << ircuser;
   QStringList modes;
@@ -179,10 +180,6 @@ void IrcChannel::joinIrcUsers(IrcUser *ircuser) {
   joinIrcUsers(users, modes);
 }
 
-void IrcChannel::joinIrcUsers(const QString &nick) {
-  joinIrcUsers(network->newIrcUser(nick));
-}
-
 void IrcChannel::part(IrcUser *ircuser) {
   if(isKnownUser(ircuser)) {
     _userModes.remove(ircuser);
@@ -215,7 +212,8 @@ void IrcChannel::part(const QString &nick) {
 void IrcChannel::setUserModes(IrcUser *ircuser, const QString &modes) {
   if(isKnownUser(ircuser)) {
     _userModes[ircuser] = modes;
-    emit userModesSet(ircuser->nick(), modes);
+    QString nick = ircuser->nick();
+    SYNC_OTHER(setUserModes, ARG(nick), ARG(modes))
     emit ircUserModesSet(ircuser, modes);
   }
 }
@@ -231,7 +229,8 @@ void IrcChannel::addUserMode(IrcUser *ircuser, const QString &mode) {
 
   if(!_userModes[ircuser].contains(mode)) {
     _userModes[ircuser] += mode;
-    emit userModeAdded(ircuser->nick(), mode);
+    QString nick = ircuser->nick();
+    SYNC_OTHER(addUserMode, ARG(nick), ARG(mode))
     emit ircUserModeAdded(ircuser, mode);
   }
 
@@ -248,7 +247,8 @@ void IrcChannel::removeUserMode(IrcUser *ircuser, const QString &mode) {
 
   if(_userModes[ircuser].contains(mode)) {
     _userModes[ircuser].remove(mode);
-    emit userModeRemoved(ircuser->nick(), mode);
+    QString nick = ircuser->nick();
+    SYNC_OTHER(removeUserMode, ARG(nick), ARG(mode));
     emit ircUserModeRemoved(ircuser, mode);
   }
 }
@@ -432,7 +432,7 @@ void IrcChannel::addChannelMode(const QChar &mode, const QString &value) {
     _D_channelModes << mode;
     break;
   }
-  emit channelModeAdded(mode, value);
+  SYNC(ARG(mode), ARG(value))
 }
 
 void IrcChannel::removeChannelMode(const QChar &mode, const QString &value) {
@@ -458,7 +458,7 @@ void IrcChannel::removeChannelMode(const QChar &mode, const QString &value) {
     _D_channelModes.remove(mode);
     break;
   }
-  emit channelModeRemoved(mode, value);
+  SYNC(ARG(mode), ARG(value))
 }
 
 bool IrcChannel::hasMode(const QChar &mode) const {
index 5bcaa79..7f7d04a 100644 (file)
@@ -33,6 +33,7 @@ class IrcUser;
 class Network;
 
 class IrcChannel : public SyncableObject {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
   Q_PROPERTY(QString name READ name STORED false)
@@ -76,8 +77,7 @@ public slots:
 
   void joinIrcUsers(const QList<IrcUser *> &users, const QStringList &modes);
   void joinIrcUsers(const QStringList &nicks, const QStringList &modes);
-  void joinIrcUsers(IrcUser *ircuser);
-  void joinIrcUsers(const QString &nick);
+  void joinIrcUser(IrcUser *ircuser);
 
   void part(IrcUser *ircuser);
   void part(const QString &nick);
@@ -103,16 +103,16 @@ public slots:
   void initSetChanModes(const QVariantMap &chanModes);
 
 signals:
-  void topicSet(const QString &topic);
-  void passwordSet(const QString &password);
-  void userModesSet(QString nick, QString modes);
-  void userModeAdded(QString nick, QString mode);
-  void userModeRemoved(QString nick, QString mode);
-  void channelModeAdded(const QChar &mode, const QString &value);
-  void channelModeRemoved(const QChar &mode, const QString &value);
+  void topicSet(const QString &topic); // needed by NetworkModel
+//   void passwordSet(const QString &password);
+//   void userModesSet(QString nick, QString modes);
+//   void userModeAdded(QString nick, QString mode);
+//   void userModeRemoved(QString nick, QString mode);
+//   void channelModeAdded(const QChar &mode, const QString &value);
+//   void channelModeRemoved(const QChar &mode, const QString &value);
   
   void ircUsersJoined(QList<IrcUser *> ircusers);
-  void ircUsersJoined(QStringList nicks, QStringList modes);
+//   void ircUsersJoined(QStringList nicks, QStringList modes);
   void ircUserParted(IrcUser *ircuser);
   void ircUserNickSet(IrcUser *ircuser, QString nick);
   void ircUserModeAdded(IrcUser *ircuser, QString mode);
diff --git a/src/common/irclisthelper.cpp b/src/common/irclisthelper.cpp
new file mode 100644 (file)
index 0000000..b363234
--- /dev/null
@@ -0,0 +1,23 @@
+/***************************************************************************
+ *   Copyright (C) 2005-08 by the Quassel Project                          *
+ *   devel@quassel-irc.org                                                 *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) version 3.                                           *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   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.             *
+ ***************************************************************************/
+
+#include "irclisthelper.h"
+
+INIT_SYNCABLE_OBJECT(IrcListHelper)
index b4e8b95..72c3712 100644 (file)
@@ -33,6 +33,7 @@
  *  3.) client pulls the data by calling requestChannelList again. receiving the data in receiveChannelList
  */
 class IrcListHelper : public SyncableObject {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
@@ -46,15 +47,11 @@ public:
   };
 
 public slots:
-  inline virtual QVariantList requestChannelList(const NetworkId &netId, const QStringList &channelFilters) { emit channelListRequested(netId, channelFilters); return QVariantList(); }
+  inline virtual QVariantList requestChannelList(const NetworkId &netId, const QStringList &channelFilters) { REQUEST(ARG(netId), ARG(channelFilters)); return QVariantList(); }
   inline virtual void receiveChannelList(const NetworkId &, const QStringList &, const QVariantList &) {};
-  inline virtual void reportFinishedList(const NetworkId &netId) { emit finishedListReported(netId); }
-  inline virtual void reportError(const QString &error) { emit errorReported(error); }
-
-signals:
-  void channelListRequested(const NetworkId &netId, const QStringList &channelFilters);
-  void finishedListReported(const NetworkId &netId);
-  void errorReported(const QString &error);
+  inline virtual void reportFinishedList(const NetworkId &netId) { SYNC(ARG(netId)) }
+  inline virtual void reportError(const QString &error) { SYNC(ARG(error)) }
 };
 
+
 #endif //IRCLISTHELPER_H
index e42bea7..5bd4c8b 100644 (file)
@@ -124,6 +124,7 @@ void IrcUser::setRealName(const QString &realName) {
 void IrcUser::setAway(const bool &away) {
   if(away != _away) {
     _away = away;
+    emit awaySet(away);
     SYNC(ARG(away))
   }
 }
@@ -182,6 +183,7 @@ void IrcUser::setNick(const QString &nick) {
   if(!nick.isEmpty() && nick != _nick) {
     _nick = nick;
     updateObjectName();
+    emit nickSet(nick);
     SYNC(ARG(nick))
   }
 }
@@ -218,7 +220,7 @@ void IrcUser::joinChannel(IrcChannel *channel) {
   Q_ASSERT(channel);
   if(!_channels.contains(channel)) {
     _channels.insert(channel);
-    channel->joinIrcUsers(this);
+    channel->joinIrcUser(this);
   }
 }
 
@@ -231,7 +233,8 @@ void IrcUser::partChannel(IrcChannel *channel) {
     _channels.remove(channel);
     disconnect(channel, 0, this, 0);
     channel->part(this);
-    emit channelParted(channel->name());
+    QString channelName = channel->name();
+    SYNC_OTHER(partChannel, ARG(channelName))
     if(_channels.isEmpty() && !network()->isMe(this))
       quit();
   }
@@ -270,6 +273,7 @@ void IrcUser::channelDestroyed() {
 void IrcUser::setUserModes(const QString &modes) {
   _userModes = modes;
   SYNC(ARG(modes))
+  emit userModesSet(modes);
 }
 
 void IrcUser::addUserModes(const QString &modes) {
@@ -282,6 +286,7 @@ void IrcUser::addUserModes(const QString &modes) {
   }
 
   SYNC(ARG(modes))
+  emit userModesAdded(modes);
 }
 
 void IrcUser::removeUserModes(const QString &modes) {
@@ -292,6 +297,7 @@ void IrcUser::removeUserModes(const QString &modes) {
     _userModes.remove(modes[i]);
   }
   SYNC(ARG(modes))
+  emit userModesRemoved(modes);
 }
 
 void IrcUser::setLastChannelActivity(BufferId buffer, const QDateTime &time) {
index 8499dd1..7ec878e 100644 (file)
@@ -126,9 +126,9 @@ public slots:
 signals:
 //   void userSet(QString user);
 //   void hostSet(QString host);
-//   void nickSet(QString newnick);
+  void nickSet(QString newnick); // needed in NetworkModel
 //   void realNameSet(QString realName);
-//   void awaySet(bool away);
+  void awaySet(bool away); // needed in NetworkModel
 //   void awayMessageSet(QString awayMessage);
 //   void idleTimeSet(QDateTime idleTime);
 //   void loginTimeSet(QDateTime loginTime);
@@ -138,9 +138,9 @@ signals:
 //   void whoisServiceReplySet(QString whoisServiceReply);
 //   void suserHostSet(QString suserHost);
 
-//   void userModesSet(QString modes);
-//   void userModesAdded(QString modes);
-//   void userModesRemoved(QString modes);
+  void userModesSet(QString modes);
+  void userModesAdded(QString modes);
+  void userModesRemoved(QString modes);
 
   // void channelJoined(QString channel);
   void channelParted(QString channel);
index c71b5c2..b5f9e17 100644 (file)
@@ -31,6 +31,7 @@ QString Network::_networksIniPath = QString();
 // ====================
 //  Public:
 // ====================
+INIT_SYNCABLE_OBJECT(Network)
 Network::Network(const NetworkId &networkid, QObject *parent)
   : SyncableObject(parent),
     _proxy(0),
@@ -201,7 +202,8 @@ IrcUser *Network::newIrcUser(const QString &hostmask, const QVariantMap &initDat
 
     _ircUsers[nick] = ircuser;
 
-    emit ircUserAdded(hostmask);
+    SYNC_OTHER(addIrcUser, ARG(hostmask))
+    // emit ircUserAdded(hostmask);
     emit ircUserAdded(ircuser);
   }
 
@@ -275,7 +277,8 @@ IrcChannel *Network::newIrcChannel(const QString &channelname, const QVariantMap
 
     _ircChannels[channelname.toLower()] = channel;
 
-    emit ircChannelAdded(channelname);
+    SYNC_OTHER(addIrcChannel, ARG(channelname))
+    // emit ircChannelAdded(channelname);
     emit ircChannelAdded(channel);
   }
   return _ircChannels[channelname.toLower()];
@@ -331,7 +334,8 @@ void Network::setCodecForServer(const QByteArray &name) {
 
 void Network::setCodecForServer(QTextCodec *codec) {
   _codecForServer = codec;
-  emit codecForServerSet(codecForServer());
+  QByteArray codecName = codecForServer();
+  SYNC_OTHER(setCodecForServer, ARG(codecName))
 }
 
 QByteArray Network::codecForEncoding() const {
@@ -346,7 +350,8 @@ void Network::setCodecForEncoding(const QByteArray &name) {
 
 void Network::setCodecForEncoding(QTextCodec *codec) {
   _codecForEncoding = codec;
-  emit codecForEncodingSet(codecForEncoding());
+  QByteArray codecName = codecForEncoding();
+  SYNC_OTHER(setCodecForEncoding, ARG(codecName))
 }
 
 QByteArray Network::codecForDecoding() const {
@@ -361,7 +366,8 @@ void Network::setCodecForDecoding(const QByteArray &name) {
 
 void Network::setCodecForDecoding(QTextCodec *codec) {
   _codecForDecoding = codec;
-  emit codecForDecodingSet(codecForDecoding());
+  QByteArray codecName = codecForDecoding();
+  SYNC_OTHER(setCodecForDecoding, ARG(codecName))
 }
 
 // FIXME use server encoding if appropriate
@@ -465,11 +471,13 @@ NetworkInfo Network::networkInfoFromPreset(const QString &networkName) {
 // ====================
 void Network::setNetworkName(const QString &networkName) {
   _networkName = networkName;
+  SYNC(ARG(networkName))
   emit networkNameSet(networkName);
 }
 
 void Network::setCurrentServer(const QString &currentServer) {
   _currentServer = currentServer;
+  SYNC(ARG(currentServer))
   emit currentServerSet(currentServer);
 }
 
@@ -483,6 +491,7 @@ void Network::setConnected(bool connected) {
     setCurrentServer(QString());
     removeChansAndUsers();
   }
+  SYNC(ARG(connected))
   emit connectedSet(connected);
 }
 
@@ -490,7 +499,7 @@ void Network::setConnected(bool connected) {
 void Network::setConnectionState(int state) {
   _connectionState = (ConnectionState)state;
   //qDebug() << "netstate" << networkId() << networkName() << state;
-  emit connectionStateSet(state);
+  SYNC(ARG(state))
   emit connectionStateSet(_connectionState);
 }
 
@@ -499,6 +508,7 @@ void Network::setMyNick(const QString &nickname) {
   if(!_myNick.isEmpty() && !ircUser(myNick())) {
     newIrcUser(myNick());
   }
+  SYNC(ARG(nickname))
   emit myNickSet(nickname);
 }
 
@@ -506,80 +516,81 @@ void Network::setLatency(int latency) {
   if(_latency == latency)
     return;
   _latency = latency;
-  emit latencySet(latency);
+  SYNC(ARG(latency))
 }
 
 void Network::setIdentity(IdentityId id) {
   _identity = id;
+  SYNC(ARG(id))
   emit identitySet(id);
 }
 
 void Network::setServerList(const QVariantList &serverList) {
   _serverList = fromVariantList<Server>(serverList);
-  emit serverListSet(serverList);
+  SYNC(ARG(serverList))
 }
 
 void Network::setUseRandomServer(bool use) {
   _useRandomServer = use;
-  emit useRandomServerSet(use);
+  SYNC(ARG(use))
 }
 
 void Network::setPerform(const QStringList &perform) {
   _perform = perform;
-  emit performSet(perform);
+  SYNC(ARG(perform))
 }
 
 void Network::setUseAutoIdentify(bool use) {
   _useAutoIdentify = use;
-  emit useAutoIdentifySet(use);
+  SYNC(ARG(use))
 }
 
 void Network::setAutoIdentifyService(const QString &service) {
   _autoIdentifyService = service;
-  emit autoIdentifyServiceSet(service);
+  SYNC(ARG(service))
 }
 
 void Network::setAutoIdentifyPassword(const QString &password) {
   _autoIdentifyPassword = password;
-  emit autoIdentifyPasswordSet(password);
+  SYNC(ARG(password))
 }
 
 void Network::setUseAutoReconnect(bool use) {
   _useAutoReconnect = use;
-  emit useAutoReconnectSet(use);
+  SYNC(ARG(use))
 }
 
 void Network::setAutoReconnectInterval(quint32 interval) {
   _autoReconnectInterval = interval;
-  emit autoReconnectIntervalSet(interval);
+  SYNC(ARG(interval))
 }
 
 void Network::setAutoReconnectRetries(quint16 retries) {
   _autoReconnectRetries = retries;
-  emit autoReconnectRetriesSet(retries);
+  SYNC(ARG(retries))
 }
 
 void Network::setUnlimitedReconnectRetries(bool unlimited) {
   _unlimitedReconnectRetries = unlimited;
-  emit unlimitedReconnectRetriesSet(unlimited);
+  SYNC(ARG(unlimited))
 }
 
 void Network::setRejoinChannels(bool rejoin) {
   _rejoinChannels = rejoin;
-  emit rejoinChannelsSet(rejoin);
+  SYNC(ARG(rejoin))
 }
 
 void Network::addSupport(const QString &param, const QString &value) {
   if(!_supports.contains(param)) {
     _supports[param] = value;
-    emit supportAdded(param, value);
+    SYNC(ARG(param), ARG(value))
   }
 }
 
 void Network::removeSupport(const QString &param) {
   if(_supports.contains(param)) {
     _supports.remove(param);
-    emit supportRemoved(param);
+    SYNC(ARG(param))
   }
 }
 
index 704d67a..9642162 100644 (file)
@@ -44,6 +44,7 @@ struct NetworkInfo;
 // TODO: ConnectionInfo to propagate and sync the current state of NetworkConnection, encodings etcpp
 
 class Network : public SyncableObject {
+  SYNCABLE_OBJECT
   Q_OBJECT
   Q_ENUMS(ConnectionState Network::ConnectionState)
 
@@ -254,9 +255,9 @@ public slots:
   // channel lists up to date
   void ircUserNickChanged(QString newnick);
 
-  virtual inline void requestConnect() const { emit connectRequested(); }
-  virtual inline void requestDisconnect() const { emit disconnectRequested(); }
-  virtual inline void requestSetNetworkInfo(const NetworkInfo &info) { emit setNetworkInfoRequested(info); }
+  virtual inline void requestConnect() const { REQUEST(NO_ARG) }
+  virtual inline void requestDisconnect() const { REQUEST(NO_ARG) }
+  virtual inline void requestSetNetworkInfo(const NetworkInfo &info) { REQUEST(ARG(info)) }
 
   void emitConnectionError(const QString &);
 
@@ -271,39 +272,39 @@ signals:
   void currentServerSet(const QString &currentServer);
   void connectedSet(bool isConnected);
   void connectionStateSet(Network::ConnectionState);
-  void connectionStateSet(int);
+//   void connectionStateSet(int);
   void connectionError(const QString &errorMsg);
   void myNickSet(const QString &mynick);
-  void latencySet(int latency);
+//   void latencySet(int latency);
   void identitySet(IdentityId);
 
-  void serverListSet(QVariantList serverList);
-  void useRandomServerSet(bool);
-  void performSet(const QStringList &);
-  void useAutoIdentifySet(bool);
-  void autoIdentifyServiceSet(const QString &);
-  void autoIdentifyPasswordSet(const QString &);
-  void useAutoReconnectSet(bool);
-  void autoReconnectIntervalSet(quint32);
-  void autoReconnectRetriesSet(quint16);
-  void unlimitedReconnectRetriesSet(bool);
-  void rejoinChannelsSet(bool);
-
-  void codecForServerSet(const QByteArray &codecName);
-  void codecForEncodingSet(const QByteArray &codecName);
-  void codecForDecodingSet(const QByteArray &codecName);
-
-  void supportAdded(const QString &param, const QString &value);
-  void supportRemoved(const QString &param);
-
-  void ircUserAdded(const QString &hostmask);
+//   void serverListSet(QVariantList serverList);
+//   void useRandomServerSet(bool);
+//   void performSet(const QStringList &);
+//   void useAutoIdentifySet(bool);
+//   void autoIdentifyServiceSet(const QString &);
+//   void autoIdentifyPasswordSet(const QString &);
+//   void useAutoReconnectSet(bool);
+//   void autoReconnectIntervalSet(quint32);
+//   void autoReconnectRetriesSet(quint16);
+//   void unlimitedReconnectRetriesSet(bool);
+//   void rejoinChannelsSet(bool);
+
+//   void codecForServerSet(const QByteArray &codecName);
+//   void codecForEncodingSet(const QByteArray &codecName);
+//   void codecForDecodingSet(const QByteArray &codecName);
+
+//   void supportAdded(const QString &param, const QString &value);
+//   void supportRemoved(const QString &param);
+
+//   void ircUserAdded(const QString &hostmask);
   void ircUserAdded(IrcUser *);
-  void ircChannelAdded(const QString &channelname);
+//   void ircChannelAdded(const QString &channelname);
   void ircChannelAdded(IrcChannel *);
 
-  void connectRequested() const;
-  void disconnectRequested() const;
-  void setNetworkInfoRequested(const NetworkInfo &) const;
+//   void connectRequested() const;
+//   void disconnectRequested() const;
+//   void setNetworkInfoRequested(const NetworkInfo &) const;
 
 protected:
   inline virtual IrcChannel *ircChannelFactory(const QString &channelname) { return new IrcChannel(channelname, this); }
index dea582e..8a0af10 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "networkconfig.h"
 
+INIT_SYNCABLE_OBJECT(NetworkConfig)
 NetworkConfig::NetworkConfig(const QString &objectName, QObject *parent)
 : SyncableObject(objectName, parent),
   _pingTimeoutEnabled(true),
@@ -38,6 +39,7 @@ void NetworkConfig::setPingTimeoutEnabled(bool enabled) {
     return;
 
   _pingTimeoutEnabled = enabled;
+  SYNC(ARG(enabled))
   emit pingTimeoutEnabledSet(enabled);
 }
 
@@ -46,6 +48,7 @@ void NetworkConfig::setPingInterval(int interval) {
     return;
 
   _pingInterval = interval;
+  SYNC(ARG(interval))
   emit pingIntervalSet(interval);
 }
 
@@ -54,7 +57,7 @@ void NetworkConfig::setMaxPingCount(int count) {
     return;
 
   _maxPingCount = count;
-  emit maxPingCountSet(count);
+  SYNC(ARG(count))
 }
 
 void NetworkConfig::setAutoWhoEnabled(bool enabled) {
@@ -62,6 +65,7 @@ void NetworkConfig::setAutoWhoEnabled(bool enabled) {
     return;
 
   _autoWhoEnabled = enabled;
+  SYNC(ARG(enabled))
   emit autoWhoEnabledSet(enabled);
 }
 
@@ -70,6 +74,7 @@ void NetworkConfig::setAutoWhoInterval(int interval) {
     return;
 
   _autoWhoInterval = interval;
+  SYNC(ARG(interval))
   emit autoWhoIntervalSet(interval);
 }
 
@@ -78,7 +83,7 @@ void NetworkConfig::setAutoWhoNickLimit(int nickLimit) {
     return;
 
   _autoWhoNickLimit = nickLimit;
-  emit autoWhoNickLimitSet(nickLimit);
+  SYNC(ARG(nickLimit))
 }
 
 void NetworkConfig::setAutoWhoDelay(int delay) {
@@ -86,5 +91,6 @@ void NetworkConfig::setAutoWhoDelay(int delay) {
     return;
 
   _autoWhoDelay = delay;
+  SYNC(ARG(delay))
   emit autoWhoDelaySet(delay);
 }
index 8f61363..d906318 100644 (file)
@@ -24,7 +24,9 @@
 #include "syncableobject.h"
 
 class NetworkConfig : public SyncableObject {
+  SYNCABLE_OBJECT
   Q_OBJECT
+
   Q_PROPERTY(bool pingTimeoutEnabled READ pingTimeoutEnabled WRITE setPingTimeoutEnabled)
   Q_PROPERTY(int pingInterval READ pingInterval WRITE setPingInterval)
   Q_PROPERTY(int maxPingCount READ maxPingCount WRITE setMaxPingCount)
@@ -41,48 +43,48 @@ public:
 public slots:
   inline bool pingTimeoutEnabled() const { return _pingTimeoutEnabled; }
   void setPingTimeoutEnabled(bool);
-  virtual inline void requestSetPingTimeoutEnabled(bool b) { emit setPingTimeoutEnabledRequested(b); }
+  virtual inline void requestSetPingTimeoutEnabled(bool b) { REQUEST(ARG(b)) }
 
   inline int pingInterval() const { return _pingInterval; }
   void setPingInterval(int);
-  virtual inline void requestSetPingInterval(int i) { emit setPingIntervalRequested(i); }
+  virtual inline void requestSetPingInterval(int i) { REQUEST(ARG(i)) }
 
   inline int maxPingCount() const { return _maxPingCount; }
   void setMaxPingCount(int);
-  virtual inline void requestSetMaxPingCount(int i) { emit setMaxPingCountRequested(i); }
+  virtual inline void requestSetMaxPingCount(int i) { REQUEST(ARG(i)) }
 
   inline bool autoWhoEnabled() const { return _autoWhoEnabled; }
   void setAutoWhoEnabled(bool);
-  virtual inline void requestSetAutoWhoEnabled(bool b) { emit setAutoWhoEnabledRequested(b); }
+  virtual inline void requestSetAutoWhoEnabled(bool b) { REQUEST(ARG(b)) }
 
   inline int autoWhoInterval() const { return _autoWhoInterval; }
   void setAutoWhoInterval(int);
-  virtual inline void requestSetAutoWhoInterval(int i) { emit setAutoWhoIntervalRequested(i); }
+  virtual inline void requestSetAutoWhoInterval(int i) { REQUEST(ARG(i)) }
 
   inline int autoWhoNickLimit() const { return _autoWhoNickLimit; }
   void setAutoWhoNickLimit(int);
-  virtual inline void requestSetAutoWhoNickLimit(int i) { emit setAutoWhoNickLimitRequested(i); }
+  virtual inline void requestSetAutoWhoNickLimit(int i) { REQUEST(ARG(i)) }
 
   inline int autoWhoDelay() const { return _autoWhoDelay; }
   void setAutoWhoDelay(int);
-  virtual inline void requestSetAutoWhoDelay(int i) { emit setAutoWhoDelayRequested(i); }
+  virtual inline void requestSetAutoWhoDelay(int i) { REQUEST(ARG(i)) }
 
 signals:
   void pingTimeoutEnabledSet(bool);
   void pingIntervalSet(int);
-  void maxPingCountSet(int);
+//   void maxPingCountSet(int);
   void autoWhoEnabledSet(bool);
   void autoWhoIntervalSet(int);
-  void autoWhoNickLimitSet(int);
+//   void autoWhoNickLimitSet(int);
   void autoWhoDelaySet(int);
 
-  void setPingTimeoutEnabledRequested(bool);
-  void setPingIntervalRequested(int);
-  void setMaxPingCountRequested(int);
-  void setAutoWhoEnabledRequested(bool);
-  void setAutoWhoIntervalRequested(int);
-  void setAutoWhoNickLimitRequested(int);
-  void setAutoWhoDelayRequested(int);
+//   void setPingTimeoutEnabledRequested(bool);
+//   void setPingIntervalRequested(int);
+//   void setMaxPingCountRequested(int);
+//   void setAutoWhoEnabledRequested(bool);
+//   void setAutoWhoIntervalRequested(int);
+//   void setAutoWhoNickLimitRequested(int);
+//   void setAutoWhoDelayRequested(int);
 
 private:
   bool _pingTimeoutEnabled;
index 08cdc7d..89b434b 100644 (file)
@@ -570,7 +570,7 @@ void SignalProxy::receivePeerSignal(AbstractPeer *sender, const RequestType &req
     }
   }
 
-  qDebug() << "SignalProxy::receivePeerSignal)" << requestType << params;
+  // qDebug() << "SignalProxy::receivePeerSignal)" << requestType << params;
   switch(requestType) {
   case RpcCall:
     if(params.empty())
@@ -986,8 +986,8 @@ void SignalProxy::customEvent(QEvent *event) {
   }
 }
 
-void SignalProxy::syncCall(const SyncableObject *obj, SignalProxy::ProxyMode modeType, const char *funcname, va_list ap) {
-  qDebug() << obj << modeType << "(" << _proxyMode << ")" << funcname;
+void SignalProxy::sync_call__(const SyncableObject *obj, SignalProxy::ProxyMode modeType, const char *funcname, va_list ap) {
+  // qDebug() << obj << modeType << "(" << _proxyMode << ")" << funcname;
   if(modeType != _proxyMode)
     return;
 
@@ -1077,6 +1077,9 @@ SignalProxy::ExtendedMetaObject::ExtendedMetaObject(const QMetaObject *meta)
       continue; // skip methods with ptr params
 
     QByteArray method = methodName(_meta->method(i));
+    if(method.startsWith("init"))
+      continue; // skip initializers
+
     if(_methodIds.contains(method)) {
       /* funny... moc creates for methods containing default parameters multiple metaMethod with separate methodIds.
          we don't care... we just need the full fledged version
index 7f2a1dd..9bae636 100644 (file)
@@ -116,7 +116,7 @@ public slots:
 
 protected:
   void customEvent(QEvent *event);
-  void syncCall(const SyncableObject *obj, ProxyMode modeType, const char *funcname, va_list ap);
+  void sync_call__(const SyncableObject *obj, ProxyMode modeType, const char *funcname, va_list ap);
 
 private slots:
   void dataAvailable();
index 41ac4a5..5b158ab 100644 (file)
@@ -156,12 +156,12 @@ void SyncableObject::requestUpdate(const QVariantMap &properties) {
   emit updateRequested(properties);
 }
 
-void SyncableObject::sync_call__(SignalProxy::ProxyMode modeType, const char *funcname, ...) {
-  qDebug() << Q_FUNC_INFO << modeType << funcname;
+void SyncableObject::sync_call__(SignalProxy::ProxyMode modeType, const char *funcname, ...) const {
+  //qDebug() << Q_FUNC_INFO << modeType << funcname;
   foreach(SignalProxy *proxy, _signalProxies) {
     va_list ap;
     va_start(ap, funcname);
-    proxy->syncCall(this, modeType, funcname, ap);
+    proxy->sync_call__(this, modeType, funcname, ap);
     va_end(ap);
   }
 }
index 92746f8..65f575e 100644 (file)
@@ -67,7 +67,7 @@ public slots:
   virtual void update(const QVariantMap &properties);
 
 protected:
-  void sync_call__(SignalProxy::ProxyMode modeType, const char *funcname, ...);
+  void sync_call__(SignalProxy::ProxyMode modeType, const char *funcname, ...) const;
 
   void renameObject(const QString &newName);
   SyncableObject &operator=(const SyncableObject &other);
@@ -100,7 +100,9 @@ private:
 #    define REQUEST(...) sync_call__(SignalProxy::Client, (__FUNCTION__ + _classNameOffset__) , __VA_ARGS__);
 #else
 #    define SYNC(...) sync_call__(SignalProxy::Server, __func__, __VA_ARGS__);
+#    define SYNC_OTHER(x, ...) sync_call__(SignalProxy::Server, #x, __VA_ARGS__);
 #    define REQUEST(...) sync_call__(SignalProxy::Client, __func__, __VA_ARGS__);
+#    define REQUEST_OTHER(x, ...) sync_call__(SignalProxy::Client, #x, __VA_ARGS__);
 #endif //Q_WS_WIN
 
 
index b1e7f2f..68c3881 100644 (file)
@@ -24,6 +24,7 @@
 #include "corenetwork.h"
 #include "coresession.h"
 
+INIT_SYNCABLE_OBJECT(CoreAliasManager)
 CoreAliasManager::CoreAliasManager(CoreSession *parent)
   : AliasManager(parent)
 {
index d5739c6..fe85fce 100644 (file)
@@ -26,6 +26,7 @@
 class CoreSession;
 
 class CoreAliasManager : public AliasManager {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index 9ad3560..0184653 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <QDebug>
 
+INIT_SYNCABLE_OBJECT(CoreBacklogManager)
 CoreBacklogManager::CoreBacklogManager(CoreSession *coreSession)
   : BacklogManager(coreSession),
     _coreSession(coreSession)
index 1ed64b6..9d1a812 100644 (file)
@@ -26,6 +26,7 @@
 class CoreSession;
 
 class CoreBacklogManager : public BacklogManager {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index b055e72..37ff255 100644 (file)
@@ -30,6 +30,7 @@ public:
   PurgeEvent() : QEvent(QEvent::User) {}
 };
 
+INIT_SYNCABLE_OBJECT(CoreBufferSyncer)
 CoreBufferSyncer::CoreBufferSyncer(CoreSession *parent)
   : BufferSyncer(Core::bufferLastSeenMsgIds(parent->user()), parent),
     _coreSession(parent),
index 1f4176c..f567735 100644 (file)
@@ -26,6 +26,7 @@
 class CoreSession;
 
 class CoreBufferSyncer : public BufferSyncer {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index 5f5a1b4..ab0f308 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "corebufferviewconfig.h"
 
+INIT_SYNCABLE_OBJECT(CoreBufferViewConfig)
 CoreBufferViewConfig::CoreBufferViewConfig(int bufferViewId, QObject *parent)
   : BufferViewConfig(bufferViewId, parent)
 {
index 37e4ba4..5334b94 100644 (file)
@@ -24,6 +24,7 @@
 #define COREBUFFERVIEWCONFIG_H
 
 class CoreBufferViewConfig : public BufferViewConfig {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index 8b8aedc..4560a52 100644 (file)
@@ -25,6 +25,7 @@
 #include "core.h"
 #include "coresession.h"
 
+INIT_SYNCABLE_OBJECT(CoreBufferViewManager)
 CoreBufferViewManager::CoreBufferViewManager(SignalProxy *proxy, CoreSession *parent)
   : BufferViewManager(proxy, parent),
     _coreSession(parent)
index 834d1e8..4bedb28 100644 (file)
@@ -26,6 +26,7 @@
 class CoreSession;
 
 class CoreBufferViewManager : public BufferViewManager {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index 072dc0d..195026a 100644 (file)
@@ -25,6 +25,7 @@
 #include "quassel.h"
 #include "signalproxy.h"
 
+INIT_SYNCABLE_OBJECT(CoreCoreInfo)
 CoreCoreInfo::CoreCoreInfo(CoreSession *parent)
   : CoreInfo(parent),
     _coreSession(parent)
index 01d0eb7..7bda4f0 100644 (file)
@@ -30,6 +30,7 @@ class CoreSession;
  * which is prefixing core specific sync objects with "Core"... ;)
  */ 
 class CoreCoreInfo : public CoreInfo {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index acba205..fb836e1 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "signalproxy.h"
 
+INIT_SYNCABLE_OBJECT(CoreIdentity)
 CoreIdentity::CoreIdentity(IdentityId id, QObject *parent)
   : Identity(id, parent)
 #ifdef HAVE_SSL
@@ -93,6 +94,7 @@ CoreIdentity &CoreIdentity::operator=(const CoreIdentity &identity) {
 // ========================================
 //  CoreCertManager
 // ========================================
+INIT_SYNCABLE_OBJECT(CoreCertManager)
 CoreCertManager::CoreCertManager(CoreIdentity &identity)
   : CertManager(identity.id()),
     identity(identity)
index 57b39e0..6cb6cd1 100644 (file)
@@ -36,6 +36,7 @@ class SignalProxy;
 #ifdef HAVE_SSL
 class CoreIdentity;
 class CoreCertManager : public CertManager {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
@@ -61,6 +62,7 @@ private:
 //  CoreIdentity
 // =========================================
 class CoreIdentity : public Identity {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index 0d8de10..9db3c1a 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "coreircchannel.h"
 
+INIT_SYNCABLE_OBJECT(CoreIrcChannel)
 CoreIrcChannel::CoreIrcChannel(const QString &channelname, Network *network)
   : IrcChannel(channelname, network),
     _receivedWelcomeMsg(false)
index 61c5ecb..5995165 100644 (file)
@@ -24,6 +24,7 @@
 #include "ircchannel.h"
 
 class CoreIrcChannel : public IrcChannel {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index b6f56e4..5abb5aa 100644 (file)
@@ -23,6 +23,7 @@
 #include "corenetwork.h"
 #include "userinputhandler.h"
 
+INIT_SYNCABLE_OBJECT(CoreIrcListHelper)
 QVariantList CoreIrcListHelper::requestChannelList(const NetworkId &netId, const QStringList &channelFilters) {
   if(_finishedChannelLists.contains(netId))
     return _finishedChannelLists.take(netId);
index d6b3a2d..688344a 100644 (file)
@@ -28,6 +28,7 @@
 class QTimerEvent;
 
 class CoreIrcListHelper : public IrcListHelper {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index 21415ae..bc7b848 100644 (file)
@@ -29,6 +29,7 @@
 #include "userinputhandler.h"
 #include "ctcphandler.h"
 
+INIT_SYNCABLE_OBJECT(CoreNetwork)
 CoreNetwork::CoreNetwork(const NetworkId &networkid, CoreSession *session)
   : Network(networkid, session),
     _coreSession(session),
@@ -70,7 +71,6 @@ CoreNetwork::CoreNetwork(const NetworkId &networkid, CoreSession *session)
   connect(&_autoWhoTimer, SIGNAL(timeout()), this, SLOT(sendAutoWho()));
   connect(&_autoWhoCycleTimer, SIGNAL(timeout()), this, SLOT(startAutoWhoCycle()));
   connect(&_tokenBucketTimer, SIGNAL(timeout()), this, SLOT(fillBucketAndProcessQueue()));
-  connect(this, SIGNAL(connectRequested()), this, SLOT(connectToIrc()));
 
   connect(&socket, SIGNAL(connected()), this, SLOT(socketInitialized()));
   connect(&socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected()));
@@ -650,7 +650,7 @@ void CoreNetwork::requestConnect() const {
     qWarning() << "Requesting connect while already being connected!";
     return;
   }
-  Network::requestConnect();
+  QMetaObject::invokeMethod(const_cast<CoreNetwork *>(this), "connectToIrc", Qt::QueuedConnection);
 }
 
 void CoreNetwork::requestDisconnect() const {
index d263f3f..d30bb6e 100644 (file)
@@ -41,6 +41,7 @@ class UserInputHandler;
 class CtcpHandler;
 
 class CoreNetwork : public Network {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index 1ea76f2..ba95db5 100644 (file)
@@ -22,6 +22,7 @@
 #include "coresession.h"
 #include "corenetworkconfig.h"
 
+INIT_SYNCABLE_OBJECT(CoreNetworkConfig)
 CoreNetworkConfig::CoreNetworkConfig(const QString& objectName, CoreSession* session)
   : NetworkConfig(objectName, session)
 {
index 4f26531..88aa227 100644 (file)
@@ -26,6 +26,7 @@
 class CoreSession;
 
 class CoreNetworkConfig : public NetworkConfig {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
index 7c32403..166b292 100644 (file)
@@ -487,9 +487,9 @@ BufferViewConfig *BufferViewSettingsPage::cloneConfig(BufferViewConfig *config)
   connect(config, SIGNAL(bufferAdded(const BufferId &, int)), changedConfig, SLOT(addBuffer(const BufferId &, int)));
   connect(config, SIGNAL(bufferMoved(const BufferId &, int)), changedConfig, SLOT(moveBuffer(const BufferId &, int)));
   connect(config, SIGNAL(bufferRemoved(const BufferId &)), changedConfig, SLOT(removeBuffer(const BufferId &)));
-  connect(config, SIGNAL(addBufferRequested(const BufferId &, int)), changedConfig, SLOT(addBuffer(const BufferId &, int)));
-  connect(config, SIGNAL(moveBufferRequested(const BufferId &, int)), changedConfig, SLOT(moveBuffer(const BufferId &, int)));
-  connect(config, SIGNAL(removeBufferRequested(const BufferId &)), changedConfig, SLOT(removeBuffer(const BufferId &)));
+//   connect(config, SIGNAL(addBufferRequested(const BufferId &, int)), changedConfig, SLOT(addBuffer(const BufferId &, int)));
+//   connect(config, SIGNAL(moveBufferRequested(const BufferId &, int)), changedConfig, SLOT(moveBuffer(const BufferId &, int)));
+//   connect(config, SIGNAL(removeBufferRequested(const BufferId &)), changedConfig, SLOT(removeBuffer(const BufferId &)));
 
   changedConfig->setProperty("OriginalBufferList", toVariantList<BufferId>(config->bufferList()));
   // if this is the currently displayed view we have to change the config of the preview filter
index 57a6661..ec14de0 100644 (file)
@@ -94,18 +94,19 @@ void BufferViewFilter::configInitialized() {
   if(!config())
     return;
 
-  connect(config(), SIGNAL(bufferViewNameSet(const QString &)), this, SLOT(invalidate()));
-  connect(config(), SIGNAL(networkIdSet(const NetworkId &)), this, SLOT(invalidate()));
-  connect(config(), SIGNAL(addNewBuffersAutomaticallySet(bool)), this, SLOT(invalidate()));
-  connect(config(), SIGNAL(sortAlphabeticallySet(bool)), this, SLOT(invalidate()));
-  connect(config(), SIGNAL(hideInactiveBuffersSet(bool)), this, SLOT(invalidate()));
-  connect(config(), SIGNAL(allowedBufferTypesSet(int)), this, SLOT(invalidate()));
-  connect(config(), SIGNAL(minimumActivitySet(int)), this, SLOT(invalidate()));
-  connect(config(), SIGNAL(bufferListSet()), this, SLOT(invalidate()));
-  connect(config(), SIGNAL(bufferAdded(const BufferId &, int)), this, SLOT(invalidate()));
-  connect(config(), SIGNAL(bufferMoved(const BufferId &, int)), this, SLOT(invalidate()));
-  connect(config(), SIGNAL(bufferRemoved(const BufferId &)), this, SLOT(invalidate()));
-  connect(config(), SIGNAL(bufferPermanentlyRemoved(const BufferId &)), this, SLOT(invalidate()));
+//   connect(config(), SIGNAL(bufferViewNameSet(const QString &)), this, SLOT(invalidate()));
+  connect(config(), SIGNAL(configChanged()), this, SLOT(invalidate()));
+//   connect(config(), SIGNAL(networkIdSet(const NetworkId &)), this, SLOT(invalidate()));
+//   connect(config(), SIGNAL(addNewBuffersAutomaticallySet(bool)), this, SLOT(invalidate()));
+//   connect(config(), SIGNAL(sortAlphabeticallySet(bool)), this, SLOT(invalidate()));
+//   connect(config(), SIGNAL(hideInactiveBuffersSet(bool)), this, SLOT(invalidate()));
+//   connect(config(), SIGNAL(allowedBufferTypesSet(int)), this, SLOT(invalidate()));
+//   connect(config(), SIGNAL(minimumActivitySet(int)), this, SLOT(invalidate()));
+//   connect(config(), SIGNAL(bufferListSet()), this, SLOT(invalidate()));
+//   connect(config(), SIGNAL(bufferAdded(const BufferId &, int)), this, SLOT(invalidate()));
+//   connect(config(), SIGNAL(bufferMoved(const BufferId &, int)), this, SLOT(invalidate()));
+//   connect(config(), SIGNAL(bufferRemoved(const BufferId &)), this, SLOT(invalidate()));
+//   connect(config(), SIGNAL(bufferPermanentlyRemoved(const BufferId &)), this, SLOT(invalidate()));
 
   disconnect(config(), SIGNAL(initDone()), this, SLOT(configInitialized()));