summaryrefslogtreecommitdiffstats
path: root/tdeioslave/file
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2019-07-07 22:21:21 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2019-07-07 22:40:46 +0900
commit7214a7b6b590d62aac622dbf2de31b1ca1ba78d5 (patch)
treee63d5e40e1a2d4d4a8efb0990ebff10dcf163617 /tdeioslave/file
parentc76553c4fb3ee8f839c17b4dc3c3beb3c4338eb3 (diff)
downloadtdelibs-7214a7b6b590d62aac622dbf2de31b1ca1ba78d5.tar.gz
tdelibs-7214a7b6b590d62aac622dbf2de31b1ca1ba78d5.zip
tdehw: code restructuring for tdestoragedevice.
1. added disk helper source files 2. removed WITH_UDISKS2, WITH_UDISK, WITH_UDEVIL defines. The respective code is always included 3. order of execution for mount/umount activities: udisks2, udisk, udevil, pmount. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tdeioslave/file')
-rw-r--r--tdeioslave/file/file.cc32
1 files changed, 10 insertions, 22 deletions
diff --git a/tdeioslave/file/file.cc b/tdeioslave/file/file.cc
index ad1cc5574..45c482620 100644
--- a/tdeioslave/file/file.cc
+++ b/tdeioslave/file/file.cc
@@ -1668,18 +1668,13 @@ bool FileProtocol::pmount(const TQString &dev)
TQString mountProg;
TQCString buffer;
-#ifdef WITH_UDISKS2
// Use 'udisksctl' (UDISKS2) if available
- if (mountProg.isEmpty()) {
- mountProg = TDEGlobal::dirs()->findExe("udisksctl");
- if (!mountProg.isEmpty()) {
- buffer.sprintf( "%s mount -b %s", TQFile::encodeName(mountProg).data(),
- TQFile::encodeName(TDEProcess::quote(dev)).data() );
- }
- }
-#endif // WITH_UDISKS2
+ mountProg = TDEGlobal::dirs()->findExe("udisksctl");
+ if (!mountProg.isEmpty()) {
+ buffer.sprintf( "%s mount -b %s", TQFile::encodeName(mountProg).data(),
+ TQFile::encodeName(TDEProcess::quote(dev)).data() );
+ }
-#ifdef WITH_UDISKS
// Use 'udisks' (UDISKS1) if available
if (mountProg.isEmpty()) {
mountProg = TDEGlobal::dirs()->findExe("udisks");
@@ -1688,7 +1683,6 @@ bool FileProtocol::pmount(const TQString &dev)
TQFile::encodeName(TDEProcess::quote(dev)).data() );
}
}
-#endif // WITH_UDISKS
// Use 'pmount', if available
if (mountProg.isEmpty()) {
@@ -1735,18 +1729,13 @@ bool FileProtocol::pumount(const TQString &point)
TQString umountProg;
TQCString buffer;
-#ifdef WITH_UDISKS2
// Use 'udisksctl' (UDISKS2), if available
- if (umountProg.isEmpty()) {
- umountProg = TDEGlobal::dirs()->findExe("udisksctl");
- if (!umountProg.isEmpty()) {
- buffer.sprintf( "%s unmount -b %s", TQFile::encodeName(umountProg).data(),
- TQFile::encodeName(TDEProcess::quote(dev)).data() );
- }
- }
-#endif // WITH_UDISKS2
+ umountProg = TDEGlobal::dirs()->findExe("udisksctl");
+ if (!umountProg.isEmpty()) {
+ buffer.sprintf( "%s unmount -b %s", TQFile::encodeName(umountProg).data(),
+ TQFile::encodeName(TDEProcess::quote(dev)).data() );
+ }
-#ifdef WITH_UDISKS
// Use 'udisks' (UDISKS1), if available
if (umountProg.isEmpty()) {
umountProg = TDEGlobal::dirs()->findExe("udisks");
@@ -1755,7 +1744,6 @@ bool FileProtocol::pumount(const TQString &point)
TQFile::encodeName(TDEProcess::quote(dev)).data() );
}
}
-#endif // WITH_UDISKS
// Use 'pumount', if available
if (umountProg.isEmpty()) {