diff options
Diffstat (limited to 'tdeioslave')
-rw-r--r-- | tdeioslave/file/file.cc | 12 |
1 files changed, 10 insertions, 2 deletions
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()) { |