Bug 75879

Summary: Reduce selection in location edit to the basename
Product: [Applications] kfile Reporter: Friedrich W. H. Kossebau <kossebau>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: dang, null
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

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.