_codecForServer = codec;
QByteArray codecName = codecForServer();
SYNC_OTHER(setCodecForServer, ARG(codecName))
+ emit configChanged();
}
QByteArray Network::codecForEncoding() const {
_codecForEncoding = codec;
QByteArray codecName = codecForEncoding();
SYNC_OTHER(setCodecForEncoding, ARG(codecName))
+ emit configChanged();
}
QByteArray Network::codecForDecoding() const {
_codecForDecoding = codec;
QByteArray codecName = codecForDecoding();
SYNC_OTHER(setCodecForDecoding, ARG(codecName))
+ emit configChanged();
}
// FIXME use server encoding if appropriate
_networkName = networkName;
SYNC(ARG(networkName))
emit networkNameSet(networkName);
+ emit configChanged();
}
void Network::setCurrentServer(const QString ¤tServer) {
_identity = id;
SYNC(ARG(id))
emit identitySet(id);
+ emit configChanged();
}
void Network::setServerList(const QVariantList &serverList) {
_serverList = fromVariantList<Server>(serverList);
SYNC(ARG(serverList))
+ emit configChanged();
}
void Network::setUseRandomServer(bool use) {
_useRandomServer = use;
SYNC(ARG(use))
+ emit configChanged();
}
void Network::setPerform(const QStringList &perform) {
_perform = perform;
SYNC(ARG(perform))
+ emit configChanged();
}
void Network::setUseAutoIdentify(bool use) {
_useAutoIdentify = use;
SYNC(ARG(use))
+ emit configChanged();
}
void Network::setAutoIdentifyService(const QString &service) {
_autoIdentifyService = service;
SYNC(ARG(service))
+ emit configChanged();
}
void Network::setAutoIdentifyPassword(const QString &password) {
_autoIdentifyPassword = password;
SYNC(ARG(password))
+ emit configChanged();
}
void Network::setUseAutoReconnect(bool use) {
_useAutoReconnect = use;
SYNC(ARG(use))
+ emit configChanged();
}
void Network::setAutoReconnectInterval(quint32 interval) {
_autoReconnectInterval = interval;
SYNC(ARG(interval))
+ emit configChanged();
}
void Network::setAutoReconnectRetries(quint16 retries) {
_autoReconnectRetries = retries;
SYNC(ARG(retries))
+ emit configChanged();
}
void Network::setUnlimitedReconnectRetries(bool unlimited) {
_unlimitedReconnectRetries = unlimited;
SYNC(ARG(unlimited))
+ emit configChanged();
}
void Network::setRejoinChannels(bool rejoin) {
_rejoinChannels = rejoin;
SYNC(ARG(rejoin))
+ emit configChanged();
}
void Network::addSupport(const QString ¶m, const QString &value) {
// void latencySet(int latency);
void identitySet(IdentityId);
-// void serverListSet(QVariantList serverList);
+ void configChanged();
+
+ // void serverListSet(QVariantList serverList);
// void useRandomServerSet(bool);
// void performSet(const QStringList &);
// void useAutoIdentifySet(bool);
}
SignalProxy::~SignalProxy() {
- QList<SyncableObject *> syncObjects;
QHash<QByteArray, ObjectId>::iterator classIter = _syncSlave.begin();
while(classIter != _syncSlave.end()) {
- syncObjects << classIter->values();
+ ObjectId::iterator objIter = classIter->begin();
+ while(objIter != classIter->end()) {
+ SyncableObject *obj = objIter.value();
+ objIter = classIter->erase(objIter);
+ obj->stopSynchronize(this);
+ }
classIter++;
}
_syncSlave.clear();
- foreach(SyncableObject *obj, syncObjects) {
- obj->stopSynchronize(this);
- }
removeAllPeers();
}
}
void SignalProxy::objectRenamed(const QByteArray &classname, const QString &newname, const QString &oldname) {
- qDebug() << "SignalProxy::objectRenamed" << classname << newname << oldname;
if(proxyMode() == Server)
return;
}
SyncableObject::~SyncableObject() {
- QList<SignalProxy *> proxies = _signalProxies;
- _signalProxies.clear();
- for(int i = 0; i < proxies.count(); i++) {
- proxies[i]->stopSynchronize(this);
+ QList<SignalProxy *>::iterator proxyIter = _signalProxies.begin();
+ while(proxyIter != _signalProxies.end()) {
+ SignalProxy *proxy = (*proxyIter);
+ proxyIter = _signalProxies.erase(proxyIter);
+ proxy->stopSynchronize(this);
}
}
}
QVariantList CoreBacklogManager::requestBacklogAll(MsgId first, MsgId last, int limit, int additional) {
- qDebug() << "CoreBacklogManager::requestBacklogAll" << first << last << limit << additional;
QVariantList backlog;
QList<Message> msgList;
msgList = Core::requestAllMsgs(coreSession()->user(), first, last, limit);
void NetworksSettingsPage::clientNetworkAdded(NetworkId id) {
insertNetwork(id);
//connect(Client::network(id), SIGNAL(updatedRemotely()), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(identitySet(IdentityId)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(networkNameSet(const QString &)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(serverListSet(QVariantList)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(useRandomServerSet(bool)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(performSet(const QStringList &)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(useAutoIdentifySet(bool)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(autoIdentifyServiceSet(const QString &)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(autoIdentifyPasswordSet(const QString &)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(useAutoReconnectSet(bool)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(autoReconnectIntervalSet(quint32)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(autoReconnectRetriesSet(quint16)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(unlimitedReconnectRetriesSet(bool)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(rejoinChannelsSet(bool)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(codecForServerSet(const QByteArray &)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(codecForEncodingSet(const QByteArray &)), this, SLOT(clientNetworkUpdated()));
- connect(Client::network(id), SIGNAL(codecForDecodingSet(const QByteArray &)), this, SLOT(clientNetworkUpdated()));
+ connect(Client::network(id), SIGNAL(configChanged()), this, SLOT(clientNetworkUpdated()));
connect(Client::network(id), SIGNAL(connectionStateSet(Network::ConnectionState)), this, SLOT(networkConnectionStateChanged(Network::ConnectionState)));
connect(Client::network(id), SIGNAL(connectionError(const QString &)), this, SLOT(networkConnectionError(const QString &)));