SUMMARY When I hit "Save As" (alt+f, a OR ctrl+shift+s) , "Name:" is empty. STEPS TO REPRODUCE 1. open some text file in Kate 2. do "Save As" OBSERVED RESULT "Name:" in file picker dialog is empty EXPECTED RESULT "Name:" with current file name selected (up to extension is now common behaviour in KDE?) and ready to be edited by keyboard. ADDITIONAL INFORMATION See also #415837, but that should be now fixed and it looks like the Kate has specific way to introduce this.
We altered that to avoid confusion, perhaps that was bad idea. QUrl KTextEditor::DocumentPrivate::getSaveFileUrl(const QString &dialogTitle) { // per default we use the url of the current document // if that is empty, we will try to get the url of the last used view, we assume some properly ordered views() list is around QUrl startUrl = url(); if (auto mainWindow = KTextEditor::Editor::instance()->application()->activeMainWindow(); mainWindow && !startUrl.isValid()) { const auto views = mainWindow->views(); for (auto view : views) { if (view->document()->url().isValid()) { startUrl = view->document()->url(); break; } } } // spawn the dialog, dialogParent will take care of proper parent // we remove the filename, otherwise we propose to save as some other already existing file, that is confusing // beside we need to do that to avoid to use the filename as directory name, see bug 454648 return QFileDialog::getSaveFileUrl(dialogParent(), dialogTitle, startUrl.isValid() ? startUrl.adjusted(QUrl::RemoveFilename) : QUrl()); }
(In reply to Christoph Cullmann from comment #1) > We altered that to avoid confusion, perhaps that was bad idea. Interesting. The way how I tend to work it just makes usage more tedious, as I either use old file as template for new one, and I start typing completely new name (replacing the pre-selected base name), or I actually want to either save the file with same filename to different folder or save some temporary "backup" of it by just appending something to the name, so I guess in like 10+% I'm just missing the original name. I learned to click on the original file in the picker to pre-fill the "Name" again, and continue from there. (just anecdotal "does not work for me", not claiming I'm an expert on UX or know how majority of users use it)
I see a point in that, I use that sometimes, too, that way and miss it a bit. Perhaps it would be better if the save dialog would actually work better if the url is a full file name. At least the Qt docs don't hint that a full file name is bad. But perhaps I read them wrong.
Git commit 7a6f9d8ee3027867a0ee8b99faf209d4685934c9 by Christoph Cullmann. Committed on 30/10/2022 at 19:18. Pushed by cullmann into branch 'master'. remove file name for saveas only for remote files or for the case we use the file of some other view to have some better start directory M +13 -6 src/document/katedocument.cpp https://invent.kde.org/frameworks/ktexteditor/commit/7a6f9d8ee3027867a0ee8b99faf209d4685934c9
The pushed fix should still fix the old issue for remote files but avoid the regression for local ones.
*** Bug 467211 has been marked as a duplicate of this bug. ***