diff options
author | Daniel Nicoletti <dantti12@gmail.com> | 2012-04-18 10:52:18 -0300 |
---|---|---|
committer | Daniel Nicoletti <dantti12@gmail.com> | 2012-04-18 10:52:18 -0300 |
commit | 9f893b55bc932a9be22dd194be33b3f657135108 (patch) | |
tree | 49ba555e41c15316db3863e9499f88b5bb9ec1f0 | |
parent | 3e1c648c2844eab3ddf457f02cf0adae44602d21 (diff) |
pk-qt2: Add simulateRepairSystem and repairSystem(bool) to the Transaction API
-rw-r--r-- | lib/packagekit-qt2/transaction.cpp | 10 | ||||
-rw-r--r-- | lib/packagekit-qt2/transaction.h | 14 |
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/packagekit-qt2/transaction.cpp b/lib/packagekit-qt2/transaction.cpp index 6ea12cf5..5b2390d5 100644 --- a/lib/packagekit-qt2/transaction.cpp +++ b/lib/packagekit-qt2/transaction.cpp @@ -479,6 +479,11 @@ void Transaction::removePackage(const Package &package, bool allowDeps, bool aut removePackages(QList<Package>() << package, allowDeps, autoremove); } +void Transaction::repairSystem(bool onlyTrusted) +{ + RUN_TRANSACTION(RepairSystem(onlyTrusted)) +} + void Transaction::repoEnable(const QString &repoId, bool enable) { RUN_TRANSACTION(RepoEnable(repoId, enable)) @@ -594,6 +599,11 @@ void Transaction::simulateUpdatePackage(const Package &package) simulateUpdatePackages(QList<Package>() << package); } +void Transaction::simulateRepairSystem() +{ + RUN_TRANSACTION(SimulateRepairSystem()) +} + void Transaction::updatePackages(const QList<Package> &packages, bool onlyTrusted) { RUN_TRANSACTION(UpdatePackages(onlyTrusted, Util::packageListToPids(packages))) diff --git a/lib/packagekit-qt2/transaction.h b/lib/packagekit-qt2/transaction.h index b819771b..2d0ffb40 100644 --- a/lib/packagekit-qt2/transaction.h +++ b/lib/packagekit-qt2/transaction.h @@ -756,6 +756,12 @@ public: void removePackage(const Package &package, bool allowDeps = false, bool autoRemove = false); /** + * Repairs a broken system + * \sa simulateRepairSystem(); + */ + void repairSystem(bool onlyTrusted = true); + + /** * Activates or disables a repository */ void repoEnable(const QString &repoId, bool enable = true); @@ -930,6 +936,14 @@ public: void simulateUpdatePackage(const Package &package); /** + * Tries to fix a broken system + * \note this function will emit packages that describe the actions + * the backend will take + * \sa repairSystem(bool); + */ + void simulateRepairSystem(); + + /** * Update the given \p packages * * \p onlyTrusted indicates if this transaction is only allowed to install trusted packages |