From b6953843f5d84e806cdb8ecf50eb2ac58ee9e065 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 10 Feb 2020 15:25:45 +0900 Subject: Added back build options for UDISKS2, UDISKS and UDEVIL as requested by some users. Signed-off-by: Michele Calgaro --- tdeioslave/file/file.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tdeioslave') diff --git a/tdeioslave/file/file.cc b/tdeioslave/file/file.cc index c445230e6..fda72f2d5 100644 --- a/tdeioslave/file/file.cc +++ b/tdeioslave/file/file.cc @@ -1670,16 +1670,19 @@ void FileProtocol::unmount( const TQString& _point ) bool FileProtocol::pmount(const TQString &dev) { - TQString mountProg; + TQString mountProg = TQString::null; TQCString buffer; +#ifdef WITH_UDISKS2 // Use 'udisksctl' (UDISKS2) if available 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 +#ifdef WITH_UDISKS // Use 'udisks' (UDISKS1) if available if (mountProg.isEmpty()) { mountProg = TDEGlobal::dirs()->findExe("udisks"); @@ -1688,6 +1691,7 @@ bool FileProtocol::pmount(const TQString &dev) TQFile::encodeName(TDEProcess::quote(dev)).data() ); } } +#endif // Use 'pmount', if available if (mountProg.isEmpty()) { @@ -1731,16 +1735,19 @@ bool FileProtocol::pumount(const TQString &point) if (dev.isEmpty()) return false; if (dev.endsWith("/")) dev.truncate(dev.length()-1); - TQString umountProg; + TQString umountProg = TQString::null; TQCString buffer; +#ifdef WITH_UDISKS2 // Use 'udisksctl' (UDISKS2), if available 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 +#ifdef WITH_UDISKS // Use 'udisks' (UDISKS1), if available if (umountProg.isEmpty()) { umountProg = TDEGlobal::dirs()->findExe("udisks"); @@ -1749,6 +1756,7 @@ bool FileProtocol::pumount(const TQString &point) TQFile::encodeName(TDEProcess::quote(dev)).data() ); } } +#endif // Use 'pumount', if available if (umountProg.isEmpty()) { -- cgit v1.2.3