Commit 28361893 authored by Simon Depiets's avatar Simon Depiets

Extracting lambda exp

parent c9c1dfbd
......@@ -74,10 +74,11 @@ QStringList KLanguageName::allLanguageCodes()
const QString localeDir = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
QStringLiteral("locale"), QStandardPaths::LocateDirectory);
const QStringList entries = QDir(localeDir).entryList(QDir::Dirs);
auto languageExists = [&localeDir](const QString &language) {
return QFile::exists(localeDir + '/' + language + "/kf5_entry.desktop");
};
std::copy_if(entries.begin(), entries.end(),
std::back_inserter(systemLangList),
[&localeDir](const QString &language) {
return QFile::exists(localeDir + '/' + language + "/kf5_entry.desktop");
});
languageExists);
return systemLangList;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment