FilePath: Remove ::toDir() and deprecation hints

Change-Id: Ib561c019e3fd44cd85504ad4286eb3759ce19516
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2022-07-28 15:59:52 +02:00
parent 783f0e1205
commit 451d02c88d
14 changed files with 101 additions and 106 deletions

View File

@@ -180,13 +180,14 @@ void GeneralSettingsWidget::fillLanguageBox() const
m_languageBox->setCurrentIndex(m_languageBox->count() - 1);
const FilePath creatorTrPath = ICore::resourcePath("translations");
const QStringList languageFiles = creatorTrPath.toDir().entryList(
const FilePaths languageFiles = creatorTrPath.dirEntries(
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);
for (const FilePath &languageFile : languageFiles) {
const QString path = languageFile.path();
int start = path.indexOf('_') + 1;
int end = path.lastIndexOf('.');
const QString locale = path.mid(start, end-start);
// no need to show a language that creator will not load anyway
if (hasQmFilesForLocale(locale, creatorTrPath.toString())) {
QLocale tmpLocale(locale);