summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Riddell <jr@jriddell.org>2016-09-30 16:20:20 (GMT)
committerJonathan Riddell <jr@jriddell.org>2016-09-30 16:20:20 (GMT)
commitf6348c238db4004e5e576e4578daa93e93cb1716 (patch)
treedd3eab4f4399d30a0012e70a67d29062e591ae0b
parent1846dbcac72331e5804996cc4ec9b8529a24293a (diff)
test for ability to install with KIO::DesktopExecParser::hasSchemeHandler(()
-rw-r--r--CMakeLists.txt5
-rw-r--r--app/kipiinterface.cpp22
-rw-r--r--app/kipiinterface.h2
3 files changed, 10 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9c01898..82b219a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -103,11 +103,6 @@ if(X11_FOUND)
set(HAVE_X11 1)
endif()
-option(KIPI_INSTALLER "Build with Kipi Installer menu option (requires Plasma Discover or another handler for Appstream URLs" ON)
-if (KIPI_INSTALLER)
- add_definitions(-DKIPI_INSTALLER)
-endif()
-
configure_file(config-gwenview.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-gwenview.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
diff --git a/app/kipiinterface.cpp b/app/kipiinterface.cpp
index 785a523..2e885b8 100644
--- a/app/kipiinterface.cpp
+++ b/app/kipiinterface.cpp
@@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
#include <KXMLGUIFactory>
#include <KDirLister>
#include <KLocalizedString>
+#include <KIO/DesktopExecParser>
// KIPI
#include <kipi/imagecollectionshared.h>
@@ -339,21 +340,20 @@ void KIPIInterface::loadOnePlugin()
d->mPluginMenu->removeAction(d->mLoadingAction);
if (d->mPluginMenu->isEmpty()) {
d->mPluginMenu->addAction(d->mNoPluginAction);
-#ifdef KIPI_INSTALLER
- d->mPluginMenu->addAction(d->mInstallPluginAction);
- d->mInstallPluginAction->setEnabled(true);
- QObject::connect(d->mInstallPluginAction, SIGNAL(triggered(bool)),
- this, SLOT(slotInstallPlugins(bool)));
- d->mPluginWatcher = new QFileSystemWatcher(d->mMainWindow);
- d->mPluginWatcher->addPaths(QCoreApplication::libraryPaths());
- connect(d->mPluginWatcher, SIGNAL(directoryChanged(QString)), SLOT(packageFinished()));
-#endif
+ if (KIO::DesktopExecParser::hasSchemeHandler(QUrl("appstream://photolayoutseditor.desktop"))) {
+ d->mPluginMenu->addAction(d->mInstallPluginAction);
+ d->mInstallPluginAction->setEnabled(true);
+ QObject::connect(d->mInstallPluginAction, SIGNAL(triggered(bool)),
+ this, SLOT(slotInstallPlugins(bool)));
+ d->mPluginWatcher = new QFileSystemWatcher(d->mMainWindow);
+ d->mPluginWatcher->addPaths(QCoreApplication::libraryPaths());
+ connect(d->mPluginWatcher, SIGNAL(directoryChanged(QString)), SLOT(packageFinished()));
+ }
}
loadingFinished();
}
-#ifdef KIPI_INSTALLER
void KIPIInterface::slotInstallPlugins(bool checked) {
Q_UNUSED(checked);
QDesktopServices::openUrl(QUrl("appstream://photolayoutseditor.desktop"));
@@ -372,8 +372,6 @@ void KIPIInterface::packageFinished() {
QTimer::singleShot(5000, this, SLOT(loadPlugins()));
}
-#endif
-
QList<QAction*> KIPIInterface::pluginActions(KIPI::Category category) const
{
const_cast<KIPIInterface*>(this)->loadPlugins();
diff --git a/app/kipiinterface.h b/app/kipiinterface.h
index e3cf390..3ed50b2 100644
--- a/app/kipiinterface.h
+++ b/app/kipiinterface.h
@@ -89,10 +89,8 @@ public Q_SLOTS:
private Q_SLOTS:
void slotSelectionChanged();
void slotDirectoryChanged();
-#ifdef KIPI_INSTALLER
void slotInstallPlugins(bool checked);
void packageFinished();
-#endif
void init();
void loadOnePlugin();