Группа :: Система/Библиотеки
Пакет: qt5-base
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: alt-zonetab.patch
Скачать
Скачать
--- a/src/corelib/time/qtimezoneprivate_tz.cpp
+++ b/src/corelib/time/qtimezoneprivate_tz.cpp
@@ -74,14 +74,14 @@ struct QTzTimeZone {
};
// Define as a type as Q_GLOBAL_STATIC doesn't like it
-typedef QHash<QByteArray, QTzTimeZone> QTzTimeZoneHash;
+typedef QMultiHash<QByteArray, QTzTimeZone> QTzTimeZoneHash;
// Parse zone.tab table, assume lists all installed zones, if not will need to read directories
static QTzTimeZoneHash loadTzTimeZones()
{
- QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
+ QString path = QStringLiteral("/usr/share/zoneinfo/zone1970.tab");
if (!QFile::exists(path))
- path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
+ path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
QFile tzif(path);
if (!tzif.open(QIODevice::ReadOnly))
@@ -96,11 +96,13 @@ static QTzTimeZoneHash loadTzTimeZones()
if (!line.isEmpty() && line.at(0) != '#') {
// Data rows are tab-separated columns Region, Coordinates, ID, Optional Comments
const auto parts = line.splitRef(QLatin1Char('\t'));
+for(const auto country_code: parts.at(0).split(QLatin1Char(','), Qt::SkipEmptyParts)) {
QTzTimeZone zone;
- zone.country = QLocalePrivate::codeToCountry(parts.at(0));
+ zone.country = QLocalePrivate::codeToCountry(country_code);
if (parts.size() > 3)
zone.comment = parts.at(3).toUtf8();
zonesHash.insert(parts.at(2).toUtf8(), zone);
+}
}
}
return zonesHash;