|
12 | 12 | #include <QClipboard> |
13 | 13 | #include <QDBusConnection> |
14 | 14 | #include <QDBusMessage> |
| 15 | +#include <QPixmap> |
| 16 | +#include <QRect> |
| 17 | + |
| 18 | +#if !defined(DISABLE_UPDATE_CHECKER) |
15 | 19 | #include <QDesktopServices> |
16 | 20 | #include <QJsonDocument> |
17 | 21 | #include <QJsonObject> |
18 | 22 | #include <QNetworkAccessManager> |
19 | 23 | #include <QNetworkReply> |
20 | | -#include <QPixmap> |
21 | | -#include <QRect> |
22 | 24 | #include <QTimer> |
23 | 25 | #include <QUrl> |
| 26 | +#endif |
24 | 27 |
|
25 | 28 | #ifdef Q_OS_WIN |
26 | 29 | #include "src/core/globalshortcutfilter.h" |
@@ -57,9 +60,11 @@ FlameshotDaemon::FlameshotDaemon() |
57 | 60 | , m_hostingClipboard(false) |
58 | 61 | , m_clipboardSignalBlocked(false) |
59 | 62 | , m_trayIcon(nullptr) |
| 63 | +#if !defined(DISABLE_UPDATE_CHECKER) |
60 | 64 | , m_networkCheckUpdates(nullptr) |
61 | 65 | , m_showCheckAppUpdateStatus(false) |
62 | 66 | , m_appLatestVersion(QStringLiteral(APP_VERSION).replace("v", "")) |
| 67 | +#endif |
63 | 68 | { |
64 | 69 | connect( |
65 | 70 | QApplication::clipboard(), &QClipboard::dataChanged, this, [this]() { |
@@ -87,9 +92,12 @@ FlameshotDaemon::FlameshotDaemon() |
87 | 92 | m_persist = !config.autoCloseIdleDaemon(); |
88 | 93 | }); |
89 | 94 | #endif |
| 95 | + |
| 96 | +#if !defined(DISABLE_UPDATE_CHECKER) |
90 | 97 | if (ConfigHandler().checkForUpdates()) { |
91 | 98 | getLatestAvailableVersion(); |
92 | 99 | } |
| 100 | +#endif |
93 | 101 | } |
94 | 102 |
|
95 | 103 | void FlameshotDaemon::start() |
@@ -169,6 +177,7 @@ void FlameshotDaemon::sendTrayNotification(const QString& text, |
169 | 177 | } |
170 | 178 | } |
171 | 179 |
|
| 180 | +#if !defined(DISABLE_UPDATE_CHECKER) |
172 | 181 | void FlameshotDaemon::showUpdateNotificationIfAvailable(CaptureWidget* widget) |
173 | 182 | { |
174 | 183 | if (!m_appLatestUrl.isEmpty() && |
@@ -207,6 +216,7 @@ void FlameshotDaemon::checkForUpdates() |
207 | 216 | QDesktopServices::openUrl(QUrl(m_appLatestUrl)); |
208 | 217 | } |
209 | 218 | } |
| 219 | +#endif |
210 | 220 |
|
211 | 221 | /** |
212 | 222 | * @brief Return the daemon instance. |
@@ -344,6 +354,7 @@ void FlameshotDaemon::enableTrayIcon(bool enable) |
344 | 354 | } |
345 | 355 | } |
346 | 356 |
|
| 357 | +#if !defined(DISABLE_UPDATE_CHECKER) |
347 | 358 | void FlameshotDaemon::handleReplyCheckUpdates(QNetworkReply* reply) |
348 | 359 | { |
349 | 360 | if (!ConfigHandler().checkForUpdates()) { |
@@ -382,6 +393,7 @@ void FlameshotDaemon::handleReplyCheckUpdates(QNetworkReply* reply) |
382 | 393 | } |
383 | 394 | m_showCheckAppUpdateStatus = false; |
384 | 395 | } |
| 396 | +#endif |
385 | 397 |
|
386 | 398 | QDBusMessage FlameshotDaemon::createMethodCall(QString method) |
387 | 399 | { |
|
0 commit comments