Bug 132523 - MountHelper doesn't resolve symlinks to devices, yielding in broken behaviour
Summary: MountHelper doesn't resolve symlinks to devices, yielding in broken behaviour
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: media (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Kevin Ottens
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-17 00:08 UTC by Carsten Lohrke
Modified: 2006-11-01 20:05 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carsten Lohrke 2006-08-17 00:08:23 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    Gentoo Packages

Given: /dev/cdrom -> hdc

dcop kded mediamanager properties /dev/cdrom

results in an emtpy line, while 

dcop kded mediamanager properties /dev/hdc

results in

/org/freedesktop/Hal/devices/volume_empty_dvd_plus_r
hdc
Blank DVD+R

false
/dev/hdc


false

media/blankdvd




Stumbled about this via https://bugs.gentoo.org/show_bug.cgi?id=143345
Comment 1 Fathi Boudra 2006-11-01 20:05:49 UTC
SVN commit 601032 by fabo:

BUG: 132523

mediamanager followsymlinks (approved by Kevin Ottens)

* MediaManager::properties() follows symlinks on local paths.

Thanks to Modestas Vainius



 M  +6 -2      mediamanager.cpp  


--- branches/KDE/3.5/kdebase/kioslave/media/mediamanager/mediamanager.cpp #601031:601032
@@ -26,6 +26,7 @@
 #include <klocale.h>
 
 #include <kdirnotify_stub.h>
+#include <kstandarddirs.h>
 
 #include "mediamanagersettings.h"
 
@@ -162,10 +163,13 @@
                 QPtrList<Medium> list = m_mediaList.list();
                 QPtrList<Medium>::const_iterator it = list.begin();
                 QPtrList<Medium>::const_iterator end = list.end();
+                QString path;
+
                 for (; it!=end; ++it)
                 {
-                    kdDebug() << "comparing " << (*it)->mountPoint()  << " " << u.path() << " " <<  (*it)->deviceNode() << endl;
-                    if ((*it)->mountPoint() == u.path() || (*it)->deviceNode() == u.path()) {
+                    path = KStandardDirs::realFilePath(u.path());
+                    kdDebug() << "comparing " << (*it)->mountPoint()  << " " << path << " " <<  (*it)->deviceNode() << endl;
+                    if ((*it)->mountPoint() == path || (*it)->deviceNode() == path) {
 			m = *it;
 			break;
                     }