summaryrefslogtreecommitdiff
path: root/src/application-lib/packagedatabase.cpp
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@pelagicore.com>2019-07-26 12:33:27 +0200
committerRobert Griebl <robert.griebl@pelagicore.com>2019-08-02 14:57:33 +0200
commit5b0c0787c975e27d87111754f98255c1a1dfff32 (patch)
tree255b634e32eab223e8f33d6e5f32bb5b023b9f71 /src/application-lib/packagedatabase.cpp
parent3c28fe19b6419fdb1f5a91670b5bd222fa3a619c (diff)
downloadqtapplicationmanager-5b0c0787c975e27d87111754f98255c1a1dfff32.tar.gz
Remove support for multiple installation locations
We had removed support for SD-Card (removable location) installations in a previous patch. Supporting multiple non-removable locations adds a lot of complexity to the AM's installer that isn't really needed, since modern Linux kernels can support these niche use-cases much more transparently through the device mapper/lvm infrastructure. Change-Id: Iaf10d2eb28b9d61e54c5268bcbdd623005b8508d Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
Diffstat (limited to 'src/application-lib/packagedatabase.cpp')
-rw-r--r--src/application-lib/packagedatabase.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/application-lib/packagedatabase.cpp b/src/application-lib/packagedatabase.cpp
index 6ca32e1c..2b49a7db 100644
--- a/src/application-lib/packagedatabase.cpp
+++ b/src/application-lib/packagedatabase.cpp
@@ -53,10 +53,10 @@
QT_BEGIN_NAMESPACE_AM
-PackageDatabase::PackageDatabase(const QStringList &builtInAppsDirs,
- const QString &installedAppsDir)
- : m_builtInAppsDirs(builtInAppsDirs)
- , m_installedAppsDir(installedAppsDir)
+PackageDatabase::PackageDatabase(const QStringList &builtInPackagesDirs,
+ const QString &installedPackagesDir)
+ : m_builtInPackagesDirs(builtInPackagesDirs)
+ , m_installedPackagesDir(installedPackagesDir)
{ }
PackageDatabase::PackageDatabase(const QString &singlePackagePath)
@@ -65,6 +65,11 @@ PackageDatabase::PackageDatabase(const QString &singlePackagePath)
Q_ASSERT(!singlePackagePath.isEmpty());
}
+QString PackageDatabase::installedPackagesDir() const
+{
+ return m_installedPackagesDir;
+}
+
void PackageDatabase::enableLoadFromCache()
{
if (m_parsed)
@@ -151,6 +156,7 @@ QMap<PackageInfo *, QString> PackageDatabase::loadManifestsFromDir(YamlPackageSc
throw Exception(f, "failed to deserialize the installation report");
pkg->setInstallationReport(report.take());
+ pkg->setBaseDir(QDir(m_installedPackagesDir).filePath(pkg->id()));
}
result.insert(pkg.take(), manifestPath);
} catch (const Exception &e) {
@@ -191,11 +197,11 @@ void PackageDatabase::parse()
throw Exception("Failed to load manifest for package: %1").arg(e.errorString());
}
} else {
- for (const QString &dir : m_builtInAppsDirs)
+ for (const QString &dir : m_builtInPackagesDirs)
m_builtInPackages.unite(loadManifestsFromDir(&yps, dir, true));
- if (!m_installedAppsDir.isEmpty())
- m_installedPackages = loadManifestsFromDir(&yps, m_installedAppsDir, false);
+ if (!m_installedPackagesDir.isEmpty())
+ m_installedPackages = loadManifestsFromDir(&yps, m_installedPackagesDir, false);
}
if (m_saveToCache)