diff --git a/src/gui/updater/sparkleupdater_mac.mm b/src/gui/updater/sparkleupdater_mac.mm index 718a1e5e9c341..a4e7104247893 100644 --- a/src/gui/updater/sparkleupdater_mac.mm +++ b/src/gui/updater/sparkleupdater_mac.mm @@ -19,6 +19,7 @@ #include #include "common/utility.h" +#include "configfile.h" #include "updater/sparkleupdater.h" @interface DelegateObject : NSObject @@ -119,17 +120,23 @@ - (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcas [d->updater setFeedURL: nsurl]; } -// FIXME: Should be changed to not instanicate the SparkleUpdater at all in this case +// FIXME: Should be changed to not instantiate the SparkleUpdater at all in this case bool autoUpdaterAllowed() { // See https://github.com/owncloud/client/issues/2931 NSString *bundlePath = [[NSBundle mainBundle] bundlePath]; NSString *expectedPath = [NSString stringWithFormat:@"/Applications/%@", [bundlePath lastPathComponent]]; - if ([expectedPath isEqualTo:bundlePath]) { - return true; + if (![expectedPath isEqualTo:bundlePath]) { + qCWarning(lcUpdater) << "We are not in /Applications, won't check for update!"; + return false; } - qCWarning(lcUpdater) << "We are not in /Applications, won't check for update!"; - return false; + + if(ConfigFile().skipUpdateCheck()) { + qCWarning(lcUpdater) << "Auto-updating has been set to skip in nextcloud.cfg, won't check for update."; + return false; + } + + return true; }