mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Use default-constructed QLocale for date/time/whatever else formatting
Qt 6 chenged the QDateTime API to use QLocale::c() rather than QLocale::system(), using default-constructed QLocale will make this consistent and overradable application-wide Other formating use-cases as QLocale::decimalPoint use default-constructed QLocale now, too
This commit is contained in:
@@ -72,12 +72,12 @@ void PaintRowDate(QPainter &p, QDateTime date, QRect &rectForName, bool active,
|
||||
const auto wasSameDay = (lastDate == nowDate);
|
||||
const auto wasRecently = qAbs(lastTime.secsTo(now)) < kRecentlyInSeconds;
|
||||
if (wasSameDay || wasRecently) {
|
||||
return lastTime.toString(cTimeFormat());
|
||||
return QLocale().toString(lastTime, cTimeFormat());
|
||||
} else if (lastDate.year() == nowDate.year()
|
||||
&& lastDate.weekNumber() == nowDate.weekNumber()) {
|
||||
return langDayOfWeek(lastDate);
|
||||
} else {
|
||||
return lastDate.toString(cDateFormat());
|
||||
return QLocale().toString(lastDate, cDateFormat());
|
||||
}
|
||||
}();
|
||||
PaintRowTopRight(p, dt, rectForName, active, selected);
|
||||
|
Reference in New Issue
Block a user