Avoid starting Syncthing unintentionally when connection not metered anymore

This commit is contained in:
Martchus 2024-02-17 00:04:19 +01:00
parent 3b8d4f3d89
commit f4aa2b22ce
1 changed files with 6 additions and 0 deletions

View File

@ -342,6 +342,12 @@ void SyncthingLauncher::handleGuiListeningUrlFound(CppUtilities::BufferSearch &,
void SyncthingLauncher::terminateDueToMeteredConnection()
{
if (!isRunning()) {
// do not set m_stoppedMetered (and basically don't do anything) if not running anyway; otherwise we'd
// always start Syncthing once the connection is not metered anymore (even if Syncthing has not even been
// running before)
return;
}
if (m_lastLauncherSettings && !m_relevantConnection) {
m_relevantConnection = m_lastLauncherSettings->connectionForLauncher(this);
}