[mythtv-commits] Ticket #13585: Channelscan progress lost in translation
MythTV
noreply at mythtv.org
Fri Feb 21 19:16:41 UTC 2020
#13585: Channelscan progress lost in translation
------------------------------------------+---------------------------
Reporter: Klaas de Waal | Owner: Klaas de Waal
Type: Bug Report - General | Status: assigned
Priority: minor | Milestone: needs_triage
Component: MythTV - Channel Scanner | Version: Master Head
Severity: medium | Keywords: Translation
Ticket locked: 0 |
------------------------------------------+---------------------------
The presentation of the progress and the signal strength by the
channelscanner is wrong since a few days. See the attached picture.
This regression is likely to be have been introduced by the translations
recently committed.
The relevant bit of code in channelscanner_gui_pan.cpp is from 15 Jul
2017, commit 24064ac6e618bc5f340c08116c6ed4dae2c0aaa6 and has always
worked correct.
This is the code:
{{{
void ChannelScannerGUIScanPane::SetStatusSignalStrength(int value)
{
m_signalStrengthText->SetText(tr("%1%")
.arg(static_cast<uint>(value * 100 /
65535)));
}}}
It looks to me that it tries to translate the number. I am not aware that
this is done anywhere else in the code and if the translation is done by a
string to string replacement then you need a lot of strings.....
I intend to fix this now for the time being by changing the code to this:
{{{
void ChannelScannerGUIScanPane::SetStatusSignalStrength(int value)
{
if (m_signalStrengthText)
m_signalStrengthText->SetText(QString("%1%")
.arg(static_cast<uint>(value * 100 /
65535)));
}}}
which will restore the old behavior.
If the intention is really to translate the number then the original code
can always be restored once the translation is fixed.
It is possible that the changed behavior of the "tr" function may have
effects elsewhere as well.
--
Ticket URL: <https://code.mythtv.org/trac/ticket/13585>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list