Bug 411063 - The recent and bookmark menus show items without their underscores
Summary: The recent and bookmark menus show items without their underscores
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Global Menu (show other bugs)
Version: 5.16.4
Platform: Manjaro Linux
: NOR minor
Target Milestone: 1.0
Assignee: Kai Uwe Broulik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-19 14:15 UTC by Michael Alexsander
Modified: 2023-08-02 20:02 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot of KDevelop (317.35 KB, image/png)
2019-09-09 14:22 UTC, Michael Alexsander
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Alexsander 2019-08-19 14:15:26 UTC
SUMMARY
When items are shown in the "Files > Open Recent" or "Bookmarks" menus, said items will appear without their underscores, be it in the file names, or line of code.


STEPS TO REPRODUCE
1. Open a file in a program that uses KTextEditor (Kate, KDevelop, etc).
2. Bookmark any line, or close the file.
3. Either check the "File > Open Recent" or the "Bookmarks" menu in the top bar.


OBSERVED RESULT
File names and lines of code appearing without their underscores.


EXPECTED RESULT
The opposite.


SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.16.4
KDE Frameworks Version: 5.60
Qt Version: 5.13
Comment 1 Dominik Haumann 2019-08-20 07:18:27 UTC
Wild guess: are we missing to attach the KAccelManager to add shortcuts?
Comment 2 Christoph Cullmann 2019-08-25 09:59:00 UTC
For me, that works.

I can see the auto-added accel _ if I press ALT and text that contains _ is rendered with _ in the menu, too.

Just to clarify: Do you have issues that e.g. for some line like

lala_lala

The _ is not shown in the menu?

If yes, could you try to vary your global font size/scaling factor if that helps?
Comment 3 Michael Alexsander 2019-08-25 13:21:16 UTC
It can be the size/scaling, as "lala_lala" is not just rendered as "lala lala", but as "lalalala".
Comment 4 Christoph Cullmann 2019-08-25 13:25:09 UTC
Hmm, interesting, that works perfectly fine here with 19.08 for both bookmarks and files.

KDE Frameworks 5.60.0
Qt 5.13.0 (built against 5.13.0)
The xcb windowing system
Comment 5 Bug Janitor Service 2019-09-09 04:33:12 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Michael Alexsander 2019-09-09 10:31:43 UTC
I really don't know what else I could provide for information...
Comment 7 Christoph Feck 2019-09-09 13:23:44 UTC
Please add a screenshot of a wrongly rendered menu. It could be a Breeze or Qt issue.
Comment 8 Michael Alexsander 2019-09-09 14:22:47 UTC
Created attachment 122560 [details]
Screenshot of KDevelop

Done. The files who aren't in PascalCase should have been written in snake_case.
Comment 9 Christoph Feck 2019-09-16 21:12:31 UTC
Is this actually the Breeze widget style? From the rounding of the menubar highlight, it looks like you are using a different widget style.
Comment 10 Michael Alexsander 2019-09-16 22:04:21 UTC
Yes, it is.
Comment 11 Michael Alexsander 2019-09-16 22:16:59 UTC
This talk about widgets made me realize something, the bug is actually in the global menu widget! Accessing those from the actual menu bars show the underscores correctly.
Comment 12 Michael Alexsander 2019-09-16 22:19:56 UTC
Which section should I go to report a bug in a plasma widget?
Comment 13 Christoph Feck 2019-09-17 00:10:32 UTC
Thanks for the investigation! Reassigning to Global Menu component.
Comment 14 Noah Davis 2023-08-02 20:00:58 UTC
I can reproduce this in Plasma 5.26.1. It's not the latest version, which I can't use much right now, but it's not likely that things have changed much in 5.27. The issue is likely caused by the following code.

In plasma-workspace/libdbusmenuqt/dbusmenuimporter.cpp, DBusMenuImporterPrivate:

```
void updateActionLabel(QAction *action, const QVariant &value)
{
    QString text = swapMnemonicChar(value.toString(), '_', '&');
    action->setText(text);
}
```

`swapMnemonicChar()` is defined in plasma-workspace/libdbusmenuqt/utils.cpp and probably needs to "escape" the characters it is meant to swap.