Trigger per-source import when import source is re-enabled

This commit is contained in:
Marco Allegretti 2026-03-23 13:06:28 +01:00
parent 834b3a2ab6
commit 40a7b823ba

View file

@ -98,6 +98,8 @@ App::App(QObject *parent)
if (m_gameModel->removeByPlatformPrefix(QStringLiteral("Steam")) > 0) { if (m_gameModel->removeByPlatformPrefix(QStringLiteral("Steam")) > 0) {
saveLibrary(); saveLibrary();
} }
} else {
importFromSteam();
} }
}); });
connect(m_config, &Config::importLutrisChanged, this, [this]() { connect(m_config, &Config::importLutrisChanged, this, [this]() {
@ -105,6 +107,8 @@ App::App(QObject *parent)
if (m_gameModel->removeByPlatformPrefix(QStringLiteral("Lutris")) > 0) { if (m_gameModel->removeByPlatformPrefix(QStringLiteral("Lutris")) > 0) {
saveLibrary(); saveLibrary();
} }
} else {
importFromLutris();
} }
}); });
connect(m_config, &Config::importHeroicChanged, this, [this]() { connect(m_config, &Config::importHeroicChanged, this, [this]() {
@ -112,6 +116,8 @@ App::App(QObject *parent)
if (m_gameModel->removeByPlatformPrefix(QStringLiteral("Heroic")) > 0) { if (m_gameModel->removeByPlatformPrefix(QStringLiteral("Heroic")) > 0) {
saveLibrary(); saveLibrary();
} }
} else {
importFromHeroic();
} }
}); });
connect(m_config, &Config::importDesktopChanged, this, [this]() { connect(m_config, &Config::importDesktopChanged, this, [this]() {
@ -119,6 +125,8 @@ App::App(QObject *parent)
if (m_gameModel->removeByPlatformPrefix(QStringLiteral("Desktop")) > 0) { if (m_gameModel->removeByPlatformPrefix(QStringLiteral("Desktop")) > 0) {
saveLibrary(); saveLibrary();
} }
} else {
importFromDesktop();
} }
}); });
connect(m_config, &Config::importBottlesChanged, this, [this]() { connect(m_config, &Config::importBottlesChanged, this, [this]() {
@ -126,6 +134,8 @@ App::App(QObject *parent)
if (m_gameModel->removeByPlatformPrefix(QStringLiteral("Bottles")) > 0) { if (m_gameModel->removeByPlatformPrefix(QStringLiteral("Bottles")) > 0) {
saveLibrary(); saveLibrary();
} }
} else {
importFromBottles();
} }
}); });
connect(m_config, &Config::importFlatpakChanged, this, [this]() { connect(m_config, &Config::importFlatpakChanged, this, [this]() {
@ -133,6 +143,8 @@ App::App(QObject *parent)
if (m_gameModel->removeByPlatformPrefix(QStringLiteral("Flatpak")) > 0) { if (m_gameModel->removeByPlatformPrefix(QStringLiteral("Flatpak")) > 0) {
saveLibrary(); saveLibrary();
} }
} else {
importFromFlatpak();
} }
}); });
connect(m_config, &Config::importItchChanged, this, [this]() { connect(m_config, &Config::importItchChanged, this, [this]() {
@ -140,6 +152,8 @@ App::App(QObject *parent)
if (m_gameModel->removeByPlatformPrefix(QStringLiteral("itch.io")) > 0) { if (m_gameModel->removeByPlatformPrefix(QStringLiteral("itch.io")) > 0) {
saveLibrary(); saveLibrary();
} }
} else {
importFromItch();
} }
}); });
connect(m_config, &Config::importLegendaryChanged, this, [this]() { connect(m_config, &Config::importLegendaryChanged, this, [this]() {
@ -147,6 +161,8 @@ App::App(QObject *parent)
if (m_gameModel->removeByPlatformPrefix(QStringLiteral("Legendary")) > 0) { if (m_gameModel->removeByPlatformPrefix(QStringLiteral("Legendary")) > 0) {
saveLibrary(); saveLibrary();
} }
} else {
importFromLegendary();
} }
}); });
connect(m_config, &Config::importRetroArchChanged, this, [this]() { connect(m_config, &Config::importRetroArchChanged, this, [this]() {
@ -154,6 +170,8 @@ App::App(QObject *parent)
if (m_gameModel->removeByPlatformPrefix(QStringLiteral("RetroArch")) > 0) { if (m_gameModel->removeByPlatformPrefix(QStringLiteral("RetroArch")) > 0) {
saveLibrary(); saveLibrary();
} }
} else {
importFromRetroArch();
} }
}); });
} }