diff --git a/src/filewidgets/kfilewidget.cpp b/src/filewidgets/kfilewidget.cpp --- a/src/filewidgets/kfilewidget.cpp +++ b/src/filewidgets/kfilewidget.cpp @@ -1152,8 +1152,21 @@ emit q->selectionChanged(); } + QString lineEditText = locationEdit->lineEdit()->text(); + int selectionLength = lineEditText.length(); + + // if only one item is selected then only select the name of the file + // without the file extension + if (ops->selectedItems().urlList().size() == 1) { + int lastDotPosition = lineEditText.lastIndexOf("."); + + if (lastDotPosition != -1) { + selectionLength = lastDotPosition; + } + } + + locationEdit->lineEdit()->setSelection(0, selectionLength); locationEdit->lineEdit()->setModified(false); - locationEdit->lineEdit()->selectAll(); } void KFileWidgetPrivate::_k_fileSelected(const KFileItem &i)