From: Marcus Eggenberger Date: Sun, 23 Aug 2009 17:08:44 +0000 (+0200) Subject: Fitting the SyncableObjects to the new Style X-Git-Tag: 0.5-rc1~37 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=f6b9eeda207d42c99fc3e9085631722cf2ec83dc Fitting the SyncableObjects to the new Style ... now that was tiresome... --- diff --git a/src/client/bufferviewoverlay.cpp b/src/client/bufferviewoverlay.cpp index dc439dc9..b1938d11 100644 --- a/src/client/bufferviewoverlay.cpp +++ b/src/client/bufferviewoverlay.cpp @@ -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())) diff --git a/src/client/clientaliasmanager.cpp b/src/client/clientaliasmanager.cpp index e8fc3612..3b4a9539 100644 --- a/src/client/clientaliasmanager.cpp +++ b/src/client/clientaliasmanager.cpp @@ -22,6 +22,7 @@ #include "client.h" +INIT_SYNCABLE_OBJECT(ClientAliasManager) ClientAliasManager::ClientAliasManager(QObject *parent) : AliasManager(parent) { diff --git a/src/client/clientaliasmanager.h b/src/client/clientaliasmanager.h index 47ffe071..8b6aa37d 100644 --- a/src/client/clientaliasmanager.h +++ b/src/client/clientaliasmanager.h @@ -24,6 +24,7 @@ #include "aliasmanager.h" class ClientAliasManager : public AliasManager { + SYNCABLE_OBJECT Q_OBJECT public: diff --git a/src/client/clientbufferviewconfig.cpp b/src/client/clientbufferviewconfig.cpp index 76a63165..1e7f816c 100644 --- a/src/client/clientbufferviewconfig.cpp +++ b/src/client/clientbufferviewconfig.cpp @@ -20,6 +20,7 @@ #include "clientbufferviewconfig.h" +INIT_SYNCABLE_OBJECT(ClientBufferViewConfig) ClientBufferViewConfig::ClientBufferViewConfig(int bufferViewId, QObject *parent) : BufferViewConfig(bufferViewId, parent), _locked(false) diff --git a/src/client/clientbufferviewconfig.h b/src/client/clientbufferviewconfig.h index cac0be7c..5f6c0ed4 100644 --- a/src/client/clientbufferviewconfig.h +++ b/src/client/clientbufferviewconfig.h @@ -24,6 +24,7 @@ #include "bufferviewconfig.h" class ClientBufferViewConfig : public BufferViewConfig { + SYNCABLE_OBJECT Q_OBJECT public: diff --git a/src/client/clientbufferviewmanager.cpp b/src/client/clientbufferviewmanager.cpp index b31f69e2..166cda1f 100644 --- a/src/client/clientbufferviewmanager.cpp +++ b/src/client/clientbufferviewmanager.cpp @@ -22,6 +22,7 @@ #include "clientbufferviewconfig.h" +INIT_SYNCABLE_OBJECT(ClientBufferViewManager) ClientBufferViewManager::ClientBufferViewManager(SignalProxy *proxy, QObject *parent) : BufferViewManager(proxy, parent) { diff --git a/src/client/clientbufferviewmanager.h b/src/client/clientbufferviewmanager.h index f190362b..912c5405 100644 --- a/src/client/clientbufferviewmanager.h +++ b/src/client/clientbufferviewmanager.h @@ -27,6 +27,7 @@ class ClientBufferViewConfig; class BufferViewOverlay; class ClientBufferViewManager : public BufferViewManager { + SYNCABLE_OBJECT Q_OBJECT public: diff --git a/src/client/clientcoreinfo.h b/src/client/clientcoreinfo.h index 54e2909e..3bd08a47 100644 --- a/src/client/clientcoreinfo.h +++ b/src/client/clientcoreinfo.h @@ -29,6 +29,7 @@ */ class ClientCoreInfo : public CoreInfo { Q_OBJECT + SYNCABLE_OBJECT public: ClientCoreInfo(QObject *parent = 0) : CoreInfo(parent) {} diff --git a/src/client/clientidentity.cpp b/src/client/clientidentity.cpp index 9a1e0a6d..4849bdbd 100644 --- a/src/client/clientidentity.cpp +++ b/src/client/clientidentity.cpp @@ -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 diff --git a/src/client/clientidentity.h b/src/client/clientidentity.h index 5935d41c..730b6628 100644 --- a/src/client/clientidentity.h +++ b/src/client/clientidentity.h @@ -26,6 +26,7 @@ class ClientCertManager; class CertIdentity : public Identity { + SYNCABLE_OBJECT Q_OBJECT public: diff --git a/src/client/clientirclisthelper.cpp b/src/client/clientirclisthelper.cpp index c515dd16..fd52b9ae 100644 --- a/src/client/clientirclisthelper.cpp +++ b/src/client/clientirclisthelper.cpp @@ -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); diff --git a/src/client/clientirclisthelper.h b/src/client/clientirclisthelper.h index 9a60ec16..3cc5b7bf 100644 --- a/src/client/clientirclisthelper.h +++ b/src/client/clientirclisthelper.h @@ -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 &channelList); + void finishedListReported(const NetworkId &netId); + void errorReported(const QString &error); private: NetworkId _netId; diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 7c883a90..819077a3 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -14,6 +14,7 @@ set(SOURCES cliparser.cpp identity.cpp ircchannel.cpp + irclisthelper.cpp ircuser.cpp logger.cpp message.cpp diff --git a/src/common/aliasmanager.cpp b/src/common/aliasmanager.cpp index b398b8b3..9815b580 100644 --- a/src/common/aliasmanager.cpp +++ b/src/common/aliasmanager.cpp @@ -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() { diff --git a/src/common/aliasmanager.h b/src/common/aliasmanager.h index c72f57dd..67a56206 100644 --- a/src/common/aliasmanager.h +++ b/src/common/aliasmanager.h @@ -29,6 +29,7 @@ class Network; class AliasManager : public SyncableObject { + SYNCABLE_OBJECT Q_OBJECT public: @@ -67,9 +68,6 @@ protected: void setAliases(const QList &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); diff --git a/src/common/buffersyncer.cpp b/src/common/buffersyncer.cpp index f05d1637..82fe0da0 100644 --- a/src/common/buffersyncer.cpp +++ b/src/common/buffersyncer.cpp @@ -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); } diff --git a/src/common/buffersyncer.h b/src/common/buffersyncer.h index 0973828f..48931896 100644 --- a/src/common/buffersyncer.h +++ b/src/common/buffersyncer.h @@ -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 bufferIds() const { return _lastSeenMsg.keys(); } diff --git a/src/common/bufferviewconfig.cpp b/src/common/bufferviewconfig.cpp index 0ec0348b..14e4d044 100644 --- a/src/common/bufferviewconfig.cpp +++ b/src/common/bufferviewconfig.cpp @@ -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(); } - // 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) { @@ -135,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,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(); } diff --git a/src/common/bufferviewconfig.h b/src/common/bufferviewconfig.h index 91420534..75ca9cf6 100644 --- a/src/common/bufferviewconfig.h +++ b/src/common/bufferviewconfig.h @@ -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 &bufferList() const { return _buffers; } const QSet &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; diff --git a/src/common/bufferviewmanager.cpp b/src/common/bufferviewmanager.cpp index 59d3a9b4..42cb6ad1 100644 --- a/src/common/bufferviewmanager.cpp +++ b/src/common/bufferviewmanager.cpp @@ -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); } diff --git a/src/common/bufferviewmanager.h b/src/common/bufferviewmanager.h index 6281a447..23322ab8 100644 --- a/src/common/bufferviewmanager.h +++ b/src/common/bufferviewmanager.h @@ -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 BufferViewConfigHash; diff --git a/src/common/identity.cpp b/src/common/identity.cpp index 0569178a..728cff12 100644 --- a/src/common/identity.cpp +++ b/src/common/identity.cpp @@ -42,6 +42,7 @@ # include #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) diff --git a/src/common/identity.h b/src/common/identity.h index 3e9a5607..63450462 100644 --- a/src/common/identity.h +++ b/src/common/identity.h @@ -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 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 diff --git a/src/common/ircchannel.cpp b/src/common/ircchannel.cpp index 5c2ba722..88d1e851 100644 --- a/src/common/ircchannel.cpp +++ b/src/common/ircchannel.cpp @@ -30,7 +30,7 @@ #include - +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 &users, const QStringList &modes) { @@ -148,6 +148,7 @@ void IrcChannel::joinIrcUsers(const QList &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 &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 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 { diff --git a/src/common/ircchannel.h b/src/common/ircchannel.h index 5bcaa79e..7f7d04a8 100644 --- a/src/common/ircchannel.h +++ b/src/common/ircchannel.h @@ -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 &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 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 index 00000000..b3632342 --- /dev/null +++ b/src/common/irclisthelper.cpp @@ -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) diff --git a/src/common/irclisthelper.h b/src/common/irclisthelper.h index b4e8b959..72c37126 100644 --- a/src/common/irclisthelper.h +++ b/src/common/irclisthelper.h @@ -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 diff --git a/src/common/ircuser.cpp b/src/common/ircuser.cpp index e42bea7d..5bd4c8b4 100644 --- a/src/common/ircuser.cpp +++ b/src/common/ircuser.cpp @@ -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) { diff --git a/src/common/ircuser.h b/src/common/ircuser.h index 8499dd1c..7ec878e7 100644 --- a/src/common/ircuser.h +++ b/src/common/ircuser.h @@ -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); diff --git a/src/common/network.cpp b/src/common/network.cpp index c71b5c2c..b5f9e173 100644 --- a/src/common/network.cpp +++ b/src/common/network.cpp @@ -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 ¤tServer) { _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(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 ¶m, const QString &value) { if(!_supports.contains(param)) { _supports[param] = value; - emit supportAdded(param, value); + SYNC(ARG(param), ARG(value)) } } void Network::removeSupport(const QString ¶m) { if(_supports.contains(param)) { _supports.remove(param); - emit supportRemoved(param); + SYNC(ARG(param)) } } diff --git a/src/common/network.h b/src/common/network.h index 704d67aa..96421626 100644 --- a/src/common/network.h +++ b/src/common/network.h @@ -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 ¤tServer); 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 ¶m, const QString &value); - void supportRemoved(const QString ¶m); - - 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 ¶m, const QString &value); +// void supportRemoved(const QString ¶m); + +// 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); } diff --git a/src/common/networkconfig.cpp b/src/common/networkconfig.cpp index dea582e3..8a0af10f 100644 --- a/src/common/networkconfig.cpp +++ b/src/common/networkconfig.cpp @@ -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); } diff --git a/src/common/networkconfig.h b/src/common/networkconfig.h index 8f613639..d9063180 100644 --- a/src/common/networkconfig.h +++ b/src/common/networkconfig.h @@ -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; diff --git a/src/common/signalproxy.cpp b/src/common/signalproxy.cpp index 08cdc7dc..89b434b2 100644 --- a/src/common/signalproxy.cpp +++ b/src/common/signalproxy.cpp @@ -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 diff --git a/src/common/signalproxy.h b/src/common/signalproxy.h index 7f2a1ddc..9bae6364 100644 --- a/src/common/signalproxy.h +++ b/src/common/signalproxy.h @@ -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(); diff --git a/src/common/syncableobject.cpp b/src/common/syncableobject.cpp index 41ac4a52..5b158ab3 100644 --- a/src/common/syncableobject.cpp +++ b/src/common/syncableobject.cpp @@ -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); } } diff --git a/src/common/syncableobject.h b/src/common/syncableobject.h index 92746f87..65f575e3 100644 --- a/src/common/syncableobject.h +++ b/src/common/syncableobject.h @@ -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 diff --git a/src/core/corealiasmanager.cpp b/src/core/corealiasmanager.cpp index b1e7f2f2..68c38814 100644 --- a/src/core/corealiasmanager.cpp +++ b/src/core/corealiasmanager.cpp @@ -24,6 +24,7 @@ #include "corenetwork.h" #include "coresession.h" +INIT_SYNCABLE_OBJECT(CoreAliasManager) CoreAliasManager::CoreAliasManager(CoreSession *parent) : AliasManager(parent) { diff --git a/src/core/corealiasmanager.h b/src/core/corealiasmanager.h index d5739c6f..fe85fced 100644 --- a/src/core/corealiasmanager.h +++ b/src/core/corealiasmanager.h @@ -26,6 +26,7 @@ class CoreSession; class CoreAliasManager : public AliasManager { + SYNCABLE_OBJECT Q_OBJECT public: diff --git a/src/core/corebacklogmanager.cpp b/src/core/corebacklogmanager.cpp index 9ad35608..0184653f 100644 --- a/src/core/corebacklogmanager.cpp +++ b/src/core/corebacklogmanager.cpp @@ -24,6 +24,7 @@ #include +INIT_SYNCABLE_OBJECT(CoreBacklogManager) CoreBacklogManager::CoreBacklogManager(CoreSession *coreSession) : BacklogManager(coreSession), _coreSession(coreSession) diff --git a/src/core/corebacklogmanager.h b/src/core/corebacklogmanager.h index 1ed64b60..9d1a8128 100644 --- a/src/core/corebacklogmanager.h +++ b/src/core/corebacklogmanager.h @@ -26,6 +26,7 @@ class CoreSession; class CoreBacklogManager : public BacklogManager { + SYNCABLE_OBJECT Q_OBJECT public: diff --git a/src/core/corebuffersyncer.cpp b/src/core/corebuffersyncer.cpp index b055e727..37ff255f 100644 --- a/src/core/corebuffersyncer.cpp +++ b/src/core/corebuffersyncer.cpp @@ -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), diff --git a/src/core/corebuffersyncer.h b/src/core/corebuffersyncer.h index 1f4176cd..f567735a 100644 --- a/src/core/corebuffersyncer.h +++ b/src/core/corebuffersyncer.h @@ -26,6 +26,7 @@ class CoreSession; class CoreBufferSyncer : public BufferSyncer { + SYNCABLE_OBJECT Q_OBJECT public: diff --git a/src/core/corebufferviewconfig.cpp b/src/core/corebufferviewconfig.cpp index 5f5a1b46..ab0f3089 100644 --- a/src/core/corebufferviewconfig.cpp +++ b/src/core/corebufferviewconfig.cpp @@ -20,6 +20,7 @@ #include "corebufferviewconfig.h" +INIT_SYNCABLE_OBJECT(CoreBufferViewConfig) CoreBufferViewConfig::CoreBufferViewConfig(int bufferViewId, QObject *parent) : BufferViewConfig(bufferViewId, parent) { diff --git a/src/core/corebufferviewconfig.h b/src/core/corebufferviewconfig.h index 37e4ba4c..5334b946 100644 --- a/src/core/corebufferviewconfig.h +++ b/src/core/corebufferviewconfig.h @@ -24,6 +24,7 @@ #define COREBUFFERVIEWCONFIG_H class CoreBufferViewConfig : public BufferViewConfig { + SYNCABLE_OBJECT Q_OBJECT public: diff --git a/src/core/corebufferviewmanager.cpp b/src/core/corebufferviewmanager.cpp index 8b8aedcf..4560a521 100644 --- a/src/core/corebufferviewmanager.cpp +++ b/src/core/corebufferviewmanager.cpp @@ -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) diff --git a/src/core/corebufferviewmanager.h b/src/core/corebufferviewmanager.h index 834d1e83..4bedb281 100644 --- a/src/core/corebufferviewmanager.h +++ b/src/core/corebufferviewmanager.h @@ -26,6 +26,7 @@ class CoreSession; class CoreBufferViewManager : public BufferViewManager { + SYNCABLE_OBJECT Q_OBJECT public: diff --git a/src/core/corecoreinfo.cpp b/src/core/corecoreinfo.cpp index 072dc0d5..195026a7 100644 --- a/src/core/corecoreinfo.cpp +++ b/src/core/corecoreinfo.cpp @@ -25,6 +25,7 @@ #include "quassel.h" #include "signalproxy.h" +INIT_SYNCABLE_OBJECT(CoreCoreInfo) CoreCoreInfo::CoreCoreInfo(CoreSession *parent) : CoreInfo(parent), _coreSession(parent) diff --git a/src/core/corecoreinfo.h b/src/core/corecoreinfo.h index 01d0eb78..7bda4f04 100644 --- a/src/core/corecoreinfo.h +++ b/src/core/corecoreinfo.h @@ -30,6 +30,7 @@ class CoreSession; * which is prefixing core specific sync objects with "Core"... ;) */ class CoreCoreInfo : public CoreInfo { + SYNCABLE_OBJECT Q_OBJECT public: diff --git a/src/core/coreidentity.cpp b/src/core/coreidentity.cpp index acba205d..fb836e11 100644 --- a/src/core/coreidentity.cpp +++ b/src/core/coreidentity.cpp @@ -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) diff --git a/src/core/coreidentity.h b/src/core/coreidentity.h index 57b39e09..6cb6cd11 100644 --- a/src/core/coreidentity.h +++ b/src/core/coreidentity.h @@ -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: diff --git a/src/core/coreircchannel.cpp b/src/core/coreircchannel.cpp index 0d8de10d..9db3c1a2 100644 --- a/src/core/coreircchannel.cpp +++ b/src/core/coreircchannel.cpp @@ -20,6 +20,7 @@ #include "coreircchannel.h" +INIT_SYNCABLE_OBJECT(CoreIrcChannel) CoreIrcChannel::CoreIrcChannel(const QString &channelname, Network *network) : IrcChannel(channelname, network), _receivedWelcomeMsg(false) diff --git a/src/core/coreircchannel.h b/src/core/coreircchannel.h index 61c5ecb5..5995165a 100644 --- a/src/core/coreircchannel.h +++ b/src/core/coreircchannel.h @@ -24,6 +24,7 @@ #include "ircchannel.h" class CoreIrcChannel : public IrcChannel { + SYNCABLE_OBJECT Q_OBJECT public: diff --git a/src/core/coreirclisthelper.cpp b/src/core/coreirclisthelper.cpp index b6f56e41..5abb5aad 100644 --- a/src/core/coreirclisthelper.cpp +++ b/src/core/coreirclisthelper.cpp @@ -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); diff --git a/src/core/coreirclisthelper.h b/src/core/coreirclisthelper.h index d6b3a2d5..688344a1 100644 --- a/src/core/coreirclisthelper.h +++ b/src/core/coreirclisthelper.h @@ -28,6 +28,7 @@ class QTimerEvent; class CoreIrcListHelper : public IrcListHelper { + SYNCABLE_OBJECT Q_OBJECT public: diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index 21415aed..bc7b848a 100644 --- a/src/core/corenetwork.cpp +++ b/src/core/corenetwork.cpp @@ -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(this), "connectToIrc", Qt::QueuedConnection); } void CoreNetwork::requestDisconnect() const { diff --git a/src/core/corenetwork.h b/src/core/corenetwork.h index d263f3f1..d30bb6e7 100644 --- a/src/core/corenetwork.h +++ b/src/core/corenetwork.h @@ -41,6 +41,7 @@ class UserInputHandler; class CtcpHandler; class CoreNetwork : public Network { + SYNCABLE_OBJECT Q_OBJECT public: diff --git a/src/core/corenetworkconfig.cpp b/src/core/corenetworkconfig.cpp index 1ea76f2f..ba95db56 100644 --- a/src/core/corenetworkconfig.cpp +++ b/src/core/corenetworkconfig.cpp @@ -22,6 +22,7 @@ #include "coresession.h" #include "corenetworkconfig.h" +INIT_SYNCABLE_OBJECT(CoreNetworkConfig) CoreNetworkConfig::CoreNetworkConfig(const QString& objectName, CoreSession* session) : NetworkConfig(objectName, session) { diff --git a/src/core/corenetworkconfig.h b/src/core/corenetworkconfig.h index 4f265319..88aa2279 100644 --- a/src/core/corenetworkconfig.h +++ b/src/core/corenetworkconfig.h @@ -26,6 +26,7 @@ class CoreSession; class CoreNetworkConfig : public NetworkConfig { + SYNCABLE_OBJECT Q_OBJECT public: diff --git a/src/qtui/settingspages/bufferviewsettingspage.cpp b/src/qtui/settingspages/bufferviewsettingspage.cpp index 7c32403e..166b2922 100644 --- a/src/qtui/settingspages/bufferviewsettingspage.cpp +++ b/src/qtui/settingspages/bufferviewsettingspage.cpp @@ -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(config->bufferList())); // if this is the currently displayed view we have to change the config of the preview filter diff --git a/src/uisupport/bufferviewfilter.cpp b/src/uisupport/bufferviewfilter.cpp index 57a6661b..ec14de08 100644 --- a/src/uisupport/bufferviewfilter.cpp +++ b/src/uisupport/bufferviewfilter.cpp @@ -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()));