[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdebase/kioslave/media
From:       Stephan Kulow <coolo () kde ! org>
Date:       2007-05-08 12:48:08
Message-ID: 1178628488.626296.15685.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 662500 by coolo:

make sure we unmount the device before we even try to 
eject - and give correct error message if the device is busy
BUG: 143353


 M  +7 -7      mediamanager/halbackend.cpp  
 M  +9 -5      mounthelper/kio_media_mounthelper.cpp  


--- branches/KDE/3.5/kdebase/kioslave/media/mediamanager/halbackend.cpp #662499:662500
@@ -1037,14 +1037,14 @@
         QString proclist(listUsingProcesses(medium));
 
         qerror = "<qt>";
-        qerror += i18n("Unfortunately, the device <b>%1</b> (%2) named <b>'%3'</b> and "
+        qerror += "<p>" + i18n("Unfortunately, the device <b>%1</b> (%2) named <b>'%3'</b> and "
                        "currently mounted at <b>%4</b> could not be unmounted. ").arg(
                           "system:/media/" + medium->name(),
                           medium->deviceNode(),
                           medium->prettyLabel(),
-                          medium->prettyBaseURL().pathOrURL());
-        qerror += i18n("The following error was returned by umount command:");
-        qerror += "<br><pre>" + job->errorText() + "</pre>";
+                          medium->prettyBaseURL().pathOrURL()) + "</p>";
+        qerror += "<p>" + i18n("The following error was returned by umount command:");
+        qerror += "</p><pre>" + job->errorText() + "</pre>";
 
         if (!proclist.isEmpty()) {
             qerror += proclist;
@@ -1273,13 +1273,13 @@
 
         kdDebug() << "unmount failed for " << udi << ": " << error.name << " " << error.message << endl;
         qerror = "<qt>";
-        qerror += i18n("Unfortunately, the device <b>%1</b> (%2) named <b>'%3'</b> and "
+        qerror += "<p>" + i18n("Unfortunately, the device <b>%1</b> (%2) named <b>'%3'</b> and "
                        "currently mounted at <b>%4</b> could not be unmounted. ").arg(
                           "system:/media/" + medium->name(),
                           medium->deviceNode(),
                           medium->prettyLabel(),
-                          medium->prettyBaseURL().pathOrURL());
-        qerror += i18n("Unmounting failed due to the following error:");
+                          medium->prettyBaseURL().pathOrURL()) + "</p>";
+        qerror += "<p>" + i18n("Unmounting failed due to the following error:") + "</p>";
         if (!strcmp(error.name, "org.freedesktop.Hal.Device.Volume.Busy")) {
             reason = i18n("Device is Busy:");
         } else if (!strcmp(error.name, "org.freedesktop.Hal.Device.Volume.NotMounted")) {
--- branches/KDE/3.5/kdebase/kioslave/media/mounthelper/kio_media_mounthelper.cpp #662499:662500
@@ -117,10 +117,14 @@
 			DCOPRef mediamanager("kded", "mediamanager");
 			DCOPReply reply = mediamanager.call( "unmount", medium.id());
 			if (reply.isValid())
-			reply.get(m_errorStr);
+                            reply.get(m_errorStr);
+                        if (m_errorStr.isNull())
+                            invokeEject(device, true);
+                        else
+                            error();
 			m_device = device;
-		}
-		invokeEject(device, true);
+		} else
+                    invokeEject(device, true);
 	}
 	else
 	{
@@ -130,7 +134,7 @@
 	    reply.get(m_errorStr);
 	  if (m_errorStr.isNull())
 	    ::exit(0);
-	  else 
+	  else
 	    error();
 	}
 }
@@ -201,5 +205,5 @@
 	app->dcopClient()->attach();
 	return app->exec();
 }
- 
+
 #include "kio_media_mounthelper.moc"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic