Do not compile things that require the app bundle when building the client without...
authorClaudio Cambra <claudio.cambra@gmail.com>
Mon, 6 Jun 2022 17:05:12 +0000 (19:05 +0200)
committerClaudio Cambra <claudio.cambra@gmail.com>
Fri, 10 Jun 2022 08:43:36 +0000 (10:43 +0200)
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
CMakeLists.txt
src/gui/systray.cpp
src/gui/updater/updater.cpp

index 0176eaf9af3e295b0d2110d8160b559efa5c626b..d6c978f72b22711f5cf0845cac97e3ebc1e52fd5 100644 (file)
@@ -105,6 +105,7 @@ if(APPLE AND BUILD_OWNCLOUD_OSX_BUNDLE)
     set(OWNCLOUD_OSX_BUNDLE "${APPLICATION_NAME}.app")
     set(LIB_INSTALL_DIR "${APPLICATION_NAME}.app/Contents/MacOS")
     set(BIN_INSTALL_DIR "${APPLICATION_NAME}.app/Contents/MacOS")
+    add_definitions(-DBUILD_OWNCLOUD_OSX_BUNDLE)
 endif()
 
 
index db04b01a43ddaf1bc60c7fc7504e134053c4cc93..7de521ca7ec52afd49328b2cf1e5fc8626716fb7 100644 (file)
@@ -99,7 +99,7 @@ Systray::Systray()
 
     qmlRegisterType<WheelHandler>("com.nextcloud.desktopclient", 1, 0, "WheelHandler");
 
-#ifdef Q_OS_MACOS
+#if defined(Q_OS_MACOS) && defined(BUILD_OWNCLOUD_OSX_BUNDLE)
     setUserNotificationCenterDelegate();
     checkNotificationAuth(MacNotificationAuthorizationOptions::Default); // No provisional auth, ask user explicitly first time
     registerNotificationCategories(QString(tr("Download")));
@@ -307,7 +307,7 @@ void Systray::showMessage(const QString &title, const QString &message, MessageI
         QDBusConnection::sessionBus().asyncCall(method);
     } else
 #endif
-#ifdef Q_OS_OSX
+#if defined(Q_OS_MACOS) && defined(BUILD_OWNCLOUD_OSX_BUNDLE)
         if (canOsXSendUserNotification()) {
         sendOsXUserNotification(title, message);
     } else
@@ -319,7 +319,7 @@ void Systray::showMessage(const QString &title, const QString &message, MessageI
 
 void Systray::showUpdateMessage(const QString &title, const QString &message, const QUrl &webUrl)
 {
-#ifdef Q_OS_MACOS
+#if defined(Q_OS_MACOS) && defined(BUILD_OWNCLOUD_OSX_BUNDLE)
     sendOsXUpdateNotification(title, message, webUrl);
 #else // TODO: Implement custom notifications (i.e. actionable) for other OSes
     Q_UNUSED(webUrl);
index af8fad47b26ca3bdd24c7391e8529496cbd28983..cb3dd310738ca984931e5361a6c686d73883e15a 100644 (file)
@@ -141,7 +141,7 @@ Updater *Updater::create()
         return nullptr;
     }
 
-#if defined(Q_OS_MAC) && defined(HAVE_SPARKLE)
+#if defined(Q_OS_MACOS) && defined(HAVE_SPARKLE) && defined(BUILD_OWNCLOUD_OSX_BUNDLE)
     return new SparkleUpdater(url);
 #elif defined(Q_OS_WIN32)
     // Also for MSI