[bt-devel] RFC: Remove modules installed by the native package manager

Sveinung Kvilhaugsvik sveinung84 at users.sourceforge.net
Mon Apr 27 11:21:58 MST 2009


Added run time detection for PackageKit

=== modified file 'ChangeLog'
--- ChangeLog	2009-04-27 14:29:18 +0000
+++ ChangeLog	2009-04-27 14:36:24 +0000
@@ -1,5 +1,6 @@
 2009-04-27 Sveinung Kvilhaugsvik <sveinung84 at users.sourceforge.net>
     * Made cmake detect PackageKit
+    * Added run time detection for PackageKit

 2009-04-26 Gary Holmlund
 	* Fix clicking of links in the Mag Window.

=== modified file 'src/frontend/bookshelfmanager/removepage/btremovepage.cpp'
--- src/frontend/bookshelfmanager/removepage/btremovepage.cpp	2009-04-27
14:24:38 +0000
+++ src/frontend/bookshelfmanager/removepage/btremovepage.cpp	2009-04-27
14:36:24 +0000
@@ -151,6 +151,22 @@
 		// Update the module list before really removing. Remember deleting
the pointers later.
 		QList<CSwordModuleInfo*> toBeDeleted =
CPointers::backend()->takeModulesFromList(moduleNames);

+#ifdef PackageKitFound
+		bool canUsePackageKit = false;
+		using PackageKit::Client;
+
+		Client::Actions supportedActions = Client::instance()->getActions();
+		if (supportedActions.contains(Client::ActionSearchFile)
+		  && supportedActions.contains(Client::ActionRemovePackages)) {
+		    /* Requireing FilterInstalled guarantees that only the package
+		       that actually are installed will be returned */
+		    if ((Client::instance()->getFilters()).contains(Client::FilterInstalled))
{
+			canUsePackageKit = true;
+			Client::instance()->setLocale(QLocale::system().name() );
+		    }
+		};
+#endif
+
 		sword::InstallMgr installMgr;
 		QMap<QString, sword::SWMgr*> mgrDict; //maps config paths to SWMgr objects
 		foreach ( CSwordModuleInfo* mInfo, toBeDeleted ) {

=== modified file 'src/frontend/bookshelfmanager/removepage/btremovepage.h'
--- src/frontend/bookshelfmanager/removepage/btremovepage.h	2008-05-22
09:49:25 +0000
+++ src/frontend/bookshelfmanager/removepage/btremovepage.h	2009-04-27
14:36:24 +0000
@@ -17,6 +17,10 @@
 #include <QString>
 #include <QMultiMap>

+#ifdef PackageKitFound
+#include <QPackageKit>
+#endif
+
 //class BTModuleTreeItem;

 class QTreeWidget;



More information about the bt-devel mailing list