diff --git a/plugins/sftp/CMakeLists.txt b/plugins/sftp/CMakeLists.txt index 84e014dd2..746904867 100644 --- a/plugins/sftp/CMakeLists.txt +++ b/plugins/sftp/CMakeLists.txt @@ -1,3 +1,7 @@ +# Find fusermount -- otherwise fallback to umount +find_program(HAVE_FUSERMOUNT fusermount) +configure_file(config-sftp.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-sftp.h ) + find_package(KF5 REQUIRED COMPONENTS Notifications KIO) set(kdeconnect_sftp_SRCS diff --git a/plugins/sftp/config-sftp.h.cmake b/plugins/sftp/config-sftp.h.cmake new file mode 100644 index 000000000..0692c2699 --- /dev/null +++ b/plugins/sftp/config-sftp.h.cmake @@ -0,0 +1 @@ +#cmakedefine01 HAVE_FUSERMOUNT diff --git a/plugins/sftp/mounter.cpp b/plugins/sftp/mounter.cpp index c2e7d6dee..14114092d 100644 --- a/plugins/sftp/mounter.cpp +++ b/plugins/sftp/mounter.cpp @@ -27,6 +27,7 @@ #include #include "mountloop.h" +#include "config-sftp.h" #include "sftp_debug.h" #include "kdeconnectconfig.h" @@ -234,7 +235,11 @@ void Mounter::unmount(bool finished) m_proc->deleteLater(); //Free mount point (won't always succeed if the path is in use) +#if defined(HAVE_FUSERMOUNT) KProcess::execute(QStringList() << QStringLiteral("fusermount") << QStringLiteral("-u") << m_mountPoint, 10000); +#else + KProcess::execute(QStringList() << QStringLiteral("umount") << m_mountPoint, 10000); +#endif m_proc = nullptr; } m_started = false;