Bug 92614 - "kdialog --getsavefilename ftp://user@host.name/foo.txt" doesn't return any file name
Summary: "kdialog --getsavefilename ftp://user@host.name/foo.txt" doesn't return any f...
Status: RESOLVED FIXED
Alias: None
Product: kdialog
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-03 01:47 UTC by Jens
Modified: 2004-11-03 17:40 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens 2004-11-03 01:47:11 UTC
Version:            (using KDE KDE 3.3.1)
Installed from:    SuSE RPMs
OS:                Linux

Call e.g.

kdialog --getsavefilename ftp://user@server.whatever/asdflkjsdfsd.txt

kdialog will login to the FTP server and display a list of files with the default being the "asdflkjsdfsd.txt". But on the console, it will also print out

kio (KDirWatch): WARNING: KDirWatch::removeDir can't handle '/'

and if I press ENTER in kdialog it will return NO FILE NAME at all.

This seems like a bug :) please test.

Thanks!
Comment 1 David Faure 2004-11-03 11:57:36 UTC
>            Summary: "kdialog --getsavefilename ftp://user host name/foo txt"
>                     doesn't return any file name

getsavefilename is for local paths only.
If you application supports URLs, use --getsaveurl.

Comment 2 Jens 2004-11-03 15:09:21 UTC
Am Mittwoch, 3. November 2004 11:57 schrieb David Faure:

> getsavefilename is for local paths only.
> If you application supports URLs, use --getsaveurl.

Hi David,

OK ... but why the distinction, what is the advantage of kdialog making a 
difference between local and remote paths when all the IOslaves try to 
hide exactly this difference ("network transparency")?


Comment 3 David Faure 2004-11-03 15:57:19 UTC
On Wednesday 03 November 2004 15:09, Jens B.Benecke wrote:
> OK ... but why the distinction, what is the advantage of kdialog making a 
> difference between local and remote paths when all the IOslaves try to 
> hide exactly this difference ("network transparency")?

Some applications only work with local files - e.g. non-kde apps, which you might
give the result of kdialog --getsavefilename to. Or maybe your shellscript saves to
that file directly, not using kio.

Comment 4 Jens 2004-11-03 16:48:47 UTC
Am Mittwoch, 3. November 2004 15:57 schrieb David Faure:

> Some applications only work with local files - e.g. non-kde apps, which
> you might give the result of kdialog --getsavefilename to. Or maybe your
> shellscript saves to that file directly, not using kio.

Thanks for the reply!
Then (IMHO) kdialog should complain as soon as the user types in a remote 
location, and not silently fail after the user pressed OK.


Comment 5 David Faure 2004-11-03 17:38:26 UTC
On Wednesday 03 November 2004 16:48, Jens B.Benecke wrote:
> Thanks for the reply!
> Then (IMHO) kdialog should complain as soon as the user types in a remote 
> location, and not silently fail after the user pressed OK.

Right.

Comment 6 David Faure 2004-11-03 17:40:35 UTC
CVS commit by faure: 

Warn the user when getSaveFileName was called and he chooses on a remote file.
This warning msgbox is already in another place in that file, but that's not used
when clicking on items (as opposed to typing a url).
BUG: 92614


  M +5 -0      kfiledialog.cpp   1.382


--- kdelibs/kio/kfile/kfiledialog.cpp  #1.381:1.382
@@ -1539,4 +1539,9 @@ QString KFileDialog::selectedFile() cons
        if (d->url.isLocalFile())
            return d->url.path();
+       else {
+           KMessageBox::sorry( d->mainWidget,
+                               i18n("You can only select local files."),
+                               i18n("Remote Files Not Accepted") );
+       }
     }
     return QString::null;