Skip to content

Commit

Permalink
Fix clock preformat T pattern (lxqt#1862)
Browse files Browse the repository at this point in the history
  • Loading branch information
rysson committed Feb 1, 2023
1 parent a8580ad commit 1c04780
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugin-worldclock/lxqtworldclock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,13 +546,19 @@ QString LXQtWorldClock::preformat(const QString &format, const QTimeZone &timeZo
else
replacement.prepend(QLatin1Char('\''));

int skip = 0;
if (result[tz + length] == QLatin1Char('\''))
++length;
{
++length; // skip following apostrophe
apos = result.indexOf(QLatin1Char('\''), tz + length); // next apostrophe (pair to skipped one)
if (apos != -1)
skip = apos - tz - length + 1; // length of text in apostrophes just after T...
}
else
replacement.append(QLatin1Char('\''));

result.replace(tz, length, replacement);
from = tz + replacement.length();
from = tz + replacement.length() + skip;
}
else
break;
Expand Down

0 comments on commit 1c04780

Please sign in to comment.