Changeset View
Changeset View
Standalone View
Standalone View
src/kcatalog.cpp
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Line(s) | 130 | #if defined(Q_OS_ANDROID) | |||
---|---|---|---|---|---|
131 | // The exact file name must be returned on Android because libintl-lite loads a catalog by filename with bindtextdomain() | 131 | // The exact file name must be returned on Android because libintl-lite loads a catalog by filename with bindtextdomain() | ||
132 | return filename; | 132 | return filename; | ||
133 | #else | 133 | #else | ||
134 | return customLocaleDir; | 134 | return customLocaleDir; | ||
135 | #endif | 135 | #endif | ||
136 | } | 136 | } | ||
137 | } | 137 | } | ||
138 | 138 | | |||
139 | QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, | | |||
140 | QStringLiteral("locale/") + relpath); | | |||
141 | QString localeDir; | | |||
142 | if (!file.isEmpty()) { | | |||
143 | #if defined(Q_OS_ANDROID) | 139 | #if defined(Q_OS_ANDROID) | ||
144 | // The exact file name must be returned on Android because libintl-lite loads a catalog by filename with bindtextdomain() | 140 | // The exact file name must be returned on Android because libintl-lite loads a catalog by filename with bindtextdomain() | ||
145 | localeDir = file; | 141 | QString file = QDir::homePath()+QStringLiteral("/../qt-reserved-files/share/locale/") + relpath; | ||
142 | if (!QFile::exists(file)) { | ||||
143 | file.clear(); | ||||
144 | } | ||||
145 | return file; | ||||
146 | #else | 146 | #else | ||
147 | const QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("locale/") + relpath); | ||||
148 | | ||||
149 | QString localeDir; | ||||
150 | if (!file.isEmpty()) { | ||||
147 | // Path of the locale/ directory must be returned. | 151 | // Path of the locale/ directory must be returned. | ||
148 | localeDir = QFileInfo(file.left(file.size() - relpath.size())).absolutePath(); | 152 | localeDir = QFileInfo(file.left(file.size() - relpath.size())).absolutePath(); | ||
149 | #endif | | |||
150 | } | 153 | } | ||
151 | return localeDir; | 154 | return localeDir; | ||
155 | #endif | ||||
152 | } | 156 | } | ||
153 | 157 | | |||
154 | QSet<QString> KCatalog::availableCatalogLanguages(const QByteArray &domain_) | 158 | QSet<QString> KCatalog::availableCatalogLanguages(const QByteArray &domain_) | ||
155 | { | 159 | { | ||
156 | QString domain = QFile::decodeName(domain_); | 160 | QString domain = QFile::decodeName(domain_); | ||
157 | QStringList localeDirPaths = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, | 161 | QStringList localeDirPaths = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, | ||
158 | QStringLiteral("locale"), | 162 | QStringLiteral("locale"), | ||
159 | QStandardPaths::LocateDirectory); | 163 | QStandardPaths::LocateDirectory); | ||
▲ Show 20 Lines • Show All 147 Lines • Show Last 20 Lines |