summaryrefslogtreecommitdiff
path: root/src/designer/src/lib/shared
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-03-20 20:46:41 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-03-21 12:45:39 +0100
commit619f00d7ca70b427c0e7b7bb19ad0fc8b5cd79c1 (patch)
treee61b3c3922581e469895523d6c0ee3aa29b7aa59 /src/designer/src/lib/shared
parent2d9eeed72084160c04d9d0dfe7a02528f3ed6e3d (diff)
downloadqttools-619f00d7ca70b427c0e7b7bb19ad0fc8b5cd79c1.tar.gz
Port from QLocale::Country to QLocale::Territory
Mostly a search and replace exercise, including the various internal data structures and variables that used to have "country" or "countries" in the name. No change to the DOM structure, where the territory is still stored in a "country" node. We'd have to keep both anyway to keep compatibility, and introducing support for either has no value. Change-Id: Icc2818615257d529e3401c0e28370560cdb3dc7e Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/designer/src/lib/shared')
-rw-r--r--src/designer/src/lib/shared/rcc.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/designer/src/lib/shared/rcc.cpp b/src/designer/src/lib/shared/rcc.cpp
index 6d271bd8a..5d870aed6 100644
--- a/src/designer/src/lib/shared/rcc.cpp
+++ b/src/designer/src/lib/shared/rcc.cpp
@@ -91,7 +91,7 @@ public:
RCCFileInfo(const QString &name = QString(), const QFileInfo &fileInfo = QFileInfo(),
QLocale::Language language = QLocale::C,
- QLocale::Country country = QLocale::AnyCountry,
+ QLocale::Territory territory = QLocale::AnyTerritory,
uint flags = NoFlags,
int compressLevel = CONSTANT_COMPRESSLEVEL_DEFAULT,
int compressThreshold = CONSTANT_COMPRESSTHRESHOLD_DEFAULT);
@@ -107,7 +107,7 @@ public:
int m_flags;
QString m_name;
QLocale::Language m_language;
- QLocale::Country m_country;
+ QLocale::Territory m_territory;
QFileInfo m_fileInfo;
RCCFileInfo *m_parent;
QHash<QString, RCCFileInfo*> m_children;
@@ -120,13 +120,13 @@ public:
};
RCCFileInfo::RCCFileInfo(const QString &name, const QFileInfo &fileInfo,
- QLocale::Language language, QLocale::Country country, uint flags,
+ QLocale::Language language, QLocale::Territory territory, uint flags,
int compressLevel, int compressThreshold)
{
m_name = name;
m_fileInfo = fileInfo;
m_language = language;
- m_country = country;
+ m_territory = territory;
m_flags = flags;
m_parent = nullptr;
m_nameOffset = 0;
@@ -158,7 +158,7 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
lib.writeString(" // ");
lib.writeByteArray(resourceName().toLocal8Bit());
lib.writeString(" [");
- lib.writeByteArray(QByteArray::number(m_country));
+ lib.writeByteArray(QByteArray::number(m_territory));
lib.writeString("::");
lib.writeByteArray(QByteArray::number(m_language));
lib.writeString("[\n ");
@@ -190,7 +190,7 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
lib.writeNumber2(m_flags);
// locale
- lib.writeNumber2(m_country);
+ lib.writeNumber2(m_territory);
lib.writeNumber2(m_language);
//data offset
@@ -365,7 +365,7 @@ bool RCCResourceLibrary::interpretResourceFile(QIODevice *inputDevice,
QString prefix;
QLocale::Language language = QLocale::c().language();
- QLocale::Country country = QLocale::c().country();
+ QLocale::Territory territory = QLocale::c().territory();
QString alias;
int compressLevel = m_compressLevel;
int compressThreshold = m_compressThreshold;
@@ -387,7 +387,7 @@ bool RCCResourceLibrary::interpretResourceFile(QIODevice *inputDevice,
QXmlStreamAttributes attributes = reader.attributes();
language = QLocale::c().language();
- country = QLocale::c().country();
+ territory = QLocale::c().territory();
if (attributes.hasAttribute(m_strings.ATTRIBUTE_LANG)) {
QString attribute = attributes.value(m_strings.ATTRIBUTE_LANG).toString();
@@ -395,9 +395,9 @@ bool RCCResourceLibrary::interpretResourceFile(QIODevice *inputDevice,
language = lang.language();
if (2 == attribute.length()) {
// Language only
- country = QLocale::AnyCountry;
+ territory = QLocale::AnyTerritory;
} else {
- country = lang.country();
+ territory = lang.territory();
}
}
@@ -494,7 +494,7 @@ bool RCCResourceLibrary::interpretResourceFile(QIODevice *inputDevice,
RCCFileInfo(alias.section(slash, -1),
file,
language,
- country,
+ territory,
RCCFileInfo::NoFlags,
compressLevel,
compressThreshold)
@@ -523,7 +523,7 @@ bool RCCResourceLibrary::interpretResourceFile(QIODevice *inputDevice,
RCCFileInfo(child.fileName(),
child,
language,
- country,
+ territory,
RCCFileInfo::NoFlags,
compressLevel,
compressThreshold)
@@ -558,7 +558,7 @@ bool RCCResourceLibrary::interpretResourceFile(QIODevice *inputDevice,
if (!ignoreErrors && m_format == Binary) {
// create dummy entry, otherwise loading with QResource will crash
m_root = new RCCFileInfo(QString(), QFileInfo(),
- QLocale::C, QLocale::AnyCountry, RCCFileInfo::Directory);
+ QLocale::C, QLocale::AnyTerritory, RCCFileInfo::Directory);
}
}
@@ -574,7 +574,7 @@ bool RCCResourceLibrary::addFile(const QString &alias, const RCCFileInfo &file)
return false;
}
if (!m_root)
- m_root = new RCCFileInfo(QString(), QFileInfo(), QLocale::C, QLocale::AnyCountry, RCCFileInfo::Directory);
+ m_root = new RCCFileInfo(QString(), QFileInfo(), QLocale::C, QLocale::AnyTerritory, RCCFileInfo::Directory);
RCCFileInfo *parent = m_root;
const QStringList nodes = alias.split(QLatin1Char('/'));
@@ -583,7 +583,7 @@ bool RCCResourceLibrary::addFile(const QString &alias, const RCCFileInfo &file)
if (node.isEmpty())
continue;
if (!parent->m_children.contains(node)) {
- RCCFileInfo *s = new RCCFileInfo(node, QFileInfo(), QLocale::C, QLocale::AnyCountry, RCCFileInfo::Directory);
+ RCCFileInfo *s = new RCCFileInfo(node, QFileInfo(), QLocale::C, QLocale::AnyTerritory, RCCFileInfo::Directory);
s->m_parent = parent;
parent->m_children.insert(node, s);
parent = s;