Bug 267581 - Dialog window "create new fodler-file" don't have "clear name" button
Summary: Dialog window "create new fodler-file" don't have "clear name" button
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.12.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Peter Penz
URL:
Keywords: investigated, reproducible
: 266720 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-03 20:54 UTC by Anthony Renoux
Modified: 2011-03-21 22:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.6.2


Attachments
Dialog box when you create a new folder (19.60 KB, image/png)
2011-03-03 20:54 UTC, Anthony Renoux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Renoux 2011-03-03 20:54:29 UTC
Created attachment 57654 [details]
Dialog box when you create a new folder

Version:           unspecified (using KDE 4.6.0) 
OS:                Linux

When you create a new folder or file in dolphin, there no "clear button" to remove text in the dialog box.In KDE SC 4.5, the button is not show but work when you click on the rigth of the dialog box.
Dialog box should be like in the attachment.


Reproducible: Always
Comment 1 Frank Reininghaus 2011-03-08 23:47:06 UTC
Thanks for the bug report! It seems that the clear button got lost in commit 036763641a1669c2673cbc929aef6a82a41ef843 (the old code used KInputDialog::getText(), which enables the clear button). To bring it back, something like

lineEdit->setClearButtonShown(true);

needs to be added to KNewFileMenu::createDirectory().

@David: is it OK if I do that in master and 4.6?
Comment 2 David Faure 2011-03-10 10:06:43 UTC
Sure, that's a no-brainer.
Comment 3 Anthony Renoux 2011-03-10 20:30:20 UTC
*** Bug 266720 has been marked as a duplicate of this bug. ***
Comment 4 Frank Reininghaus 2011-03-18 13:24:47 UTC
Git commit 85878a6acfb5f03ec06f58340296582ba9aab7e3 by Frank Reininghaus.
Committed on 18/03/2011 at 13:17.
Pushed by freininghaus into branch 'KDE/4.6'.

KNewFileMenu: Add clear buttons to dialogs asking for a name

This commit adds a clear button to the KLineEdits in the dialogs
that ask the user for a file or folder name when a file or folder
is to be created. Note that the KLineEdit text is set after the
clear button is enabled. If it is done the other way around, the
clear button is not shown initially.

BUG: 267581
FIXED-IN: 4.6.2

M  +16   -2    kfile/knewfilemenu.cpp     

http://commits.kde.org/kdelibs/85878a6acfb5f03ec06f58340296582ba9aab7e3
Comment 5 Frank Reininghaus 2011-03-18 13:30:46 UTC
Git commit 8342a2e206c65885015164da59538212f093bedf by Frank Reininghaus.
Committed on 18/03/2011 at 13:17.
Pushed by freininghaus into branch 'master'.

KNewFileMenu: Add clear buttons to dialogs asking for a name

This commit adds a clear button to the KLineEdits in the dialogs
that ask the user for a file or folder name when a file or folder
is to be created. Note that the KLineEdit text is set after the
clear button is enabled. If it is done the other way around, the
clear button is not shown initially.

CCBUG: 267581
FIXED-IN: 4.6.2
(cherry picked from commit 85878a6acfb5f03ec06f58340296582ba9aab7e3)

M  +16   -2    kfile/knewfilemenu.cpp     

http://commits.kde.org/kdelibs/8342a2e206c65885015164da59538212f093bedf
Comment 6 Frank Reininghaus 2011-03-18 13:37:55 UTC
It turned out that just adding "lineEdit->setClearButtonShown(true);" wasn't enough - the clear button was not shown initially in that case, but only after clearing the line edit and then entering some new text (clicking the invisible clear button was possible though).

It seems that KLineEdit's clear button only works if the text is set *after* the button is enabled, which means that the text cannot be set in the constructor. I've worked around this and added a comment about that, but I promise to either look at KLineEdit's code and try to find a fix for that within the next week or file a new bug report and add a reference to that report to the TODO comment in KNewFileMenu.
Comment 7 Frank Reininghaus 2011-03-19 13:20:32 UTC
Just for the record: The KLineEdit issue is a regression since KDE 4.5 (actually, Anthony already noted that in the original report). Thanks to git bisect, it was quite easy to find out the bad commit:

https://projects.kde.org/projects/kde/kdelibs/repository/revisions/ab3b5ed72c27ed83bffdfa753a84938df63dde4c
Comment 8 Frank Reininghaus 2011-03-19 14:17:15 UTC
I've filed a new report about the KLineEdit issue: bug 268898.
Comment 9 Frank Reininghaus 2011-03-21 22:19:05 UTC
Ups, I just noticed that I reopened the report accidentally with one of my comments.