Bug 75879 - Reduce selection in location edit to the basename
Summary: Reduce selection in location edit to the basename
Status: RESOLVED FIXED
Alias: None
Product: kfile
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-23 01:17 UTC by Friedrich W. H. Kossebau
Modified: 2018-03-23 01:03 UTC (History)
2 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 Friedrich W. H. Kossebau 2004-02-23 01:17:31 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Especially when saving it would be convenient if only the base name of the file would be selected in the location edit.
When overwriting by inserting this way one does not need to retype the extension. (some motivation: GNOME has it, at least for nautilus ;)

possible starting point for a solution:
In function "setLocationText(...)" in "kfiledialog.cpp" add code to reduce
the selection to the base name.
Needs a new function "baseNameEnd(const QString &)"

void KFileDialog::setLocationText( const QString& text )
{
  (old code)

  // not multiselection?
  if( !(ops->mode() & KFile::Files) )
    locationEdit->lineEdit()->setSelection( 0, baseNameEnd(text) );
}
Comment 1 Clarence Dang 2005-06-12 07:37:32 UTC
I think I saw a binner commit last week that did this but I haven't compiled KDE for months now...
Comment 2 Christoph Feck 2009-08-27 02:35:04 UTC
Moving from "kio/kfile" component to "kfile" product, helps sorting out duplicates.
Comment 3 null 2018-03-23 00:31:09 UTC
Friedrich: Not sure I understood your request correctly, but this might have been fixed a long time ago. Testing "Save As" in Kate and Okular, for me the extension is not selected. Could you check if this is good enough for you?
Comment 4 Friedrich W. H. Kossebau 2018-03-23 01:03:32 UTC
Yes, seems KFileWidgetPrivate::setNonExtSelection() does now what I asked for at that time, and also is used e.g. for dialogs in save mode via Plasma QPA's KDEPlatformFileDialog.

So can confirm things behave as desired, time to move this one to the attic.