Bug 426800 - [Neon unstable] tag editor starts with the first (alphabetically) tag already entered
Summary: [Neon unstable] tag editor starts with the first (alphabetically) tag already...
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: Other (add details in bug description)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-21 07:59 UTC by Oded Arbel
Modified: 2020-09-21 17:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 20.12


Attachments
screenshot showing pre-filled text (362.91 KB, image/png)
2020-09-21 07:59 UTC, Oded Arbel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oded Arbel 2020-09-21 07:59:26 UTC
Created attachment 131825 [details]
screenshot showing pre-filled text

SUMMARY
This issue started appearing about a week ago in Neon unstable builds: when opening the tag editor, the text edit box at the bottom is pre-filled with some text, so that if you want to put in another tag you have to first delete what is in there. The pre-filled text seems to be the first tag, in alphabetical order, from the Baloo tag database. As I have several hundred different tags in use on my system, the pre-populated text is very unlikely to be useful and it just adds another hassle.

STEPS TO REPRODUCE
1. Have some tags already in the system and indexed.
2. Open an image file with Gwenview
3. Click "Edit" in the info pane under "Tags" or hit CTRL+T

OBSERVED RESULT
The tag editor's text box already has some text in it, which is unselected and the cursor positioned immediately after that - so any editing that isn't accepting the pre-filled text has to start by erasing the text.

EXPECTED RESULT
The tag editor's text box should be focused and empty.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version:  5.19.90
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.0

ADDITIONAL INFORMATION
I'm not sure what was the intent with having some text pre-filled, but if it is to speed up entry (and I think that is misguided as the chosen pre-filled text is very unlikely to be usable) then having that text also selected would be a better behavior - as quick entry can still be accomplished by just hitting ENTER while if the user is not interested in the pre-filled text, they can just start typing.

I still think that choosing an arbitrary tag to be pre-filled is more confusing than helpful and the suggestion drop down menu is enough of a help for quick entry.
Comment 1 Oded Arbel 2020-09-21 08:37:19 UTC
Looking a bit more into the code, I can't identify a change in Gwenview code that would cause this, and I think this may be a behavior change in Qt. I'm still investigating.
Comment 2 Oded Arbel 2020-09-21 08:52:05 UTC
The problem seems to be a behavior change in Qt 5.15.0 (regression?) and specifically this commit: https://code.qt.io/cgit/qt/qtbase.git/commit/src/widgets/widgets/qcombobox.cpp?id=a4ea0d9eacd574a6a96f70b138dcb111e9d11d21 where before an editable QComboBox just created had its current index set to -1 but with that commit, `setModel()` would call `trySetValidIndex()` and that defaults to setting the current index to 0.

I have a workaround MR in invent.