summaryrefslogtreecommitdiff
path: root/src/manager-lib/packagemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/manager-lib/packagemanager.cpp')
-rw-r--r--src/manager-lib/packagemanager.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/manager-lib/packagemanager.cpp b/src/manager-lib/packagemanager.cpp
index c174665f..7243a035 100644
--- a/src/manager-lib/packagemanager.cpp
+++ b/src/manager-lib/packagemanager.cpp
@@ -85,6 +85,10 @@
application manager's \l{Configuration} will just lead to package (de-) installations
failing instantly.
+ Please be aware that setting the \c{applications/installationDirMountPoint} configuration
+ option might delay the initialization of the package database. In this case, make sure to check
+ that the \l ready property is \c true before interacting with the PackageManager.
+
The type is derived from \c QAbstractListModel, so it can be used directly as a model from QML.
\target PackageManager Roles
@@ -379,6 +383,8 @@ void PackageManager::registerPackages()
// now that we have a consistent pkg db, we can clean up the installed packages
cleanupBrokenInstallations();
+ emit readyChanged(d->cleanupBrokenInstallationsDone);
+
#if !defined(AM_DISABLE_INSTALLER)
// something might have been queued already before the cleanup had finished
triggerExecuteNextTask();
@@ -674,6 +680,22 @@ int PackageManager::indexOfPackage(const QString &id) const
return -1;
}
+/*!
+ \qmlproperty bool PackageManager::ready
+
+ Loading the package database might be delayed at startup if the
+ \c{applications/installationDirMountPoint} configuration option is set.
+
+ If your system is relying on this behavior, you should always check if the \l ready property is
+ \c true before accessing information about installed packages.
+ \note Calls to startPackageInstallation() and removePackage() while ready is still \c false
+ will be queued and executed once the package database is fully loaded.
+*/
+bool PackageManager::isReady() const
+{
+ return d->cleanupBrokenInstallationsDone;
+}
+
bool PackageManager::developmentMode() const
{
return d->developmentMode;