summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <[email protected]>2017-04-19 14:51:56 +0200
committerAleix Pol <[email protected]>2017-04-19 14:51:56 +0200
commitb464b2ef5ae723f4e00a986067da77ad4b670e36 (patch)
treefdcdfc81d643b956230d47dcde62a31bec63a537
parentf3d4cbdbe7d5b9f6b206a1aace16ca8c0f5a73c6 (diff)
Simplify
-rw-r--r--libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp b/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
index 020e0ac..fcc8f12 100644
--- a/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
+++ b/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
@@ -422,7 +422,7 @@ void FlatpakBackend::addResource(FlatpakResource *resource)
qWarning() << "Failed to parse metadata from app bundle for " << resource->name();
}
- auto installation = resource->scope() == FlatpakResource::System ? m_flatpakInstallationSystem : m_flatpakInstallationUser;
+ auto installation = flatpakInstallationForAppScope(resource->scope());
updateAppState(installation, resource);
// This will update also metadata (required runtime)
@@ -1004,7 +1004,7 @@ void FlatpakBackend::installApplication(AbstractResource *app, const AddonList &
}
FlatpakTransaction *transaction = nullptr;
- FlatpakInstallation *installation = resource->scope() == FlatpakResource::System ? m_flatpakInstallationSystem : m_flatpakInstallationUser;
+ FlatpakInstallation *installation = flatpakInstallationForAppScope(resource->scope());
if (resource->propertyState(FlatpakResource::RequiredRuntime) == FlatpakResource::NotKnownYet && resource->type() == FlatpakResource::DesktopApp) {
transaction = new FlatpakTransaction(installation, resource, Transaction::InstallRole, true);
@@ -1054,7 +1054,7 @@ void FlatpakBackend::removeApplication(AbstractResource *app)
return;
}
- FlatpakInstallation *installation = resource->scope() == FlatpakResource::System ? m_flatpakInstallationSystem : m_flatpakInstallationUser;
+ FlatpakInstallation *installation = flatpakInstallationForAppScope(resource->scope());
FlatpakTransaction *transaction = new FlatpakTransaction(installation, resource, Transaction::RemoveRole);
connect(transaction, &FlatpakTransaction::statusChanged, [this, installation, resource] (Transaction::Status status) {