From 7214a7b6b590d62aac622dbf2de31b1ca1ba78d5 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 7 Jul 2019 22:21:21 +0900 Subject: 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 --- tdeioslave/file/file.cc | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) (limited to 'tdeioslave') 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()) { -- cgit v1.2.1