mirror of
https://invent.kde.org/marcoa/a-la-karte.git
synced 2026-02-09 21:13:08 +00:00
Make imports incremental and refreshable
This commit is contained in:
parent
365c3b31cb
commit
245944fca9
3 changed files with 405 additions and 99 deletions
448
src/app.cpp
448
src/app.cpp
|
|
@ -18,7 +18,9 @@
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QJsonParseError>
|
#include <QJsonParseError>
|
||||||
|
#include <QSet>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
#include <QTimer>
|
||||||
#include <QtConcurrent>
|
#include <QtConcurrent>
|
||||||
|
|
||||||
App *App::s_instance = nullptr;
|
App *App::s_instance = nullptr;
|
||||||
|
|
@ -142,6 +144,12 @@ App::App(QObject *parent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (m_config->autoImportOnStartup()) {
|
||||||
|
QTimer::singleShot(0, this, [this]() {
|
||||||
|
importAllGames();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
App *App::instance()
|
App *App::instance()
|
||||||
|
|
@ -215,18 +223,17 @@ void App::importAllGames()
|
||||||
if (m_importing)
|
if (m_importing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const bool anyEnabled = m_config->importSteam() || m_config->importLutris() || m_config->importHeroic() || m_config->importDesktop()
|
const bool doSteam = m_config->importSteam();
|
||||||
|| m_config->importBottles() || m_config->importFlatpak() || m_config->importItch() || m_config->importLegendary() || m_config->importRetroArch();
|
const bool doLutris = m_config->importLutris();
|
||||||
|
const bool doHeroic = m_config->importHeroic();
|
||||||
|
const bool doDesktop = m_config->importDesktop();
|
||||||
|
const bool doBottles = m_config->importBottles();
|
||||||
|
const bool doFlatpak = m_config->importFlatpak();
|
||||||
|
const bool doItch = m_config->importItch();
|
||||||
|
const bool doLegendary = m_config->importLegendary();
|
||||||
|
const bool doRetroArch = m_config->importRetroArch();
|
||||||
|
|
||||||
const bool doSteam = m_config->importSteam() && !m_gameModel->hasPlatformPrefix(QStringLiteral("Steam"));
|
const bool anyEnabled = doSteam || doLutris || doHeroic || doDesktop || doBottles || doFlatpak || doItch || doLegendary || doRetroArch;
|
||||||
const bool doLutris = m_config->importLutris() && !m_gameModel->hasPlatformPrefix(QStringLiteral("Lutris"));
|
|
||||||
const bool doHeroic = m_config->importHeroic() && !m_gameModel->hasPlatformPrefix(QStringLiteral("Heroic"));
|
|
||||||
const bool doDesktop = m_config->importDesktop() && !m_gameModel->hasPlatformPrefix(QStringLiteral("Desktop"));
|
|
||||||
const bool doBottles = m_config->importBottles() && !m_gameModel->hasPlatformPrefix(QStringLiteral("Bottles"));
|
|
||||||
const bool doFlatpak = m_config->importFlatpak() && !m_gameModel->hasPlatformPrefix(QStringLiteral("Flatpak"));
|
|
||||||
const bool doItch = m_config->importItch() && !m_gameModel->hasPlatformPrefix(QStringLiteral("itch.io"));
|
|
||||||
const bool doLegendary = m_config->importLegendary() && !m_gameModel->hasPlatformPrefix(QStringLiteral("Legendary"));
|
|
||||||
const bool doRetroArch = m_config->importRetroArch() && !m_gameModel->hasPlatformPrefix(QStringLiteral("RetroArch"));
|
|
||||||
|
|
||||||
if (!anyEnabled) {
|
if (!anyEnabled) {
|
||||||
setImportStatus(tr("No import sources enabled"));
|
setImportStatus(tr("No import sources enabled"));
|
||||||
|
|
@ -234,17 +241,55 @@ void App::importAllGames()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(doSteam || doLutris || doHeroic || doDesktop || doBottles || doFlatpak || doItch || doLegendary || doRetroArch)) {
|
const QSet<QString> existingIds = [this]() {
|
||||||
setImportStatus(tr("All enabled sources already imported"));
|
QSet<QString> ids;
|
||||||
Q_EMIT importCompleted(0);
|
const QList<Game *> games = m_gameModel->allGames();
|
||||||
return;
|
for (Game *game : games) {
|
||||||
|
if (game) {
|
||||||
|
ids.insert(game->id());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}();
|
||||||
|
|
||||||
setImporting(true);
|
setImporting(true);
|
||||||
setImportStatus(tr("Importing games..."));
|
setImportStatus(tr("Importing games..."));
|
||||||
|
|
||||||
[[maybe_unused]] auto future = QtConcurrent::run([this, doSteam, doLutris, doHeroic, doDesktop, doBottles, doFlatpak, doItch, doLegendary, doRetroArch]() {
|
[[maybe_unused]] auto future = QtConcurrent::run([this,
|
||||||
|
doSteam,
|
||||||
|
doLutris,
|
||||||
|
doHeroic,
|
||||||
|
doDesktop,
|
||||||
|
doBottles,
|
||||||
|
doFlatpak,
|
||||||
|
doItch,
|
||||||
|
doLegendary,
|
||||||
|
doRetroArch,
|
||||||
|
existingIds]() {
|
||||||
int totalCount = 0;
|
int totalCount = 0;
|
||||||
|
QSet<QString> seenIds = existingIds;
|
||||||
|
|
||||||
|
const auto keepNewGames = [&seenIds](const QList<Game *> &games) {
|
||||||
|
QList<Game *> result;
|
||||||
|
result.reserve(games.size());
|
||||||
|
|
||||||
|
for (Game *game : games) {
|
||||||
|
if (!game) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString id = game->id();
|
||||||
|
if (id.isEmpty() || seenIds.contains(id)) {
|
||||||
|
delete game;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
seenIds.insert(id);
|
||||||
|
result.append(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
// Import from Steam
|
// Import from Steam
|
||||||
if (doSteam) {
|
if (doSteam) {
|
||||||
|
|
@ -256,7 +301,7 @@ void App::importAllGames()
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
SteamImporter steamImporter;
|
SteamImporter steamImporter;
|
||||||
QList<Game *> steamGames = steamImporter.importGames();
|
QList<Game *> steamGames = keepNewGames(steamImporter.importGames());
|
||||||
for (Game *game : steamGames) {
|
for (Game *game : steamGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
|
|
@ -291,7 +336,7 @@ void App::importAllGames()
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
LutrisImporter lutrisImporter;
|
LutrisImporter lutrisImporter;
|
||||||
QList<Game *> lutrisGames = lutrisImporter.importGames();
|
QList<Game *> lutrisGames = keepNewGames(lutrisImporter.importGames());
|
||||||
for (Game *game : lutrisGames) {
|
for (Game *game : lutrisGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
|
|
@ -326,7 +371,7 @@ void App::importAllGames()
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
HeroicImporter heroicImporter;
|
HeroicImporter heroicImporter;
|
||||||
QList<Game *> heroicGames = heroicImporter.importGames();
|
QList<Game *> heroicGames = keepNewGames(heroicImporter.importGames());
|
||||||
for (Game *game : heroicGames) {
|
for (Game *game : heroicGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
|
|
@ -361,7 +406,7 @@ void App::importAllGames()
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
DesktopImporter desktopImporter;
|
DesktopImporter desktopImporter;
|
||||||
QList<Game *> desktopGames = desktopImporter.importGames();
|
QList<Game *> desktopGames = keepNewGames(desktopImporter.importGames());
|
||||||
for (Game *game : desktopGames) {
|
for (Game *game : desktopGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
|
|
@ -396,7 +441,7 @@ void App::importAllGames()
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
BottlesImporter bottlesImporter;
|
BottlesImporter bottlesImporter;
|
||||||
QList<Game *> bottlesGames = bottlesImporter.importGames();
|
QList<Game *> bottlesGames = keepNewGames(bottlesImporter.importGames());
|
||||||
for (Game *game : bottlesGames) {
|
for (Game *game : bottlesGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
|
|
@ -431,7 +476,7 @@ void App::importAllGames()
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
FlatpakImporter flatpakImporter;
|
FlatpakImporter flatpakImporter;
|
||||||
QList<Game *> flatpakGames = flatpakImporter.importGames();
|
QList<Game *> flatpakGames = keepNewGames(flatpakImporter.importGames());
|
||||||
for (Game *game : flatpakGames) {
|
for (Game *game : flatpakGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
|
|
@ -466,7 +511,7 @@ void App::importAllGames()
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
ItchImporter itchImporter;
|
ItchImporter itchImporter;
|
||||||
QList<Game *> itchGames = itchImporter.importGames();
|
QList<Game *> itchGames = keepNewGames(itchImporter.importGames());
|
||||||
for (Game *game : itchGames) {
|
for (Game *game : itchGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
|
|
@ -501,7 +546,7 @@ void App::importAllGames()
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
LegendaryImporter legendaryImporter;
|
LegendaryImporter legendaryImporter;
|
||||||
QList<Game *> legendaryGames = legendaryImporter.importGames();
|
QList<Game *> legendaryGames = keepNewGames(legendaryImporter.importGames());
|
||||||
for (Game *game : legendaryGames) {
|
for (Game *game : legendaryGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
|
|
@ -536,7 +581,7 @@ void App::importAllGames()
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
RetroArchImporter retroArchImporter;
|
RetroArchImporter retroArchImporter;
|
||||||
QList<Game *> retroArchGames = retroArchImporter.importGames();
|
QList<Game *> retroArchGames = keepNewGames(retroArchImporter.importGames());
|
||||||
for (Game *game : retroArchGames) {
|
for (Game *game : retroArchGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
|
|
@ -565,7 +610,7 @@ void App::importAllGames()
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(
|
||||||
this,
|
this,
|
||||||
[this, totalCount]() {
|
[this, totalCount]() {
|
||||||
setImportStatus(tr("Import complete: %1 games found").arg(totalCount));
|
setImportStatus(tr("Import complete: %1 new games found").arg(totalCount));
|
||||||
setImporting(false);
|
setImporting(false);
|
||||||
saveLibrary();
|
saveLibrary();
|
||||||
Q_EMIT importCompleted(totalCount);
|
Q_EMIT importCompleted(totalCount);
|
||||||
|
|
@ -579,28 +624,57 @@ void App::importFromSteam()
|
||||||
if (m_importing)
|
if (m_importing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const QSet<QString> existingIds = [this]() {
|
||||||
|
QSet<QString> ids;
|
||||||
|
const QList<Game *> games = m_gameModel->allGames();
|
||||||
|
for (Game *game : games) {
|
||||||
|
if (game) {
|
||||||
|
ids.insert(game->id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}();
|
||||||
|
|
||||||
setImporting(true);
|
setImporting(true);
|
||||||
setImportStatus(tr("Scanning Steam library..."));
|
setImportStatus(tr("Scanning Steam library..."));
|
||||||
|
|
||||||
[[maybe_unused]] auto future = QtConcurrent::run([this]() {
|
[[maybe_unused]] auto future = QtConcurrent::run([this, existingIds]() {
|
||||||
SteamImporter importer;
|
SteamImporter importer;
|
||||||
QList<Game *> games = importer.importGames();
|
QList<Game *> games = importer.importGames();
|
||||||
|
QSet<QString> seenIds = existingIds;
|
||||||
|
QList<Game *> newGames;
|
||||||
|
newGames.reserve(games.size());
|
||||||
|
|
||||||
for (Game *game : games) {
|
for (Game *game : games) {
|
||||||
|
if (!game) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString id = game->id();
|
||||||
|
if (id.isEmpty() || seenIds.contains(id)) {
|
||||||
|
delete game;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
seenIds.insert(id);
|
||||||
|
newGames.append(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Game *game : newGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(
|
||||||
this,
|
this,
|
||||||
[this, games]() {
|
[this, newGames]() {
|
||||||
for (Game *game : games) {
|
for (Game *game : newGames) {
|
||||||
m_gameModel->addGame(game);
|
m_gameModel->addGame(game);
|
||||||
}
|
}
|
||||||
setImportStatus(tr("Steam import complete: %1 games found").arg(games.count()));
|
setImportStatus(tr("Steam import complete: %1 new games found").arg(newGames.count()));
|
||||||
setImporting(false);
|
setImporting(false);
|
||||||
saveLibrary();
|
saveLibrary();
|
||||||
Q_EMIT importCompleted(games.count());
|
Q_EMIT importCompleted(newGames.count());
|
||||||
},
|
},
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
});
|
});
|
||||||
|
|
@ -611,28 +685,57 @@ void App::importFromLutris()
|
||||||
if (m_importing)
|
if (m_importing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const QSet<QString> existingIds = [this]() {
|
||||||
|
QSet<QString> ids;
|
||||||
|
const QList<Game *> games = m_gameModel->allGames();
|
||||||
|
for (Game *game : games) {
|
||||||
|
if (game) {
|
||||||
|
ids.insert(game->id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}();
|
||||||
|
|
||||||
setImporting(true);
|
setImporting(true);
|
||||||
setImportStatus(tr("Scanning Lutris library..."));
|
setImportStatus(tr("Scanning Lutris library..."));
|
||||||
|
|
||||||
[[maybe_unused]] auto future = QtConcurrent::run([this]() {
|
[[maybe_unused]] auto future = QtConcurrent::run([this, existingIds]() {
|
||||||
LutrisImporter importer;
|
LutrisImporter importer;
|
||||||
QList<Game *> games = importer.importGames();
|
QList<Game *> games = importer.importGames();
|
||||||
|
QSet<QString> seenIds = existingIds;
|
||||||
|
QList<Game *> newGames;
|
||||||
|
newGames.reserve(games.size());
|
||||||
|
|
||||||
for (Game *game : games) {
|
for (Game *game : games) {
|
||||||
|
if (!game) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString id = game->id();
|
||||||
|
if (id.isEmpty() || seenIds.contains(id)) {
|
||||||
|
delete game;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
seenIds.insert(id);
|
||||||
|
newGames.append(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Game *game : newGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(
|
||||||
this,
|
this,
|
||||||
[this, games]() {
|
[this, newGames]() {
|
||||||
for (Game *game : games) {
|
for (Game *game : newGames) {
|
||||||
m_gameModel->addGame(game);
|
m_gameModel->addGame(game);
|
||||||
}
|
}
|
||||||
setImportStatus(tr("Lutris import complete: %1 games found").arg(games.count()));
|
setImportStatus(tr("Lutris import complete: %1 new games found").arg(newGames.count()));
|
||||||
setImporting(false);
|
setImporting(false);
|
||||||
saveLibrary();
|
saveLibrary();
|
||||||
Q_EMIT importCompleted(games.count());
|
Q_EMIT importCompleted(newGames.count());
|
||||||
},
|
},
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
});
|
});
|
||||||
|
|
@ -643,28 +746,57 @@ void App::importFromHeroic()
|
||||||
if (m_importing)
|
if (m_importing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const QSet<QString> existingIds = [this]() {
|
||||||
|
QSet<QString> ids;
|
||||||
|
const QList<Game *> games = m_gameModel->allGames();
|
||||||
|
for (Game *game : games) {
|
||||||
|
if (game) {
|
||||||
|
ids.insert(game->id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}();
|
||||||
|
|
||||||
setImporting(true);
|
setImporting(true);
|
||||||
setImportStatus(tr("Scanning Heroic library..."));
|
setImportStatus(tr("Scanning Heroic library..."));
|
||||||
|
|
||||||
[[maybe_unused]] auto future = QtConcurrent::run([this]() {
|
[[maybe_unused]] auto future = QtConcurrent::run([this, existingIds]() {
|
||||||
HeroicImporter importer;
|
HeroicImporter importer;
|
||||||
QList<Game *> games = importer.importGames();
|
QList<Game *> games = importer.importGames();
|
||||||
|
QSet<QString> seenIds = existingIds;
|
||||||
|
QList<Game *> newGames;
|
||||||
|
newGames.reserve(games.size());
|
||||||
|
|
||||||
for (Game *game : games) {
|
for (Game *game : games) {
|
||||||
|
if (!game) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString id = game->id();
|
||||||
|
if (id.isEmpty() || seenIds.contains(id)) {
|
||||||
|
delete game;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
seenIds.insert(id);
|
||||||
|
newGames.append(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Game *game : newGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(
|
||||||
this,
|
this,
|
||||||
[this, games]() {
|
[this, newGames]() {
|
||||||
for (Game *game : games) {
|
for (Game *game : newGames) {
|
||||||
m_gameModel->addGame(game);
|
m_gameModel->addGame(game);
|
||||||
}
|
}
|
||||||
setImportStatus(tr("Heroic import complete: %1 games found").arg(games.count()));
|
setImportStatus(tr("Heroic import complete: %1 new games found").arg(newGames.count()));
|
||||||
setImporting(false);
|
setImporting(false);
|
||||||
saveLibrary();
|
saveLibrary();
|
||||||
Q_EMIT importCompleted(games.count());
|
Q_EMIT importCompleted(newGames.count());
|
||||||
},
|
},
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
});
|
});
|
||||||
|
|
@ -675,28 +807,57 @@ void App::importFromDesktop()
|
||||||
if (m_importing)
|
if (m_importing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const QSet<QString> existingIds = [this]() {
|
||||||
|
QSet<QString> ids;
|
||||||
|
const QList<Game *> games = m_gameModel->allGames();
|
||||||
|
for (Game *game : games) {
|
||||||
|
if (game) {
|
||||||
|
ids.insert(game->id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}();
|
||||||
|
|
||||||
setImporting(true);
|
setImporting(true);
|
||||||
setImportStatus(tr("Scanning desktop entries..."));
|
setImportStatus(tr("Scanning desktop entries..."));
|
||||||
|
|
||||||
[[maybe_unused]] auto future = QtConcurrent::run([this]() {
|
[[maybe_unused]] auto future = QtConcurrent::run([this, existingIds]() {
|
||||||
DesktopImporter importer;
|
DesktopImporter importer;
|
||||||
QList<Game *> games = importer.importGames();
|
QList<Game *> games = importer.importGames();
|
||||||
|
QSet<QString> seenIds = existingIds;
|
||||||
|
QList<Game *> newGames;
|
||||||
|
newGames.reserve(games.size());
|
||||||
|
|
||||||
for (Game *game : games) {
|
for (Game *game : games) {
|
||||||
|
if (!game) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString id = game->id();
|
||||||
|
if (id.isEmpty() || seenIds.contains(id)) {
|
||||||
|
delete game;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
seenIds.insert(id);
|
||||||
|
newGames.append(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Game *game : newGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(
|
||||||
this,
|
this,
|
||||||
[this, games]() {
|
[this, newGames]() {
|
||||||
for (Game *game : games) {
|
for (Game *game : newGames) {
|
||||||
m_gameModel->addGame(game);
|
m_gameModel->addGame(game);
|
||||||
}
|
}
|
||||||
setImportStatus(tr("Desktop import complete: %1 games found").arg(games.count()));
|
setImportStatus(tr("Desktop import complete: %1 new games found").arg(newGames.count()));
|
||||||
setImporting(false);
|
setImporting(false);
|
||||||
saveLibrary();
|
saveLibrary();
|
||||||
Q_EMIT importCompleted(games.count());
|
Q_EMIT importCompleted(newGames.count());
|
||||||
},
|
},
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
});
|
});
|
||||||
|
|
@ -707,28 +868,57 @@ void App::importFromBottles()
|
||||||
if (m_importing)
|
if (m_importing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const QSet<QString> existingIds = [this]() {
|
||||||
|
QSet<QString> ids;
|
||||||
|
const QList<Game *> games = m_gameModel->allGames();
|
||||||
|
for (Game *game : games) {
|
||||||
|
if (game) {
|
||||||
|
ids.insert(game->id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}();
|
||||||
|
|
||||||
setImporting(true);
|
setImporting(true);
|
||||||
setImportStatus(tr("Scanning Bottles..."));
|
setImportStatus(tr("Scanning Bottles..."));
|
||||||
|
|
||||||
[[maybe_unused]] auto future = QtConcurrent::run([this]() {
|
[[maybe_unused]] auto future = QtConcurrent::run([this, existingIds]() {
|
||||||
BottlesImporter importer;
|
BottlesImporter importer;
|
||||||
QList<Game *> games = importer.importGames();
|
QList<Game *> games = importer.importGames();
|
||||||
|
QSet<QString> seenIds = existingIds;
|
||||||
|
QList<Game *> newGames;
|
||||||
|
newGames.reserve(games.size());
|
||||||
|
|
||||||
for (Game *game : games) {
|
for (Game *game : games) {
|
||||||
|
if (!game) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString id = game->id();
|
||||||
|
if (id.isEmpty() || seenIds.contains(id)) {
|
||||||
|
delete game;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
seenIds.insert(id);
|
||||||
|
newGames.append(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Game *game : newGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(
|
||||||
this,
|
this,
|
||||||
[this, games]() {
|
[this, newGames]() {
|
||||||
for (Game *game : games) {
|
for (Game *game : newGames) {
|
||||||
m_gameModel->addGame(game);
|
m_gameModel->addGame(game);
|
||||||
}
|
}
|
||||||
setImportStatus(tr("Bottles import complete: %1 games found").arg(games.count()));
|
setImportStatus(tr("Bottles import complete: %1 new games found").arg(newGames.count()));
|
||||||
setImporting(false);
|
setImporting(false);
|
||||||
saveLibrary();
|
saveLibrary();
|
||||||
Q_EMIT importCompleted(games.count());
|
Q_EMIT importCompleted(newGames.count());
|
||||||
},
|
},
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
});
|
});
|
||||||
|
|
@ -739,28 +929,57 @@ void App::importFromFlatpak()
|
||||||
if (m_importing)
|
if (m_importing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const QSet<QString> existingIds = [this]() {
|
||||||
|
QSet<QString> ids;
|
||||||
|
const QList<Game *> games = m_gameModel->allGames();
|
||||||
|
for (Game *game : games) {
|
||||||
|
if (game) {
|
||||||
|
ids.insert(game->id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}();
|
||||||
|
|
||||||
setImporting(true);
|
setImporting(true);
|
||||||
setImportStatus(tr("Scanning Flatpak games..."));
|
setImportStatus(tr("Scanning Flatpak games..."));
|
||||||
|
|
||||||
[[maybe_unused]] auto future = QtConcurrent::run([this]() {
|
[[maybe_unused]] auto future = QtConcurrent::run([this, existingIds]() {
|
||||||
FlatpakImporter importer;
|
FlatpakImporter importer;
|
||||||
QList<Game *> games = importer.importGames();
|
QList<Game *> games = importer.importGames();
|
||||||
|
QSet<QString> seenIds = existingIds;
|
||||||
|
QList<Game *> newGames;
|
||||||
|
newGames.reserve(games.size());
|
||||||
|
|
||||||
for (Game *game : games) {
|
for (Game *game : games) {
|
||||||
|
if (!game) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString id = game->id();
|
||||||
|
if (id.isEmpty() || seenIds.contains(id)) {
|
||||||
|
delete game;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
seenIds.insert(id);
|
||||||
|
newGames.append(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Game *game : newGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(
|
||||||
this,
|
this,
|
||||||
[this, games]() {
|
[this, newGames]() {
|
||||||
for (Game *game : games) {
|
for (Game *game : newGames) {
|
||||||
m_gameModel->addGame(game);
|
m_gameModel->addGame(game);
|
||||||
}
|
}
|
||||||
setImportStatus(tr("Flatpak import complete: %1 games found").arg(games.count()));
|
setImportStatus(tr("Flatpak import complete: %1 new games found").arg(newGames.count()));
|
||||||
setImporting(false);
|
setImporting(false);
|
||||||
saveLibrary();
|
saveLibrary();
|
||||||
Q_EMIT importCompleted(games.count());
|
Q_EMIT importCompleted(newGames.count());
|
||||||
},
|
},
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
});
|
});
|
||||||
|
|
@ -771,28 +990,57 @@ void App::importFromItch()
|
||||||
if (m_importing)
|
if (m_importing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const QSet<QString> existingIds = [this]() {
|
||||||
|
QSet<QString> ids;
|
||||||
|
const QList<Game *> games = m_gameModel->allGames();
|
||||||
|
for (Game *game : games) {
|
||||||
|
if (game) {
|
||||||
|
ids.insert(game->id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}();
|
||||||
|
|
||||||
setImporting(true);
|
setImporting(true);
|
||||||
setImportStatus(tr("Scanning itch.io library..."));
|
setImportStatus(tr("Scanning itch.io library..."));
|
||||||
|
|
||||||
[[maybe_unused]] auto future = QtConcurrent::run([this]() {
|
[[maybe_unused]] auto future = QtConcurrent::run([this, existingIds]() {
|
||||||
ItchImporter importer;
|
ItchImporter importer;
|
||||||
QList<Game *> games = importer.importGames();
|
QList<Game *> games = importer.importGames();
|
||||||
|
QSet<QString> seenIds = existingIds;
|
||||||
|
QList<Game *> newGames;
|
||||||
|
newGames.reserve(games.size());
|
||||||
|
|
||||||
for (Game *game : games) {
|
for (Game *game : games) {
|
||||||
|
if (!game) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString id = game->id();
|
||||||
|
if (id.isEmpty() || seenIds.contains(id)) {
|
||||||
|
delete game;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
seenIds.insert(id);
|
||||||
|
newGames.append(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Game *game : newGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(
|
||||||
this,
|
this,
|
||||||
[this, games]() {
|
[this, newGames]() {
|
||||||
for (Game *game : games) {
|
for (Game *game : newGames) {
|
||||||
m_gameModel->addGame(game);
|
m_gameModel->addGame(game);
|
||||||
}
|
}
|
||||||
setImportStatus(tr("itch.io import complete: %1 games found").arg(games.count()));
|
setImportStatus(tr("itch.io import complete: %1 new games found").arg(newGames.count()));
|
||||||
setImporting(false);
|
setImporting(false);
|
||||||
saveLibrary();
|
saveLibrary();
|
||||||
Q_EMIT importCompleted(games.count());
|
Q_EMIT importCompleted(newGames.count());
|
||||||
},
|
},
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
});
|
});
|
||||||
|
|
@ -803,28 +1051,57 @@ void App::importFromLegendary()
|
||||||
if (m_importing)
|
if (m_importing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const QSet<QString> existingIds = [this]() {
|
||||||
|
QSet<QString> ids;
|
||||||
|
const QList<Game *> games = m_gameModel->allGames();
|
||||||
|
for (Game *game : games) {
|
||||||
|
if (game) {
|
||||||
|
ids.insert(game->id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}();
|
||||||
|
|
||||||
setImporting(true);
|
setImporting(true);
|
||||||
setImportStatus(tr("Scanning Legendary library..."));
|
setImportStatus(tr("Scanning Legendary library..."));
|
||||||
|
|
||||||
[[maybe_unused]] auto future = QtConcurrent::run([this]() {
|
[[maybe_unused]] auto future = QtConcurrent::run([this, existingIds]() {
|
||||||
LegendaryImporter importer;
|
LegendaryImporter importer;
|
||||||
QList<Game *> games = importer.importGames();
|
QList<Game *> games = importer.importGames();
|
||||||
|
QSet<QString> seenIds = existingIds;
|
||||||
|
QList<Game *> newGames;
|
||||||
|
newGames.reserve(games.size());
|
||||||
|
|
||||||
for (Game *game : games) {
|
for (Game *game : games) {
|
||||||
|
if (!game) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString id = game->id();
|
||||||
|
if (id.isEmpty() || seenIds.contains(id)) {
|
||||||
|
delete game;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
seenIds.insert(id);
|
||||||
|
newGames.append(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Game *game : newGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(
|
||||||
this,
|
this,
|
||||||
[this, games]() {
|
[this, newGames]() {
|
||||||
for (Game *game : games) {
|
for (Game *game : newGames) {
|
||||||
m_gameModel->addGame(game);
|
m_gameModel->addGame(game);
|
||||||
}
|
}
|
||||||
setImportStatus(tr("Legendary import complete: %1 games found").arg(games.count()));
|
setImportStatus(tr("Legendary import complete: %1 new games found").arg(newGames.count()));
|
||||||
setImporting(false);
|
setImporting(false);
|
||||||
saveLibrary();
|
saveLibrary();
|
||||||
Q_EMIT importCompleted(games.count());
|
Q_EMIT importCompleted(newGames.count());
|
||||||
},
|
},
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
});
|
});
|
||||||
|
|
@ -835,28 +1112,57 @@ void App::importFromRetroArch()
|
||||||
if (m_importing)
|
if (m_importing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const QSet<QString> existingIds = [this]() {
|
||||||
|
QSet<QString> ids;
|
||||||
|
const QList<Game *> games = m_gameModel->allGames();
|
||||||
|
for (Game *game : games) {
|
||||||
|
if (game) {
|
||||||
|
ids.insert(game->id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}();
|
||||||
|
|
||||||
setImporting(true);
|
setImporting(true);
|
||||||
setImportStatus(tr("Scanning RetroArch playlists..."));
|
setImportStatus(tr("Scanning RetroArch playlists..."));
|
||||||
|
|
||||||
[[maybe_unused]] auto future = QtConcurrent::run([this]() {
|
[[maybe_unused]] auto future = QtConcurrent::run([this, existingIds]() {
|
||||||
RetroArchImporter importer;
|
RetroArchImporter importer;
|
||||||
QList<Game *> games = importer.importGames();
|
QList<Game *> games = importer.importGames();
|
||||||
|
QSet<QString> seenIds = existingIds;
|
||||||
|
QList<Game *> newGames;
|
||||||
|
newGames.reserve(games.size());
|
||||||
|
|
||||||
for (Game *game : games) {
|
for (Game *game : games) {
|
||||||
|
if (!game) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString id = game->id();
|
||||||
|
if (id.isEmpty() || seenIds.contains(id)) {
|
||||||
|
delete game;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
seenIds.insert(id);
|
||||||
|
newGames.append(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Game *game : newGames) {
|
||||||
game->moveToThread(this->thread());
|
game->moveToThread(this->thread());
|
||||||
game->setParent(nullptr);
|
game->setParent(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(
|
||||||
this,
|
this,
|
||||||
[this, games]() {
|
[this, newGames]() {
|
||||||
for (Game *game : games) {
|
for (Game *game : newGames) {
|
||||||
m_gameModel->addGame(game);
|
m_gameModel->addGame(game);
|
||||||
}
|
}
|
||||||
setImportStatus(tr("RetroArch import complete: %1 games found").arg(games.count()));
|
setImportStatus(tr("RetroArch import complete: %1 new games found").arg(newGames.count()));
|
||||||
setImporting(false);
|
setImporting(false);
|
||||||
saveLibrary();
|
saveLibrary();
|
||||||
Q_EMIT importCompleted(games.count());
|
Q_EMIT importCompleted(newGames.count());
|
||||||
},
|
},
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1143,7 +1143,7 @@ Kirigami.ApplicationWindow {
|
||||||
secondary: "steam"
|
secondary: "steam"
|
||||||
resourceFallback: Qt.resolvedUrl("icons/brand/steam-symbolic.svg")
|
resourceFallback: Qt.resolvedUrl("icons/brand/steam-symbolic.svg")
|
||||||
}
|
}
|
||||||
enabled: !App.importing && App.config.importSteam && !App.gameModel.hasPlatformPrefix("Steam") && App.gameModel.count >= 0
|
enabled: !App.importing && App.config.importSteam && App.gameModel.count >= 0
|
||||||
onClicked: App.importFromSteam()
|
onClicked: App.importFromSteam()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1157,7 +1157,7 @@ Kirigami.ApplicationWindow {
|
||||||
primary: "lutris"
|
primary: "lutris"
|
||||||
secondary: "applications-games"
|
secondary: "applications-games"
|
||||||
}
|
}
|
||||||
enabled: !App.importing && App.config.importLutris && !App.gameModel.hasPlatformPrefix("Lutris") && App.gameModel.count >= 0
|
enabled: !App.importing && App.config.importLutris && App.gameModel.count >= 0
|
||||||
onClicked: App.importFromLutris()
|
onClicked: App.importFromLutris()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1171,7 +1171,7 @@ Kirigami.ApplicationWindow {
|
||||||
primary: "com.heroicgameslauncher.hgl"
|
primary: "com.heroicgameslauncher.hgl"
|
||||||
secondary: "applications-games"
|
secondary: "applications-games"
|
||||||
}
|
}
|
||||||
enabled: !App.importing && App.config.importHeroic && !App.gameModel.hasPlatformPrefix("Heroic") && App.gameModel.count >= 0
|
enabled: !App.importing && App.config.importHeroic && App.gameModel.count >= 0
|
||||||
onClicked: App.importFromHeroic()
|
onClicked: App.importFromHeroic()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1185,7 +1185,7 @@ Kirigami.ApplicationWindow {
|
||||||
primary: "user-desktop"
|
primary: "user-desktop"
|
||||||
secondary: "computer"
|
secondary: "computer"
|
||||||
}
|
}
|
||||||
enabled: !App.importing && App.config.importDesktop && !App.gameModel.hasPlatformPrefix("Desktop") && App.gameModel.count >= 0
|
enabled: !App.importing && App.config.importDesktop && App.gameModel.count >= 0
|
||||||
onClicked: App.importFromDesktop()
|
onClicked: App.importFromDesktop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1199,7 +1199,7 @@ Kirigami.ApplicationWindow {
|
||||||
primary: "com.usebottles.bottles"
|
primary: "com.usebottles.bottles"
|
||||||
secondary: "application-x-executable"
|
secondary: "application-x-executable"
|
||||||
}
|
}
|
||||||
enabled: !App.importing && App.config.importBottles && !App.gameModel.hasPlatformPrefix("Bottles") && App.gameModel.count >= 0
|
enabled: !App.importing && App.config.importBottles && App.gameModel.count >= 0
|
||||||
onClicked: App.importFromBottles()
|
onClicked: App.importFromBottles()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1213,7 +1213,7 @@ Kirigami.ApplicationWindow {
|
||||||
primary: "flatpak-discover"
|
primary: "flatpak-discover"
|
||||||
secondary: "applications-games"
|
secondary: "applications-games"
|
||||||
}
|
}
|
||||||
enabled: !App.importing && App.config.importFlatpak && !App.gameModel.hasPlatformPrefix("Flatpak") && App.gameModel.count >= 0
|
enabled: !App.importing && App.config.importFlatpak && App.gameModel.count >= 0
|
||||||
onClicked: App.importFromFlatpak()
|
onClicked: App.importFromFlatpak()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1228,7 +1228,7 @@ Kirigami.ApplicationWindow {
|
||||||
secondary: "itch"
|
secondary: "itch"
|
||||||
resourceFallback: Qt.resolvedUrl("icons/brand/itchdotio-symbolic.svg")
|
resourceFallback: Qt.resolvedUrl("icons/brand/itchdotio-symbolic.svg")
|
||||||
}
|
}
|
||||||
enabled: !App.importing && App.config.importItch && !App.gameModel.hasPlatformPrefix("itch.io") && App.gameModel.count >= 0
|
enabled: !App.importing && App.config.importItch && App.gameModel.count >= 0
|
||||||
onClicked: App.importFromItch()
|
onClicked: App.importFromItch()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1242,7 +1242,7 @@ Kirigami.ApplicationWindow {
|
||||||
primary: "legendary"
|
primary: "legendary"
|
||||||
secondary: "applications-games"
|
secondary: "applications-games"
|
||||||
}
|
}
|
||||||
enabled: !App.importing && App.config.importLegendary && !App.gameModel.hasPlatformPrefix("Legendary") && App.gameModel.count >= 0
|
enabled: !App.importing && App.config.importLegendary && App.gameModel.count >= 0
|
||||||
onClicked: App.importFromLegendary()
|
onClicked: App.importFromLegendary()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1257,7 +1257,7 @@ Kirigami.ApplicationWindow {
|
||||||
secondary: "retroarch"
|
secondary: "retroarch"
|
||||||
resourceFallback: Qt.resolvedUrl("icons/brand/retroarch-symbolic.svg")
|
resourceFallback: Qt.resolvedUrl("icons/brand/retroarch-symbolic.svg")
|
||||||
}
|
}
|
||||||
enabled: !App.importing && App.config.importRetroArch && !App.gameModel.hasPlatformPrefix("RetroArch") && App.gameModel.count >= 0
|
enabled: !App.importing && App.config.importRetroArch && App.gameModel.count >= 0
|
||||||
onClicked: App.importFromRetroArch()
|
onClicked: App.importFromRetroArch()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1269,15 +1269,15 @@ Kirigami.ApplicationWindow {
|
||||||
QQC2.Button {
|
QQC2.Button {
|
||||||
text: i18n("Import All")
|
text: i18n("Import All")
|
||||||
icon.name: "document-import"
|
icon.name: "document-import"
|
||||||
enabled: !App.importing && App.gameModel.count >= 0 && ((App.config.importSteam && !App.gameModel.hasPlatformPrefix("Steam"))
|
enabled: !App.importing && App.gameModel.count >= 0 && (App.config.importSteam
|
||||||
|| (App.config.importLutris && !App.gameModel.hasPlatformPrefix("Lutris"))
|
|| App.config.importLutris
|
||||||
|| (App.config.importHeroic && !App.gameModel.hasPlatformPrefix("Heroic"))
|
|| App.config.importHeroic
|
||||||
|| (App.config.importDesktop && !App.gameModel.hasPlatformPrefix("Desktop"))
|
|| App.config.importDesktop
|
||||||
|| (App.config.importBottles && !App.gameModel.hasPlatformPrefix("Bottles"))
|
|| App.config.importBottles
|
||||||
|| (App.config.importFlatpak && !App.gameModel.hasPlatformPrefix("Flatpak"))
|
|| App.config.importFlatpak
|
||||||
|| (App.config.importItch && !App.gameModel.hasPlatformPrefix("itch.io"))
|
|| App.config.importItch
|
||||||
|| (App.config.importLegendary && !App.gameModel.hasPlatformPrefix("Legendary"))
|
|| App.config.importLegendary
|
||||||
|| (App.config.importRetroArch && !App.gameModel.hasPlatformPrefix("RetroArch")))
|
|| App.config.importRetroArch)
|
||||||
onClicked: App.importAllGames()
|
onClicked: App.importAllGames()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -643,15 +643,15 @@ FormCard.FormHeader {
|
||||||
text: i18n("Import All Games")
|
text: i18n("Import All Games")
|
||||||
description: i18n("Scan all enabled sources")
|
description: i18n("Scan all enabled sources")
|
||||||
icon.name: "document-import"
|
icon.name: "document-import"
|
||||||
enabled: !App.importing && App.gameModel.count >= 0 && ((App.config.importSteam && !App.gameModel.hasPlatformPrefix("Steam"))
|
enabled: !App.importing && App.gameModel.count >= 0 && (App.config.importSteam
|
||||||
|| (App.config.importLutris && !App.gameModel.hasPlatformPrefix("Lutris"))
|
|| App.config.importLutris
|
||||||
|| (App.config.importHeroic && !App.gameModel.hasPlatformPrefix("Heroic"))
|
|| App.config.importHeroic
|
||||||
|| (App.config.importDesktop && !App.gameModel.hasPlatformPrefix("Desktop"))
|
|| App.config.importDesktop
|
||||||
|| (App.config.importBottles && !App.gameModel.hasPlatformPrefix("Bottles"))
|
|| App.config.importBottles
|
||||||
|| (App.config.importFlatpak && !App.gameModel.hasPlatformPrefix("Flatpak"))
|
|| App.config.importFlatpak
|
||||||
|| (App.config.importItch && !App.gameModel.hasPlatformPrefix("itch.io"))
|
|| App.config.importItch
|
||||||
|| (App.config.importLegendary && !App.gameModel.hasPlatformPrefix("Legendary"))
|
|| App.config.importLegendary
|
||||||
|| (App.config.importRetroArch && !App.gameModel.hasPlatformPrefix("RetroArch")))
|
|| App.config.importRetroArch)
|
||||||
onClicked: App.importAllGames()
|
onClicked: App.importAllGames()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue