_backlogManager(new ClientBacklogManager(this)),
_bufferViewManager(0),
_bufferViewOverlay(new BufferViewOverlay(this)),
- _coreInfo(nullptr),
+ _coreInfo(new CoreInfo(this)),
_dccConfig(0),
_ircListHelper(new ClientIrcListHelper(this)),
_inputHandler(0),
coreAccountModel()->load();
+ // Attach CoreInfo
+ p->synchronize(coreInfo());
+
connect(coreConnection(), SIGNAL(stateChanged(CoreConnection::ConnectionState)), SLOT(connectionStateChanged(CoreConnection::ConnectionState)));
coreConnection()->init();
}
}
+void Client::onDbUpgradeInProgress(bool inProgress)
+{
+ emit dbUpgradeInProgress(inProgress);
+}
+
+
/*** Network handling ***/
QList<NetworkId> Client::networkIds()
SignalProxy *p = signalProxy();
p->synchronize(bufferSyncer());
- // create CoreInfo
- Q_ASSERT(!_coreInfo);
- _coreInfo = new CoreInfo(this);
- p->synchronize(coreInfo());
-
// create a new BufferViewManager
Q_ASSERT(!_bufferViewManager);
_bufferViewManager = new ClientBufferViewManager(p, this);
}
+void Client::requestLegacyCoreInfo()
+{
+ // On older cores, the CoreInfo object was only synchronized on demand. Synchronize now if
+ // needed.
+ if (isConnected() && !isCoreFeatureEnabled(Quassel::Feature::SyncedCoreInfo)) {
+ // Delete the existing core info object (it will always exist as client is single-threaded)
+ _coreInfo->deleteLater();
+ // No need to set to null when creating new one immediately after
+
+ // Create a fresh, unsynchronized CoreInfo object, emulating legacy behavior of CoreInfo not
+ // persisting
+ _coreInfo = new CoreInfo(this);
+ // Synchronize the new object
+ signalProxy()->synchronize(_coreInfo);
+
+ // Let others know signal handlers have been reset
+ emit coreInfoResynchronized();
+ }
+}
+
+
void Client::disconnectFromCore()
{
if (!coreConnection()->isConnected())
_bufferSyncer = 0;
}
- if (_coreInfo) {
- _coreInfo->deleteLater();
- _coreInfo = nullptr;
- }
+ _coreInfo->reset();
if (_bufferViewManager) {
_bufferViewManager->deleteLater();
}
+void Client::refreshLegacyCoreInfo()
+{
+ instance()->requestLegacyCoreInfo();
+}
+
+
void Client::changePassword(const QString &oldPassword, const QString &newPassword) {
CoreAccount account = currentCoreAccount();
account.setPassword(newPassword);