From 61f62ae23220058784384e4801c379a1497da632 Mon Sep 17 00:00:00 2001 From: Weixuan XIAO Date: Sat, 16 Nov 2019 18:40:40 +0100 Subject: [PATCH] Compile only necessary code in specified platforms --- indicator/indicatorhelper.cpp | 4 ++++ indicator/indicatorhelper.h | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/indicator/indicatorhelper.cpp b/indicator/indicatorhelper.cpp index eb5bd51c6..7b17df33d 100644 --- a/indicator/indicatorhelper.cpp +++ b/indicator/indicatorhelper.cpp @@ -60,6 +60,7 @@ void IndicatorHelper::systrayIconHook(KStatusNotifierItem &systray) } #endif +#ifdef Q_OS_MAC MacOSIndicatorHelper::MacOSIndicatorHelper() { QIcon kdeconnectIcon = QIcon::fromTheme(QStringLiteral("kdeconnect")); @@ -169,7 +170,9 @@ void MacOSIndicatorHelper::systrayIconHook(KStatusNotifierItem &systray) } } #endif +#endif +#ifdef Q_OS_WIN WindowsIndicatorHelper::WindowsIndicatorHelper() {} WindowsIndicatorHelper::~WindowsIndicatorHelper() {} @@ -190,3 +193,4 @@ void WindowsIndicatorHelper::systrayIconHook(KStatusNotifierItem &systray) Q_UNUSED(systray); } #endif +#endif diff --git a/indicator/indicatorhelper.h b/indicator/indicatorhelper.h index 46bdeb24f..b33196931 100644 --- a/indicator/indicatorhelper.h +++ b/indicator/indicatorhelper.h @@ -48,6 +48,7 @@ public: }; +#ifdef Q_OS_MAC class MacOSIndicatorHelper : public IndicatorHelper { public: @@ -68,8 +69,9 @@ public: private: QSplashScreen *m_splashScreen; }; +#endif - +#ifdef Q_OS_WIN class WindowsIndicatorHelper : public IndicatorHelper { public: @@ -84,3 +86,4 @@ public: void systrayIconHook(KStatusNotifierItem &systray); #endif }; +#endif