Merge branch 'master' into linux_restart_on_new_version
authorDaniel Molkentin <danimo@owncloud.com>
Thu, 6 Aug 2015 09:11:52 +0000 (11:11 +0200)
committerDaniel Molkentin <danimo@owncloud.com>
Thu, 6 Aug 2015 09:11:52 +0000 (11:11 +0200)
Conflicts:
src/gui/application.cpp
src/gui/owncloudsetupwizard.cpp

1  2 
src/gui/application.cpp
src/gui/application.h
src/gui/folderman.cpp
src/gui/folderman.h
src/gui/main.cpp
src/libsync/utility.cpp
test/CMakeLists.txt
test/testutility.h

index a494e56a4c6db42d23096e8ba651bc61b44ec6fe,34eb533b6d6f28bd056f53c4034563700d2ddf32..3a777feb0955d7bc9efab4704d1074f508019ce8
@@@ -168,19 -166,14 +167,19 @@@ Application::Application(int &argc, cha
      // Also check immediatly
      QTimer::singleShot( 0, this, SLOT( slotCheckConnection() ));
  
-     if( cfg.skipUpdateCheck() ) {
-         qDebug() << Q_FUNC_INFO << "Skipping update check";
-     } else {
-         QTimer::singleShot( 3000, this, SLOT( slotStartUpdateDetector() ));
-     }
+     // Update checks
+     UpdaterScheduler *updaterScheduler = new UpdaterScheduler(this);
+     connect(updaterScheduler, SIGNAL(updaterAnnouncement(QString, QString)),
+             _gui, SLOT(slotShowTrayMessage(QString, QString)));
  
+     // Cleanup at Quit.
      connect (this, SIGNAL(aboutToQuit()), SLOT(slotCleanup()));
  
 +    // remember the version of the currently running binary. On Linux it might happen that the
 +    // package management updates the package while the app is running. This is detected in the
 +    // updater slot: If the installed binary on the hd has a different version than the one
 +    // running, the running app is restart. That happens in folderman.
 +    _runningAppVersion = Utility::versionOfInstalledBinary();
  }
  
  Application::~Application()
@@@ -218,22 -211,6 +217,16 @@@ void Application::slotCleanup(
      _gui->deleteLater();
  }
  
- void Application::slotStartUpdateDetector()
- {
-     Updater *updater = Updater::instance();
-     updater->backgroundCheckForUpdate();
 +
 +    if( Utility::isLinux() ) {
 +        // on linux, check if the installed binary is still the same version
 +        // as the one that is running. If not, restart if possible.
 +        const QByteArray fsVersion = Utility::versionOfInstalledBinary();
 +
 +        if( !(fsVersion.isEmpty() || _runningAppVersion.isEmpty()) && fsVersion != _runningAppVersion ) {
 +            _folderManager->slotScheduleAppRestart();
 +        }
 +    }
- }
  void Application::slotCheckConnection()
  {
      auto list = AccountManager::instance()->accounts();
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge