diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,11 +68,11 @@ WindowSystem IconThemes Notifications - Purpose WidgetsAddons ) find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS Activities + Purpose ) ## Dependencies diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -79,15 +79,18 @@ target_link_libraries(gwenview KF5::ItemModels KF5::Notifications - KF5::PurposeWidgets KF5::WidgetsAddons gwenviewlib ) if (KF5Activities_FOUND) target_link_libraries(gwenview KF5::Activities) endif() +if (KF5Purpose_FOUND) + target_link_libraries(gwenview KF5::PurposeWidgets) +endif() + target_link_libraries(gwenview LINK_INTERFACE_LIBRARIES KF5::KIOCore Qt5::Core) if (KF5Kipi_FOUND) diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -60,8 +60,10 @@ #include #include #include +#ifdef KF5Purpose_FOUND #include #include +#endif // Local #include "configdialog.h" @@ -200,8 +202,10 @@ QAction * mToggleSlideShowAction; KToggleAction* mShowMenuBarAction; KToggleAction* mShowStatusBarAction; +#ifdef KF5Purpose_FOUND Purpose::Menu* mShareMenu; KToolBarPopupAction* mShareAction; +#endif #ifdef KIPI_FOUND KIPIExportAction* mKIPIExportAction; #endif @@ -513,11 +517,13 @@ mKIPIExportAction = new KIPIExportAction(q); #endif +#ifdef KF5Purpose_FOUND mShareAction = new KToolBarPopupAction(QIcon::fromTheme("document-share"), "Share", q); mShareAction->setDelayed(false); actionCollection->addAction("share", mShareAction); mShareMenu = new Purpose::Menu(q); mShareAction->setMenu(mShareMenu); +#endif } void setupUndoActions() @@ -721,6 +727,7 @@ actionCollection->action("file_save_as")->setEnabled(canSave); actionCollection->action("file_print")->setEnabled(isRasterImage); +#ifdef KF5Purpose_FOUND if (url.isEmpty()) { mShareAction->setEnabled(false); } else { @@ -732,6 +739,7 @@ mShareMenu->model()->setPluginType( QStringLiteral("Export") ); mShareMenu->reload(); } +#endif } bool sideBarVisibility() const diff --git a/config-gwenview.h.cmake b/config-gwenview.h.cmake --- a/config-gwenview.h.cmake +++ b/config-gwenview.h.cmake @@ -7,3 +7,4 @@ #cmakedefine HAVE_FITS ${HAVE_FITS} #cmakedefine HAVE_QTDBUS ${HAVE_QTDBUS} #cmakedefine KF5Activities_FOUND 1 +#cmakedefine KF5Purpose_FOUND 1