From c10124c96557042d5a9c0170dd2883557997be3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 23 Jan 2016 04:41:59 +0100 Subject: Fix using of custom mountpoints with pmount in tdehwlib This partially resolves Bug 2576 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- tdecore/tdehw/tdestoragedevice.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tdecore') diff --git a/tdecore/tdehw/tdestoragedevice.cpp b/tdecore/tdehw/tdestoragedevice.cpp index e095b9ba1..38907df79 100644 --- a/tdecore/tdehw/tdestoragedevice.cpp +++ b/tdecore/tdehw/tdestoragedevice.cpp @@ -1190,10 +1190,21 @@ TQString TDEStorageDevice::mountDevice(TQString mediaName, TDEStorageMountOption optionString.append(TQString(" -c %1").arg(mountOptions["locale"])); } + TQString mountpoint; + if (mountOptions.contains("mountpoint") + && !mountOptions["mountpoint"].isEmpty() + && (mountOptions["mountpoint"] != "/media/")) { + mountpoint = mountOptions["mountpoint"]; + mountpoint.replace("'", "'\\''"); + } + else { + mountpoint = mediaName; + } + TQString passFileName = passwordFile.name(); passFileName.replace("'", "'\\''"); - command = TQString("pmount -p '%1' %2 '%3' '%4' 2>&1").arg(passFileName).arg(optionString).arg(devNode).arg(mediaName); + command = TQString("pmount -p '%1' %2 '%3' '%4' 2>&1").arg(passFileName).arg(optionString).arg(devNode).arg(mountpoint); } } -- cgit v1.2.1