Bug 115380 - KFileFilter can make file dialog too wide
Summary: KFileFilter can make file dialog too wide
Status: RESOLVED DUPLICATE of bug 163456
Alias: None
Product: kfile
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-30 16:36 UTC by Raphael Wegmann
Modified: 2009-08-27 04:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
this patch doesn't fix the bug (551 bytes, patch)
2005-11-03 00:02 UTC, Raphael Wegmann
Details
patched version of the file dialog (50.01 KB, image/png)
2005-11-03 10:42 UTC, Raphael Wegmann
Details
this patch fixes the bug (really :) (575 bytes, patch)
2005-11-03 12:41 UTC, Raphael Wegmann
Details
patched file dialog in kword (45.23 KB, image/png)
2005-11-24 17:25 UTC, David Faure
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Wegmann 2005-10-30 16:36:31 UTC
Version:            (using KDE KDE 3.4.3)
Installed from:    SuSE RPMs
OS:                Linux

As you can see here

http://www.openoffice.org/nonav/issues/showattachment.cgi/31018/image-file-dialog.png

The file-dialog can get too wide (doesn't fit on screen), 
if there are too many filters defined. The problem doesn't
exists on the gnome file-dialog.
Comment 1 Nicolas Goutte 2005-10-30 20:50:10 UTC
Do you have the original issue number of OpenOffice.org?

As for the problem, I suppose that somehow one of the squeeze functions of the class KStringHandler must be used. (See KBabel's bug #115296, which is a bout a non-editable QComboBox with a similar problem.)

(By the way, if you are the reporter, you do not need to added yourself again in the CC list.)

Have a nice day!
Comment 2 Raphael Wegmann 2005-10-31 01:09:35 UTC
The original OpenOffice issue can be found at:
http://www.openoffice.org/issues/show_bug.cgi?id=56972

So who do you think has to call KStringHandler::csqueeze()?
The visual class developers of OpenOffice or is it a bug
in KDEs kfile class? Both?
Comment 3 Nicolas Goutte 2005-10-31 20:58:02 UTC
On Monday 31 October 2005 01:09, wegmann@psi.co.at wrote:
(...)
> http://www.openoffice.org/issues/show_bug.cgi?id=56972


Thank you!

>
> So who do you think has to call KStringHandler::csqueeze()?
> The visual class developers of OpenOffice or is it a bug
> in KDEs kfile class? Both?


I would say that the KDE file dialog was not meant for such a long extension 
list. So at least there is a bug there, as the file dialog should avoid 
overwide filter entries.

However I do not think that it will be done for KDE3, as for example KOffice 
is making dirty tricks with the filter list, so I suppose that, internally, 
we cannot have suddenly two filter lists: a list with the long uncensored 
filter names and a list of squeezed filter names.

So until KDE supports the needed feature, I would think that OOo should avoid 
to create such wide entries.

Have a nice day!
Comment 4 Raphael Wegmann 2005-11-01 04:13:38 UTC
Isn't it possible to simply set a maximum width for the KComboBox (KFileFilter)?
That has a bad side-effect: If someone adds a filter line that won't fit, nobody would be able to read the whole line. But I think that's better, than to have a file-dialog that won't fit on your screen.
Comment 5 Nicolas Goutte 2005-11-01 16:40:15 UTC
On Tuesday 01 November 2005 04:13, wegmann@psi.co.at wrote:
(...)
> Isn't it possible to simply set a maximum width for the KComboBox
> (KFileFilter)?


I had tried to find that for the list box but I have no idea how to do it.
(However I am not an expert in the UI side of Qt.)

> That has a bad side-effect: If someone adds a filter line
> that won't fit, nobody would be able to read the whole line. 


Yes, but KDE has normally no such long line, as we only display to the user a 
generic text and not all the extensions.

> But I think
> that's better, than to have a file-dialog that won't fit on your screen.

Comment 6 Raphael Wegmann 2005-11-03 00:02:48 UTC
Created attachment 13255 [details]
this patch doesn't fix the bug

Here is a fix for this bug.
It's a diff to the SuSE 10.0 kdelibs3-3.4.2-24 package (Level "b").
Comment 7 Nicolas Goutte 2005-11-03 01:08:41 UTC
On Thursday 03 November 2005 00:02, wegmann@psi.co.at wrote:
(...)
>  --> (http://bugs.kde.org/attachment.cgi?id=13255&action=view)
> this patch fixes the bug
>
> Here is a fix for this bug.
> It's a diff to the SuSE 10.0 kdelibs3-3.4.2-24 package (Level "b").


I cannot test the patch right now. But I fear that used that way, the user 
cannot increase the width of the dialog as he wants.

Have a nice day!
Comment 8 Raphael Wegmann 2005-11-03 10:42:29 UTC
Created attachment 13263 [details]
patched version of the file dialog

Well ... my patch breaks the layout somewhat.
The OK and Cancel buttons - as well as the preview checkbox - 
are no longer visible (and can't be made visible through resizing). 
:-(

Besides maximumWidth has to be set to some reasonable value.
Comment 9 Raphael Wegmann 2005-11-03 12:41:38 UTC
Created attachment 13264 [details]
this patch fixes the bug (really :)

Calling setMaximumWidth(600) in the constructor of the KFileFilterCombo class
fixes the problem.
Comment 10 Carsten Pfeiffer 2005-11-03 22:02:05 UTC
Something like 
setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ));
would be more appropriate.
Comment 11 Raphael Wegmann 2005-11-03 23:33:05 UTC
I don't understand, why I would want to set the horizontal SizePolizy::Expanding,
when the expanding KComboBox is actually the problem here. The solution (apart 
from the OO people to set a reasonable file-filter) is IMHO to set a maximumWidth,
so the KFileFilter doesn't get larger than my screen (1280x1024).
Comment 12 David Faure 2005-11-24 17:25:08 UTC
Created attachment 13635 [details]
patched file dialog in kword

I object to this patch; it gives a strange layout when the user makes the file
dialog larger so that the location and filter combos can use more than 600
pixels.
Any hardcoded value is wrong anyway; it would be a better idea to use the
desktop size. And setting the max size on both combos would avoid the strange
effect in my screenshot... but even then, this doesn't feel like the right
solution.

I don't understand why the OOo code sets all those extensions in the
*description* of the filter... KFileDialog certainly allows to use extensions
without showing them in the description, why not just filter out the extensions
from the description?
Comment 13 Nicolas Goutte 2005-11-24 18:06:17 UTC
On Thursday 24 November 2005 17:25, David Faure wrote:
(...)

> KFileDialog certainly allows to use
> extensions without showing them in the description, why not just filter out
> the extensions from the description?


I had the same idea too but I have not told it because I could not much see 
the impact on translations.

Have nice day!
Comment 14 Ray Clark 2007-02-24 18:16:09 UTC
I cannot vouch for the source of the problem (kfilter...), but as a symptom, this problem is not isolated to open office as seems to be the thinking from reading the log.  I get this from konqueror (for example reading/printing this page), or double clicking on a 10 line text file (named xxx.txt) and file/print ing it.

I would be happy to try things, or send you information if you feed me things to do.  It does this reliably - every time.  webclark at rochester dot rr dot com
Comment 15 Ray Clark 2007-02-24 18:18:01 UTC
I forgot to include... I am running Suse 10.2, kde 3.5.5 "release 45"
Comment 16 Ray Clark 2007-02-24 18:20:57 UTC
Nevermind... 139866 is a duplicate and directly addresses the suse 10.2 problem.
Comment 17 Christoph Feck 2009-08-27 02:36:49 UTC
Moving from "kio/kfile" component to "kfile" product, helps sorting out duplicates.
Comment 18 Christoph Feck 2009-08-27 04:19:37 UTC

*** This bug has been marked as a duplicate of bug 163456 ***