Bug 105771 - Using media-ioslave on local source(e.g. harddisk) gives message that it is not a local source
Summary: Using media-ioslave on local source(e.g. harddisk) gives message that it is n...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: kfile (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR major
Target Milestone: ---
Assignee: Carsten Pfeiffer
URL:
Keywords:
: 105851 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-16 16:49 UTC by Dennis Schridde
Modified: 2006-04-04 20:08 UTC (History)
5 users (show)

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 Dennis Schridde 2005-05-16 16:49:59 UTC
Version:            (using KDE KDE 3.4.0)
Installed from:    Gentoo Packages
Compiler:          gcc (GCC) 3.4.3-20050110 (Gentoo Linux 3.4.3.20050110-r2, ssp-3.4.3.20050110-0, pie-8.7.7)
OS:                Linux

When I use the "media:/LOCALHDD" URL in some apps(e.g. Kaffeine) I get the message that I only can select local files.
So perhaps there should be an attribute in the ioslave whether the selected device is local or not. Or "media:/" should be considered local in general.
I might be totaly wrong here, because I don't know the implementation of the slave and the bug might be in the apps giving me such messages.
Comment 1 Thiago Macieira 2005-05-17 06:24:15 UTC
There is such attribute, more or less. It's the apps that aren't querying for it.
Comment 2 Nicholas Allen 2005-05-18 00:18:08 UTC
I am seeing this too. How can it be the apps that aren't querying for it. Kaffeine and k3b both fail for me. Surely they just say they want a local file and this is a standard KDE message. This needs to get fixed - it's a terrible bug....
Comment 3 Thiago Macieira 2005-05-18 05:33:32 UTC
Are you seeing this in the file-open (or save) dialog box? If so, before or after the dialog disappears?
Comment 4 Kevin Ottens 2005-05-18 06:56:32 UTC
*** Bug 105851 has been marked as a duplicate of this bug. ***
Comment 5 Thiago Macieira 2005-05-18 07:00:12 UTC
Actually, this bug is valid. It's just not on kio/media.

Reopening.
Comment 6 Thiago Macieira 2005-05-18 07:01:05 UTC
KFileDialog::slotOk tests with d->url.isLocalFile. It has to use KIO to find mostLocalURL.
Comment 7 Kevin Ottens 2005-05-18 07:14:08 UTC
Well, currently I'm not sure it's the way to go. It has a kind of "pervert"
side effect. When you will open of file on media:/ the application will
receive a file:/ URL. Then, the user will see it in the application which is
not nice IMHO.

I've been discussing this kind of issue with David Faure recently. I'm trying
to find a solution, but it looks like will have to "port" applications to use
UDS_LOCAL_PATH in order to completely hide this implementation detail to the
user.
Comment 8 Nicholas Allen 2005-05-24 19:39:53 UTC
I'm seeing before the file open dialog is closed. It seems to be a feature in the file open dialog to request only local files. The file open dialog does not consider the media IO slave as local from what I gather by looking at the code.
Comment 9 Mohd Asif Ali Rizwaan 2005-06-10 22:01:47 UTC
because of this strange behavior, Media:/, which is a wonderful feature is un-usable upto now using "File Open" dialog. 

media:/ works perfectly in konqueror! open with->xmms/mplayer etc., work with media:/hda5 folder.

but openening from the application like codeine, k3b, kaffeine, etc. are real bothersome!

I'm eagerly waiting for the media:/ fix in 'File Open Dialog', thank you!
Comment 10 Thiago Macieira 2005-09-27 02:58:56 UTC
Kévin: how about a new setting in KFileDialog saying it's ok to return media:/ URLs in local file-only contexts, as well as adding a new static method for the dialog?

We'd then have 3 modes:
1) file:/-only allowed; KFileDialog accepts URLs such as media:/ and autoconverts to file:/ (it's better to show the system path than to get an error)
2) any local accepted, for new apps/releases only
3) any URL accepted, including remote ones

I'm raising the severity because I think this can and should be fixed before 3.5 is released. The problem is there is a big number of applications to port from mode #1 to mode #2.
Comment 11 Patrice Tremblay 2005-11-23 21:42:24 UTC
This is more or less the same thing as Bug 110951.
Comment 12 Frederik Himpe 2006-01-09 22:41:52 UTC
I guess this bug is why KDE starts copying the whole file if you double click on an MPEG-file on a cd-rom which you opened using the mediamanager window that pops up automatically when inserint a cd-rom? Similar problems exist for the home:/ ioslave by the way. These ioslaves should always use URIs of the type file:/ whenever possible when interacting with external programs.
Comment 13 Mohd Asif Ali Rizwaan 2006-01-29 07:25:38 UTC
please make "Open Medium System Folder" behavior as default (configurable at kded kcontrol module) which will solve the annoying "not local media" errors and allow seamless playback with xine, gmplayer, etc., without copying the whole media (.txt, .mpg, .mp3, etc.) file to $HOME :(
Comment 14 Doncho N. Gunchev 2006-01-31 16:34:30 UTC
I second the "system folder as default" option request.
Comment 15 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;
             }
         }