Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/profilemanager.cpp
Show First 20 Lines • Show All 307 Lines • ▼ Show 20 Line(s) | 303 | for (const QString &path : qAsConst(paths)) { | |||
---|---|---|---|---|---|
308 | } | 308 | } | ||
309 | } | 309 | } | ||
310 | return firmwares; | 310 | return firmwares; | ||
311 | } | 311 | } | ||
312 | 312 | | |||
313 | QStringList ProfileManager::firmwaresInPath(const QString &path) | 313 | QStringList ProfileManager::firmwaresInPath(const QString &path) | ||
314 | { | 314 | { | ||
315 | QStringList firmwares; | 315 | QStringList firmwares; | ||
316 | QStringList files = QDir(path).entryList(QDir::Files); | 316 | for (QString file : QDir(path).entryList({AtCoreDirectories::pluginExtFilter}, QDir::Files)) { | ||
317 | for (QString file : files) { | 317 | file = file.split(QStringLiteral(".")).at(0).toLower().simplified(); | ||
318 | #if defined(Q_OS_WIN) | | |||
319 | if (file.endsWith(QStringLiteral(".dll"))) | | |||
320 | #elif defined(Q_OS_MAC) | | |||
321 | if (file.endsWith(QStringLiteral(".dylib"))) | | |||
322 | #else | | |||
323 | if (file.endsWith(QStringLiteral(".so"))) | | |||
324 | #endif | | |||
325 | file = file.split(QChar::fromLatin1('.')).at(0); | | |||
326 | else { | | |||
327 | continue; | | |||
328 | } | | |||
329 | if (file.startsWith(QStringLiteral("lib"))) { | 318 | if (file.startsWith(QStringLiteral("lib"))) { | ||
330 | file = file.remove(QStringLiteral("lib")); | 319 | file = file.remove(QStringLiteral("lib")); | ||
331 | } | 320 | } | ||
332 | file = file.toLower().simplified(); | | |||
333 | firmwares.append(file); | 321 | firmwares.append(file); | ||
334 | } | 322 | } | ||
335 | return firmwares; | 323 | return firmwares; | ||
336 | } | 324 | } |