Bug 106077 - Removable media links do not work
Summary: Removable media links do not work
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: kfile (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Carsten Pfeiffer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-21 21:46 UTC by adam
Modified: 2006-04-04 20:08 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 adam 2005-05-21 21:46:30 UTC
Version:            (using KDE KDE 3.4.0)
Installed from:    SuSE RPMs
OS:                Linux

When going to save a document from an application such as Open Office or Koffice Konqueror pops up a window to ask you where to save it to. If you use Konqueror's "Removable Media" link on the left it will error out and you will not be able to save the document (the link to any of the removiable media e.g. Floppy or USB Drive). There are work-arounds, but many of our clients want to be able to click the little "removable media" icon instead of manually saving it to a floppy or USB flash drive.
Comment 1 Ismail Donmez 2006-04-04 20:08:49 UTC
SVN commit 526455 by cartman:

teach KFileDialog about media:/ and system:/
BUG: 105771
BUG: 106077
CCMAIL: 123527



 M  +13 -7     kfiledialog.cpp  


--- branches/KDE/3.5/kdelibs/kio/kfile/kfiledialog.cpp #526454:526455
@@ -402,8 +402,9 @@
             }
         }
 
+        KURL url = KIO::NetAccess::mostLocalURL(d->url,topLevelWidget());
         if ( (mode() & KFile::LocalOnly) == KFile::LocalOnly &&
-             !d->url.isLocalFile() ) {
+             !url.isLocalFile() ) {
 // ### after message freeze, add message for directories!
             KMessageBox::sorry( d->mainWidget,
                                 i18n("You can only select local files."),
@@ -411,6 +412,7 @@
             return;
         }
 
+        d->url = url;
         accept();
         return;
     }
@@ -444,15 +446,16 @@
        return;
     }
 
+    KURL url = KIO::NetAccess::mostLocalURL(selectedURL,topLevelWidget());
     if ( (mode() & KFile::LocalOnly) == KFile::LocalOnly &&
-         !selectedURL.isLocalFile() ) {
+         !url.isLocalFile() ) {
         KMessageBox::sorry( d->mainWidget,
                             i18n("You can only select local files."),
                             i18n("Remote Files Not Accepted") );
         return;
     }
 
-    d->url = selectedURL;
+    d->url = url;
 
     // d->url is a correct URL now
 
@@ -1536,8 +1539,9 @@
 {
     if ( result() == QDialog::Accepted )
     {
-       if (d->url.isLocalFile())
-           return d->url.path();
+      KURL url = KIO::NetAccess::mostLocalURL(d->url,topLevelWidget());
+       if (url.isLocalFile())
+           return url.path();
        else {
            KMessageBox::sorry( d->mainWidget,
                                i18n("You can only select local files."),
@@ -1550,14 +1554,16 @@
 QStringList KFileDialog::selectedFiles() const
 {
     QStringList list;
+    KURL url;
 
     if ( result() == QDialog::Accepted ) {
         if ( (ops->mode() & KFile::Files) == KFile::Files ) {
             KURL::List urls = parseSelectedURLs();
             QValueListConstIterator<KURL> it = urls.begin();
             while ( it != urls.end() ) {
-                if ( (*it).isLocalFile() )
-                    list.append( (*it).path() );
+              url = KIO::NetAccess::mostLocalURL(*it,topLevelWidget());
+                if ( url.isLocalFile() )
+                    list.append( url.path() );
                 ++it;
             }
         }