On legacy cores (lacking SyncedCoreInfo), when CoreInfoDlg is open,
every 15 seconds resynchronize CoreInfo object to update the
"Connected Clients" count. This matches expectations set by the
counting uptime clock, and shouldn't be a significant data impact as
info is only polled while the dialog is open.
Modern cores (with SyncedCoreInfo) will not poll, using signals to
update immediately as before.
// Update legacy core info for Quassel cores earlier than 0.13. This does nothing on modern
// cores.
// Update legacy core info for Quassel cores earlier than 0.13. This does nothing on modern
// cores.
- Client::refreshLegacyCoreInfo();
+ refreshLegacyCoreInfo();
// Display existing core info, set up signal handlers
coreInfoResynchronized();
// Display existing core info, set up signal handlers
coreInfoResynchronized();
+void CoreInfoDlg::refreshLegacyCoreInfo() {
+ if (!Client::isConnected() || Client::isCoreFeatureEnabled(Quassel::Feature::SyncedCoreInfo)) {
+ // If we're not connected, or the core supports SyncedCoreInfo (0.13+), bail out
+ return;
+ }
+
+ // Request legacy (pre-0.13) CoreInfo object to be resynchronized (does nothing on modern cores)
+ Client::refreshLegacyCoreInfo();
+
+ // On legacy cores, CoreInfo data does not send signals. Periodically poll for information.
+ // 15 seconds seems like a reasonable trade-off as this only happens while the dialog is open.
+ QTimer::singleShot(15 * 1000, this, SLOT(refreshLegacyCoreInfo()));
+}
+
+
void CoreInfoDlg::coreInfoResynchronized() {
// CoreInfo object has been recreated, or this is the first time the dialog's been shown
void CoreInfoDlg::coreInfoResynchronized() {
// CoreInfo object has been recreated, or this is the first time the dialog's been shown
void timerEvent(QTimerEvent *) override { updateUptime(); }
private slots:
void timerEvent(QTimerEvent *) override { updateUptime(); }
private slots:
+ /**
+ * Requests resynchronization of CoreInfo object for legacy (pre-0.13) cores
+ *
+ * This provides compatibility with updating core information for legacy cores, and can be
+ * removed after protocol break.
+ */
+ void refreshLegacyCoreInfo();
+
/**
* Handler for recreation of CoreInfo object, including first-time setup
*
/**
* Handler for recreation of CoreInfo object, including first-time setup
*