strawberrymusicplayer / strawberry

:strawberry: Strawberry Music Player
https://www.strawberrymusicplayer.org/
GNU General Public License v3.0
2.67k stars 183 forks source link

Strawberry adds "&" when editing the name of a playlist #1499

Closed glaubersm closed 2 months ago

glaubersm commented 2 months ago

Describe the bug The name of the playlist changes to "Playlist &#" from "Playlist #" when entering in edit mode.

To Reproduce

  1. press ctrl+n to create a playlist - a new playlist named "Playlist #" is created
  2. double-click on the tab of the newly created playlist

Expected behavior the name of the playlist should not change after the double-click on its tab

System Information:

Additional context Add any other context about the problem here.

jonaski commented 2 months ago

This is a KDE bug, QTabBar::tabText returns this text including the ampersand character &: https://bugs.kde.org/show_bug.cgi?id=483488

glaubersm commented 2 months ago

Weird. Supposedly the Qt bug is fixed in Qt 6.7...

https://bugreports.qt.io/browse/QTBUG-86407

my system where the bug occurs is running Qt 6.7.2.

jonaski commented 2 months ago

That bug doesn't seem to be the same bug, this specific bug is related to QTabBar which is a different widget. The problem is that KDE adds accelerator shortcuts (Ampersands) to the name of the tab, and we use the original title to preset to the user for renaming.

jonaski commented 2 months ago

I made a fix for it by not using QTabBar::tabText.