... now that was tiresome...
}
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()))
#include "client.h"
+INIT_SYNCABLE_OBJECT(ClientAliasManager)
ClientAliasManager::ClientAliasManager(QObject *parent)
: AliasManager(parent)
{
#include "aliasmanager.h"
class ClientAliasManager : public AliasManager {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
#include "clientbufferviewconfig.h"
+INIT_SYNCABLE_OBJECT(ClientBufferViewConfig)
ClientBufferViewConfig::ClientBufferViewConfig(int bufferViewId, QObject *parent)
: BufferViewConfig(bufferViewId, parent),
_locked(false)
#include "bufferviewconfig.h"
class ClientBufferViewConfig : public BufferViewConfig {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
#include "clientbufferviewconfig.h"
+INIT_SYNCABLE_OBJECT(ClientBufferViewManager)
ClientBufferViewManager::ClientBufferViewManager(SignalProxy *proxy, QObject *parent)
: BufferViewManager(proxy, parent)
{
class BufferViewOverlay;
class ClientBufferViewManager : public BufferViewManager {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
*/
class ClientCoreInfo : public CoreInfo {
Q_OBJECT
+ SYNCABLE_OBJECT
public:
ClientCoreInfo(QObject *parent = 0) : CoreInfo(parent) {}
#include "client.h"
#include "signalproxy.h"
+INIT_SYNCABLE_OBJECT(CertIdentity)
CertIdentity::CertIdentity(IdentityId id, QObject *parent)
: Identity(id, parent)
#ifdef HAVE_SSL
class ClientCertManager;
class CertIdentity : public Identity {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
#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);
#include "irclisthelper.h"
class ClientIrcListHelper : public IrcListHelper {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
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;
cliparser.cpp
identity.cpp
ircchannel.cpp
+ irclisthelper.cpp
ircuser.cpp
logger.cpp
message.cpp
#include "aliasmanager.h"
#include "network.h"
+INIT_SYNCABLE_OBJECT(AliasManager)
AliasManager &AliasManager::operator=(const AliasManager &other) {
if(this == &other)
return *this;
_aliases << Alias(name, expansion);
- emit aliasAdded(name, expansion);
+ SYNC(ARG(name), ARG(expansion))
}
AliasManager::AliasList AliasManager::defaults() {
class Network;
class AliasManager : public SyncableObject {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
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);
#include "buffersyncer.h"
+INIT_SYNCABLE_OBJECT(BufferSyncer)
BufferSyncer::BufferSyncer(QObject *parent)
: SyncableObject(parent)
{
const MsgId oldLastSeenMsg = lastSeenMsg(buffer);
if(!oldLastSeenMsg.isValid() || oldLastSeenMsg < msgId) {
_lastSeenMsg[buffer] = msgId;
+ SYNC(ARG(buffer), ARG(msgId))
emit lastSeenMsgSet(buffer, msgId);
return true;
}
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);
}
#include "types.h"
class BufferSyncer : public SyncableObject {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
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(); }
#include "bufferinfo.h"
+INIT_SYNCABLE_OBJECT(BufferViewConfig)
BufferViewConfig::BufferViewConfig(int bufferViewId, QObject *parent)
: SyncableObject(parent),
_bufferViewId(bufferViewId),
return;
_bufferViewName = bufferViewName;
+ SYNC(ARG(bufferViewName))
emit bufferViewNameSet(bufferViewName);
}
return;
_networkId = networkId;
+ SYNC(ARG(networkId))
emit networkIdSet(networkId);
+ emit configChanged();
}
void BufferViewConfig::setAddNewBuffersAutomatically(bool addNewBuffersAutomatically) {
return;
_addNewBuffersAutomatically = addNewBuffersAutomatically;
- emit addNewBuffersAutomaticallySet(addNewBuffersAutomatically);
+ SYNC(ARG(addNewBuffersAutomatically))
+ emit configChanged();
}
void BufferViewConfig::setSortAlphabetically(bool sortAlphabetically) {
return;
_sortAlphabetically = sortAlphabetically;
- emit sortAlphabeticallySet(sortAlphabetically);
+ SYNC(ARG(sortAlphabetically))
+ emit configChanged();
}
void BufferViewConfig::setDisableDecoration(bool disableDecoration) {
return;
_disableDecoration = disableDecoration;
- emit disableDecorationSet(disableDecoration);
+ SYNC(ARG(disableDecoration))
}
void BufferViewConfig::setAllowedBufferTypes(int bufferTypes) {
return;
_allowedBufferTypes = bufferTypes;
- emit allowedBufferTypesSet(bufferTypes);
+ SYNC(ARG(bufferTypes))
+ emit configChanged();
}
void BufferViewConfig::setMinimumActivity(int activity) {
return;
_minimumActivity = activity;
- emit minimumActivitySet(activity);
+ SYNC(ARG(activity))
+ emit configChanged();
}
void BufferViewConfig::setHideInactiveBuffers(bool hideInactiveBuffers) {
return;
_hideInactiveBuffers = hideInactiveBuffers;
- emit hideInactiveBuffersSet(hideInactiveBuffers);
+ SYNC(ARG(hideInactiveBuffers))
+ emit configChanged();
}
QVariantList BufferViewConfig::initBufferList() const {
_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) {
_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 {
_buffers.insert(pos, bufferId);
emit bufferAdded(bufferId, pos);
+ emit configChanged();
}
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) {
_temporarilyRemovedBuffers << bufferId;
emit bufferRemoved(bufferId);
+ emit configChanged();
}
void BufferViewConfig::removeBufferPermanently(const BufferId &bufferId) {
_removedBuffers << bufferId;
emit bufferPermanentlyRemoved(bufferId);
+ emit configChanged();
}
#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)
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; }
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;
#include "bufferviewconfig.h"
#include "signalproxy.h"
+INIT_SYNCABLE_OBJECT(BufferViewManager)
BufferViewManager::BufferViewManager(SignalProxy *proxy, QObject *parent)
: SyncableObject(parent),
_proxy(proxy)
_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) {
_bufferViewConfigs[bufferViewConfigId]->deleteLater();
_bufferViewConfigs.remove(bufferViewConfigId);
+ SYNC(ARG(bufferViewConfigId))
emit bufferViewConfigDeleted(bufferViewConfigId);
}
class SignalProxy;
class BufferViewManager : public SyncableObject {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
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;
# include <Security.h>
#endif
+INIT_SYNCABLE_OBJECT(Identity)
Identity::Identity(IdentityId id, QObject *parent)
: SyncableObject(parent),
_identityId(id)
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))
}
/*** ***/
return in;
}
+INIT_SYNCABLE_OBJECT(CertManager)
#include "syncableobject.h"
class Identity : public SyncableObject {
+ SYNCABLE_OBJECT
Q_OBJECT
Q_PROPERTY(IdentityId identityId READ id WRITE setId STORED false)
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;
#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)
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
#include <QDebug>
-
+INIT_SYNCABLE_OBJECT(IrcChannel)
IrcChannel::IrcChannel(const QString &channelname, Network *network)
: SyncableObject(network),
_initialized(false),
void IrcChannel::setPassword(const QString &password) {
_password = password;
- emit passwordSet(password);
+ SYNC(ARG(password))
}
void IrcChannel::joinIrcUsers(const QList<IrcUser *> &users, const QStringList &modes) {
_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
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) {
joinIrcUsers(users, modes);
}
-void IrcChannel::joinIrcUsers(IrcUser *ircuser) {
+void IrcChannel::joinIrcUser(IrcUser *ircuser) {
QList <IrcUser *> users;
users << ircuser;
QStringList modes;
joinIrcUsers(users, modes);
}
-void IrcChannel::joinIrcUsers(const QString &nick) {
- joinIrcUsers(network->newIrcUser(nick));
-}
-
void IrcChannel::part(IrcUser *ircuser) {
if(isKnownUser(ircuser)) {
_userModes.remove(ircuser);
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);
}
}
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);
}
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);
}
}
_D_channelModes << mode;
break;
}
- emit channelModeAdded(mode, value);
+ SYNC(ARG(mode), ARG(value))
}
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 {
class Network;
class IrcChannel : public SyncableObject {
+ SYNCABLE_OBJECT
Q_OBJECT
Q_PROPERTY(QString name READ name STORED false)
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);
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);
--- /dev/null
+/***************************************************************************
+ * 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)
* 3.) client pulls the data by calling requestChannelList again. receiving the data in receiveChannelList
*/
class IrcListHelper : public SyncableObject {
+ SYNCABLE_OBJECT
Q_OBJECT
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
void IrcUser::setAway(const bool &away) {
if(away != _away) {
_away = away;
+ emit awaySet(away);
SYNC(ARG(away))
}
}
if(!nick.isEmpty() && nick != _nick) {
_nick = nick;
updateObjectName();
+ emit nickSet(nick);
SYNC(ARG(nick))
}
}
Q_ASSERT(channel);
if(!_channels.contains(channel)) {
_channels.insert(channel);
- channel->joinIrcUsers(this);
+ channel->joinIrcUser(this);
}
}
_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();
}
void IrcUser::setUserModes(const QString &modes) {
_userModes = modes;
SYNC(ARG(modes))
+ emit userModesSet(modes);
}
void IrcUser::addUserModes(const QString &modes) {
}
SYNC(ARG(modes))
+ emit userModesAdded(modes);
}
void IrcUser::removeUserModes(const QString &modes) {
_userModes.remove(modes[i]);
}
SYNC(ARG(modes))
+ emit userModesRemoved(modes);
}
void IrcUser::setLastChannelActivity(BufferId buffer, const QDateTime &time) {
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);
// 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);
// ====================
// Public:
// ====================
+INIT_SYNCABLE_OBJECT(Network)
Network::Network(const NetworkId &networkid, QObject *parent)
: SyncableObject(parent),
_proxy(0),
_ircUsers[nick] = ircuser;
- emit ircUserAdded(hostmask);
+ SYNC_OTHER(addIrcUser, ARG(hostmask))
+ // emit ircUserAdded(hostmask);
emit ircUserAdded(ircuser);
}
_ircChannels[channelname.toLower()] = channel;
- emit ircChannelAdded(channelname);
+ SYNC_OTHER(addIrcChannel, ARG(channelname))
+ // emit ircChannelAdded(channelname);
emit ircChannelAdded(channel);
}
return _ircChannels[channelname.toLower()];
void Network::setCodecForServer(QTextCodec *codec) {
_codecForServer = codec;
- emit codecForServerSet(codecForServer());
+ QByteArray codecName = codecForServer();
+ SYNC_OTHER(setCodecForServer, ARG(codecName))
}
QByteArray Network::codecForEncoding() const {
void Network::setCodecForEncoding(QTextCodec *codec) {
_codecForEncoding = codec;
- emit codecForEncodingSet(codecForEncoding());
+ QByteArray codecName = codecForEncoding();
+ SYNC_OTHER(setCodecForEncoding, ARG(codecName))
}
QByteArray Network::codecForDecoding() const {
void Network::setCodecForDecoding(QTextCodec *codec) {
_codecForDecoding = codec;
- emit codecForDecodingSet(codecForDecoding());
+ QByteArray codecName = codecForDecoding();
+ SYNC_OTHER(setCodecForDecoding, ARG(codecName))
}
// FIXME use server encoding if appropriate
// ====================
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);
}
setCurrentServer(QString());
removeChansAndUsers();
}
+ SYNC(ARG(connected))
emit connectedSet(connected);
}
void Network::setConnectionState(int state) {
_connectionState = (ConnectionState)state;
//qDebug() << "netstate" << networkId() << networkName() << state;
- emit connectionStateSet(state);
+ SYNC(ARG(state))
emit connectionStateSet(_connectionState);
}
if(!_myNick.isEmpty() && !ircUser(myNick())) {
newIrcUser(myNick());
}
+ SYNC(ARG(nickname))
emit myNickSet(nickname);
}
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 ¶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))
}
}
// 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)
// 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 &);
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); }
#include "networkconfig.h"
+INIT_SYNCABLE_OBJECT(NetworkConfig)
NetworkConfig::NetworkConfig(const QString &objectName, QObject *parent)
: SyncableObject(objectName, parent),
_pingTimeoutEnabled(true),
return;
_pingTimeoutEnabled = enabled;
+ SYNC(ARG(enabled))
emit pingTimeoutEnabledSet(enabled);
}
return;
_pingInterval = interval;
+ SYNC(ARG(interval))
emit pingIntervalSet(interval);
}
return;
_maxPingCount = count;
- emit maxPingCountSet(count);
+ SYNC(ARG(count))
}
void NetworkConfig::setAutoWhoEnabled(bool enabled) {
return;
_autoWhoEnabled = enabled;
+ SYNC(ARG(enabled))
emit autoWhoEnabledSet(enabled);
}
return;
_autoWhoInterval = interval;
+ SYNC(ARG(interval))
emit autoWhoIntervalSet(interval);
}
return;
_autoWhoNickLimit = nickLimit;
- emit autoWhoNickLimitSet(nickLimit);
+ SYNC(ARG(nickLimit))
}
void NetworkConfig::setAutoWhoDelay(int delay) {
return;
_autoWhoDelay = delay;
+ SYNC(ARG(delay))
emit autoWhoDelaySet(delay);
}
#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)
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;
}
}
- qDebug() << "SignalProxy::receivePeerSignal)" << requestType << params;
+ // qDebug() << "SignalProxy::receivePeerSignal)" << requestType << params;
switch(requestType) {
case RpcCall:
if(params.empty())
}
}
-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;
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
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();
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);
}
}
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);
# 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
#include "corenetwork.h"
#include "coresession.h"
+INIT_SYNCABLE_OBJECT(CoreAliasManager)
CoreAliasManager::CoreAliasManager(CoreSession *parent)
: AliasManager(parent)
{
class CoreSession;
class CoreAliasManager : public AliasManager {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
#include <QDebug>
+INIT_SYNCABLE_OBJECT(CoreBacklogManager)
CoreBacklogManager::CoreBacklogManager(CoreSession *coreSession)
: BacklogManager(coreSession),
_coreSession(coreSession)
class CoreSession;
class CoreBacklogManager : public BacklogManager {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
PurgeEvent() : QEvent(QEvent::User) {}
};
+INIT_SYNCABLE_OBJECT(CoreBufferSyncer)
CoreBufferSyncer::CoreBufferSyncer(CoreSession *parent)
: BufferSyncer(Core::bufferLastSeenMsgIds(parent->user()), parent),
_coreSession(parent),
class CoreSession;
class CoreBufferSyncer : public BufferSyncer {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
#include "corebufferviewconfig.h"
+INIT_SYNCABLE_OBJECT(CoreBufferViewConfig)
CoreBufferViewConfig::CoreBufferViewConfig(int bufferViewId, QObject *parent)
: BufferViewConfig(bufferViewId, parent)
{
#define COREBUFFERVIEWCONFIG_H
class CoreBufferViewConfig : public BufferViewConfig {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
#include "core.h"
#include "coresession.h"
+INIT_SYNCABLE_OBJECT(CoreBufferViewManager)
CoreBufferViewManager::CoreBufferViewManager(SignalProxy *proxy, CoreSession *parent)
: BufferViewManager(proxy, parent),
_coreSession(parent)
class CoreSession;
class CoreBufferViewManager : public BufferViewManager {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
#include "quassel.h"
#include "signalproxy.h"
+INIT_SYNCABLE_OBJECT(CoreCoreInfo)
CoreCoreInfo::CoreCoreInfo(CoreSession *parent)
: CoreInfo(parent),
_coreSession(parent)
* which is prefixing core specific sync objects with "Core"... ;)
*/
class CoreCoreInfo : public CoreInfo {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
#include "signalproxy.h"
+INIT_SYNCABLE_OBJECT(CoreIdentity)
CoreIdentity::CoreIdentity(IdentityId id, QObject *parent)
: Identity(id, parent)
#ifdef HAVE_SSL
// ========================================
// CoreCertManager
// ========================================
+INIT_SYNCABLE_OBJECT(CoreCertManager)
CoreCertManager::CoreCertManager(CoreIdentity &identity)
: CertManager(identity.id()),
identity(identity)
#ifdef HAVE_SSL
class CoreIdentity;
class CoreCertManager : public CertManager {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
// CoreIdentity
// =========================================
class CoreIdentity : public Identity {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
#include "coreircchannel.h"
+INIT_SYNCABLE_OBJECT(CoreIrcChannel)
CoreIrcChannel::CoreIrcChannel(const QString &channelname, Network *network)
: IrcChannel(channelname, network),
_receivedWelcomeMsg(false)
#include "ircchannel.h"
class CoreIrcChannel : public IrcChannel {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
#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);
class QTimerEvent;
class CoreIrcListHelper : public IrcListHelper {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
#include "userinputhandler.h"
#include "ctcphandler.h"
+INIT_SYNCABLE_OBJECT(CoreNetwork)
CoreNetwork::CoreNetwork(const NetworkId &networkid, CoreSession *session)
: Network(networkid, session),
_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()));
qWarning() << "Requesting connect while already being connected!";
return;
}
- Network::requestConnect();
+ QMetaObject::invokeMethod(const_cast<CoreNetwork *>(this), "connectToIrc", Qt::QueuedConnection);
}
void CoreNetwork::requestDisconnect() const {
class CtcpHandler;
class CoreNetwork : public Network {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
#include "coresession.h"
#include "corenetworkconfig.h"
+INIT_SYNCABLE_OBJECT(CoreNetworkConfig)
CoreNetworkConfig::CoreNetworkConfig(const QString& objectName, CoreSession* session)
: NetworkConfig(objectName, session)
{
class CoreSession;
class CoreNetworkConfig : public NetworkConfig {
+ SYNCABLE_OBJECT
Q_OBJECT
public:
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
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()));