ICore: Change some path API to use FilePath

Change-Id: Id841d6177206a021c9e606ce560b47d1ae6e52b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Eike Ziller
2021-04-22 16:15:26 +02:00
parent b2c0554733
commit c1f90aeca2
79 changed files with 260 additions and 244 deletions

View File

@@ -132,15 +132,16 @@ void GeneralSettingsWidget::fillLanguageBox() const
if (currentLocale == QLatin1String("C"))
m_ui.languageBox->setCurrentIndex(m_ui.languageBox->count() - 1);
const QString creatorTrPath = ICore::resourcePath() + QLatin1String("/translations");
const QStringList languageFiles = QDir(creatorTrPath).entryList(QStringList(QLatin1String("qtcreator*.qm")));
const FilePath creatorTrPath = ICore::resourcePath() / "translations";
const QStringList languageFiles = creatorTrPath.toDir().entryList(
QStringList(QLatin1String("qtcreator*.qm")));
for (const QString &languageFile : languageFiles) {
int start = languageFile.indexOf('_') + 1;
int end = languageFile.lastIndexOf('.');
const QString locale = languageFile.mid(start, end-start);
// no need to show a language that creator will not load anyway
if (hasQmFilesForLocale(locale, creatorTrPath)) {
if (hasQmFilesForLocale(locale, creatorTrPath.toString())) {
QLocale tmpLocale(locale);
QString languageItem = QLocale::languageToString(tmpLocale.language()) + QLatin1String(" (")
+ QLocale::countryToString(tmpLocale.country()) + QLatin1Char(')');