-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ampersand isn't rendered in server name on mixer board title #1886
Comments
Thanks for the bug report and a solution. I assume if the & gets interpreted, there might also be other special characters. The client should replace them like PHP‘s htmlspecialchars(); Feel free to open a pull request with your fix! |
Ok. Can reproduce the bug on Debian Linux.
Although they're talking about python here: https://stackoverflow.com/questions/47584343/how-to-set-text-in-a-qlabel-and-display-characters
maybe something like that could also be applied to C++: https://doc.qt.io/qt-5/qlabel.html#textFormat-prop However, this might break some server names? Not sure... Or maybe it's just as easy as adding .toHtmlEscaped()...: https://doc.qt.io/qt-5/qstring.html#toHtmlEscaped (doesn't seem so...) Ok. we should look into audiomixerboard.cpp, find the label and read the code around the cration of the label. |
The string "(a && b)" should be set to a label as "(a &&&& b)" to show correctly, which the replace should do. It should only be the ampersand that gets treated specially by the qt labels. If you html escape them you'll see something like "(a amp;amp; b)" |
Yes, I didn’t test replace() yet. It just doesn’t feel right to fix this by replacing & with &&. Yes, .toHtmlEscaped(); doesn’t fix it. |
Ok. So the quick and dirty solution would be replace() here: jamulus/src/audiomixerboard.cpp Line 1096 in 1796a98
I‘d be happy if we found a better solution though. |
If a server-name contained '&' this was interpreted as keyboard shortcut. Replacing & by && allows us to show server-names correctly. Fixes: jamulussoftware#1886
Just raised #1893. Could you please test if the change does what you want (especially on macOS and Windows if possible)? |
If a server-name contained '&' this was interpreted as keyboard shortcut. Replacing & by && allows us to show server-names correctly. Fixes: jamulussoftware#1886
If a server-name contained '&' this was interpreted as keyboard shortcut in the mixer board. Replacing & by && allows us to show server-names correctly. Fixes: jamulussoftware#1886
If a server-name contained '&' this was interpreted as keyboard shortcut in the mixer board. Replacing & by && allows us to show server-names correctly. Fixes: jamulussoftware#1886
Doubling the |
Describe the bug
Server names with ampersands (&) in them don't display the ampersand on the mixer board title
To Reproduce
Connect to a server with a single ampersand somewhere in its name, eg: "Server & name"
The mixerboard title shows as "Personal Mix at: Server name"
Expected behavior
The ampersand should show up in the "Personal Mix at: Server & name" text
Operating system
MacOSX 10.14.6, but likely to be all operating systems as this is a QT "feature".
Version of Jamulus
3.8.0
Screenshots
Additional context
The mixerboard title is a QT label so it interprets ampersand as a keyboard shortcut binding and the ampersand won't be shown, but the following letter may have an underline, depending on the operating system (it doesn't on mac, but does on linux)
To escape the ampersand chars they should be doubled up before being set to the label (eg: "Server && name")
Something like
strServerName.replace("&", "&&");
should suffice in the correct place, as long as that doesn't get run on the same string instance multiple times, and mustn't pollute the server list string, or the window title string, which both display correctly.
The text was updated successfully, but these errors were encountered: