[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Bug#4601: marked as done (KFileDialog & not existing files)
From:       owner () bugs ! kde ! org (Stephan Kulow)
Date:       2000-06-29 13:33:03
[Download RAW message or body]

Your message dated Thu, 29 Jun 2000 15:18:54 +0200
with message-id <395B4CBE.C93FCA5A@bigfoot.com>
and subject line KFileDialog & not existing files
has caused the attached bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I'm
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Stephan Kulow
(administrator, KDE bugs database)

Received: (at submit) by bugs.kde.org; 6 Jun 2000 18:59:09 +0000
From gebauer@bigfoot.com Tue Jun  6 20:59:09 2000
Received: from sun.rhrk.uni-kl.de ([131.246.137.50]:36748 "HELO
        sun.rhrk.uni-kl.de") by master.kde.org with SMTP id <S742516AbQFFS6c>;
        Tue, 6 Jun 2000 20:58:32 +0200
Received: from aixs1.rhrk.uni-kl.de
           ( exim@aixs1.rhrk.uni-kl.de [131.246.137.3] ) by sun.rhrk.uni-kl.de
          id aa21132 for <submit@bugs.kde.org>; 6 Jun 2000 20:58 MESZ
Received: from rotes56.wohnheim.uni-kl.de ([131.246.177.65] helo=bigfoot.com)
        by aixs1.rhrk.uni-kl.de with esmtp (Exim 3.03 #2)
        id 12zOYS-0005qC-00
        for submit@bugs.kde.org; Tue, 06 Jun 2000 20:58:24 +0200
Sender: christian@sun.rhrk.uni-kl.de
Message-ID: <393D49A0.85317FEF@bigfoot.com>
Date:   Tue, 06 Jun 2000 20:57:36 +0200
From:   Christian Gebauer <gebauer@bigfoot.com>
X-Mailer: Mozilla 4.73 [en] (X11; I; Linux 2.2.14 i686)
X-Accept-Language: en
MIME-Version: 1.0
To:     submit@bugs.kde.org
Subject: KFileDialog & not existing files
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <gebauer@bigfoot.com>
X-Orcpt: rfc822;submit@bugs.kde.org

Package: kdelibs
Version: Current CVS (06062000)

Both KFileDialog::getSaveFileName(const QString& url= QString::null ...)
and
KFileDialog::setSelection (const QString& name) do strange things
when url/name don't point to a existing file.

Example: The user wants to save the attached file "foo.jpg" to disk, so
we call KFileDialog::getSaveFileName("foo.jpg","*"). If a file "foo.jpg"
exists in the current directory, everything is fine, the current 
directory is displayed in the upper combobox and the "Location"
combobox reads "foo.jpg", so the user can just click on OK.
If the file doesn't exist, the KFileDialog seems to think that it is a
directory, because the upper combobox contains now: 
"/home/christian/foo.jpg/"
                        ^
and the location combobox is empty. Same behaviour when I use
setSelection()
manually.

Possibly backtrace of the bug:

kfiledialog.cpp, line 870, KFileDialog::setSelection:
KFileViewItem i(-1, -1, u, true );

    //    KFileViewItem i(u.path());
    if (i.isDir())
	setURL(u, true);
    else {
	QString filename = u.url();
	int sep = filename.findRev('/');
	if (sep >= 0) { // there is a / in it
	    setURL(filename.left(sep), true);
	    filename = filename.mid(sep+1, filename.length() - sep);
	    kdDebug(kfile_area) << "filename " << filename << endl;
	    d->selection = filename;
	    locationEdit->setCurrentItem( 0 );
	    locationEdit->setEditText( filename );
	}
	d->url = KURL(ops->url(), filename); // FIXME make filename an url
    }

The KFileViewItem seems to say that the file points to a directory,
because
otherwise the location-box would be filled here.

In kfileitem.cpp the return values of stat()/lstat() / errno are never
checked, which is, according to my man pages, the way to detect a not
existing
file (ENOENT/ENOTDIR). ;-(
Perhaps this is causing the problem?

Greetings, 
Christian
-- 
>><< Christian Gebauer >><< gebauer@bigfoot.com >><< ICQ 14916141 >><<
 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic