summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/kio-search-smbd-on-PATH.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches/kio-search-smbd-on-PATH.patch')
-rw-r--r--gnu/packages/patches/kio-search-smbd-on-PATH.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/gnu/packages/patches/kio-search-smbd-on-PATH.patch b/gnu/packages/patches/kio-search-smbd-on-PATH.patch
new file mode 100644
index 0000000000..47e20cfc0b
--- /dev/null
+++ b/gnu/packages/patches/kio-search-smbd-on-PATH.patch
@@ -0,0 +1,30 @@
+Adopted from NixOS
+pkgs/development/libraries/kde-frameworks/kio/samba-search-path.patch
+
+===================================================================
+--- kio-5.17.0.orig/src/core/ksambashare.cpp
++++ kio-5.17.0/src/core/ksambashare.cpp
+@@ -67,13 +67,18 @@ KSambaSharePrivate::~KSambaSharePrivate(
+
+ bool KSambaSharePrivate::isSambaInstalled()
+ {
+- if (QFile::exists(QStringLiteral("/usr/sbin/smbd"))
+- || QFile::exists(QStringLiteral("/usr/local/sbin/smbd"))) {
+- return true;
++ const QByteArray pathEnv = qgetenv("PATH");
++ if (!pathEnv.isEmpty()) {
++ QLatin1Char pathSep(':');
++ QStringList paths = QFile::decodeName(pathEnv).split(pathSep, QString::SkipEmptyParts);
++ for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) {
++ it->append("/smbd");
++ if (QFile::exists(*it)) {
++ return true;
++ }
++ }
+ }
+
+- //qDebug() << "Samba is not installed!";
+-
+ return false;
+ }
+