diff options
Diffstat (limited to 'kioslave/file')
-rw-r--r-- | kioslave/file/Makefile.am | 2 | ||||
-rw-r--r-- | kioslave/file/file.cc | 26 |
2 files changed, 27 insertions, 1 deletions
diff --git a/kioslave/file/Makefile.am b/kioslave/file/Makefile.am index 7cafcb339..0f26c723a 100644 --- a/kioslave/file/Makefile.am +++ b/kioslave/file/Makefile.am @@ -10,7 +10,7 @@ kde_module_LTLIBRARIES = kio_file.la kio_file_la_SOURCES = file.cc kio_file_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_KDECORE) $(ACL_LIBS) -kio_file_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) +kio_file_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) $(top_builddir)/dcop/libDCOP.la noinst_HEADERS = file.h fileinclude_HEADERS = file.h diff --git a/kioslave/file/file.cc b/kioslave/file/file.cc index 1fde27a81..441d03b98 100644 --- a/kioslave/file/file.cc +++ b/kioslave/file/file.cc @@ -69,6 +69,7 @@ #include <tqvaluelist.h> #include <tqregexp.h> +#include <dcopref.h> #include <kshred.h> #include <kdebug.h> #include <kurl.h> @@ -1617,6 +1618,31 @@ void FileProtocol::unmount( const TQString& _point ) #endif /* HAVE_VOLMGT */ err = testLogFile( tmp ); + + if (err.contains("fstab") || err.contains("root")) { + TQString olderr; + err = TQString::null; + + DCOPRef d("kded", "mediamanager"); + d.setDCOPClient ( dcopClient() ); + DCOPReply reply = d.call("properties", _point); + TQString udi; + + if ( reply.isValid() ) { + TQStringList list = reply; + if (list.size()) + udi = list[0]; + } + + if (!udi.isEmpty()) + reply = d.call("unmount", udi); + + if (udi.isEmpty() || !reply.isValid()) + err = olderr; + else if (reply.isValid()) + reply.get(err); + } + if ( err.isEmpty() ) finished(); else |