--- kdelibs-3.2/kio/kio/kmimetype.cpp-- 2004-03-12 19:45:54.000000000 +0100 +++ kdelibs-3.2/kio/kio/kmimetype.cpp 2004-03-12 19:48:51.000000000 +0100 @@ -30,6 +30,8 @@ #include <unistd.h> #include <stdlib.h> +#include <kmountpoint.h> + #include <kprotocolinfo.h> #include <kio/global.h> #include "kmimetype.h" @@ -684,8 +686,24 @@ QString KDEDesktopMimeType::icon( const if ( !icon.isEmpty() && !unmount_icon.isEmpty() && !dev.isEmpty() ) { QString mp = KIO::findDeviceMountPoint( dev ); - // Is the device not mounted ? + bool mbSupermount = false; if ( mp.isNull() ) + { + + KMountPoint::List mountPoints = KMountPoint::currentMountPoints(); + for(KMountPoint::List::ConstIterator it = mountPoints.begin(); + it != mountPoints.end(); ++it) + { + if( (*it)->mountType()=="supermount" && ((*it)->mountedFrom()==dev)) + { + mbSupermount = true; + break; + } + } + } + + // Is the device not mounted ? + if ( mp.isNull() && !mbSupermount ) return unmount_icon; } } @@ -784,6 +802,19 @@ pid_t KDEDesktopMimeType::runFSDevice( c } QString mp = KIO::findDeviceMountPoint( dev ); + if ( mp.isNull() ) + { + KMountPoint::List mountPoints = KMountPoint::currentMountPoints(); + for(KMountPoint::List::ConstIterator it = mountPoints.begin(); + it != mountPoints.end(); ++it) + { + if( (*it)->mountType()=="supermount" && ((*it)->mountedFrom()==dev)) + { + mp = (*it)->mountPoint(); + break; + } + } + } // Is the device already mounted ? if ( !mp.isNull() ) { @@ -884,6 +915,22 @@ QValueList<KDEDesktopMimeType::Service> else { QString mp = KIO::findDeviceMountPoint( dev ); + bool mbSupermount = false; + if ( mp.isEmpty() ) + { + KMountPoint::List mountPoints = KMountPoint::currentMountPoints(); + for(KMountPoint::List::ConstIterator it = mountPoints.begin(); + it != mountPoints.end(); ++it) + { + if( (*it)->mountType()=="supermount" && ((*it)->mountedFrom()==dev)) + { + mbSupermount = true; + break; + } + } + } + if( !mbSupermount ) + { // not mounted ? if ( mp.isEmpty() ) { @@ -908,7 +955,7 @@ QValueList<KDEDesktopMimeType::Service> } } } - + } return result; }