Autostart does not depend on how many accounts are configured.

Set autostart default to true.

Signed-off-by: Camila <hello@camila.codes>
This commit is contained in:
Camila 2023-12-27 22:15:58 +01:00 committed by Camila Ayres
parent 3bcc17b942
commit c4095d698a
No known key found for this signature in database
GPG key ID: 7A4A6121E88E2AD4

View file

@ -639,20 +639,15 @@ void Application::slotownCloudWizardDone(int res)
_checkConnectionTimer.start();
slotCheckConnection();
// If one account is configured: enable autostart
#ifndef QT_DEBUG
bool shouldSetAutoStart = AccountManager::instance()->accounts().size() == 1;
#else
bool shouldSetAutoStart = false;
#endif
bool shouldSetAutoStart = true;
#ifdef Q_OS_MAC
// Don't auto start when not being 'installed'
shouldSetAutoStart = shouldSetAutoStart
&& QCoreApplication::applicationDirPath().startsWith("/Applications/");
#endif
if (shouldSetAutoStart) {
Utility::setLaunchOnStartup(_theme->appName(), _theme->appNameGUI(), true);
}
Utility::setLaunchOnStartup(_theme->appName(), _theme->appNameGUI(), shouldSetAutoStart);
Systray::instance()->showWindow();
}