瀏覽代碼

Auto Start: Only set on first account setup, not all later ones

Markus Goetz 9 年之前
父節點
當前提交
fc7aaf792b
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/gui/application.cpp

+ 7 - 2
src/gui/application.cpp

@@ -336,8 +336,13 @@ void Application::slotownCloudWizardDone( int res )
         _checkConnectionTimer.start();
         slotCheckConnection();
 
-        // The very first time an account is configured: enabled autostart
-        // TODO: Doing this every time the account wizard finishes will annoy users.
+        // If one account is configured: enable autostart
+        bool shouldSetAutoStart = (accountMan->accounts().size() == 1);
+#ifdef Q_OS_MAC
+        // Don't auto start when not being 'installed'
+        shouldSetAutoStart = shouldSetAutoStart
+                && QCoreApplication::applicationDirPath().startsWith("/Applications/");
+#endif
         Utility::setLaunchOnStartup(_theme->appName(), _theme->appNameGUI(), true);
     }
 }