Paste P474

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Oct 1 2019, 1:43 PM.
commit dd1d97a91bec1d7f3468028f79530c0a6f4cf48d (HEAD -> master, valve/master)
Author: David Edmundson <kde@davidedmundson.co.uk>
Date: Tue Oct 1 14:28:29 2019 +0100
install kio-fuse helper, set correct path
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 97d1a9b..4129d31 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,6 +46,9 @@ ecm_qt_declare_logging_category(KIOFUSE_SOURCES
qt5_add_dbus_interface( KIOFUSE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/kded/org.kde.KIOFuse.xml kiofuse_interface )
+configure_file(config.h.in config.h @ONLY)
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
add_executable(kio-fuse ${KIOFUSE_SOURCES})
target_include_directories(kio-fuse PRIVATE ${FUSE3_INCLUDE_DIRS})
target_compile_definitions(kio-fuse PRIVATE FUSE_USE_VERSION=31 ${FUSE3_CFLAGS_OTHER})
@@ -53,3 +56,5 @@ target_link_libraries(kio-fuse PRIVATE Qt5::Core KF5::KIOCore KF5::DBusAddons ${
add_subdirectory(kded)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
+
+install(TARGETS kio-fuse DESTINATION ${KDE_INSTALL_FULL_LIBEXECDIR})
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..b9d1d07
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,3 @@
+#pragma once
+
+#define KIO_FUSE_BIN "@KDE_INSTALL_FULL_LIBEXECDIR@/kio-fuse"
diff --git a/kded/kded.cpp b/kded/kded.cpp
index 91723c3..53750dd 100644
--- a/kded/kded.cpp
+++ b/kded/kded.cpp
@@ -32,6 +32,8 @@
#include <KPluginFactory>
#include <KPluginLoader>
+#include "../config.h"
+
K_PLUGIN_FACTORY_WITH_JSON(KIOFuseFactory,
"kiofuse.json",
registerPlugin<KIOFuse>();)
@@ -46,7 +48,7 @@ KIOFuse::KIOFuse(QObject *parent, const QList<QVariant> &parameters)
QProcess proc;
proc.start(QStringLiteral("fusermount"), {QStringLiteral("-zu"), m_mountDir});
proc.waitForFinished(1000);
- proc.start(QStringLiteral("kio-fuse"), {m_mountDir});
+ proc.start(QStringLiteral(KIO_FUSE_BIN), {m_mountDir});
// TODO: Find out the timeout KIO uses for establishing a connection and use that number instead.
proc.waitForFinished(1000);
m_controlFile.setFileName(m_mountDir + QStringLiteral("/_control"));
davidedmundson edited the content of this paste. (Show Details)Oct 1 2019, 1:43 PM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.
davidedmundson edited the content of this paste. (Show Details)Oct 1 2019, 1:46 PM