Subject: [PATCH] Delete profile data only when erased

From: Martin Abente <[email-masked]>
Date: Tue, 6 Jul 2010 15:39:48 -0400

Profile data should be deleted _only_ when the
user explicitly erases the activity from the
activities list.
---
 src/jarabe/desktop/activitieslist.py |    2 +-
 src/jarabe/model/bundleregistry.py   |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/jarabe/desktop/activitieslist.py b/src/jarabe/desktop/activitieslist.py
index 87f2af0..0bd5aab 100644
--- a/src/jarabe/desktop/activitieslist.py
+++ b/src/jarabe/desktop/activitieslist.py
@@ -376,7 +376,7 @@ class ActivitiesList(gtk.VBox):
         if response_id == gtk.RESPONSE_OK:
             registry = bundleregistry.get_registry()
             bundle = registry.get_bundle(bundle_id)
-            registry.uninstall(bundle)
+            registry.uninstall(bundle, delete_profile=True)
 
 class ActivityListPalette(ActivityPalette):
     __gtype_name__ = 'SugarActivityListPalette'
diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py
index 86a2738..ae42583 100644
--- a/src/jarabe/model/bundleregistry.py
+++ b/src/jarabe/model/bundleregistry.py
@@ -376,7 +376,7 @@ class BundleRegistry(gobject.GObject):
         elif not self.add_bundle(install_path):
             raise RegistrationException
 
-    def uninstall(self, bundle, force=False):        
+    def uninstall(self, bundle, force=False, delete_profile=False):
         # TODO treat ContentBundle in special way
         # needs rethinking while fixing ContentBundle support
         if isinstance(bundle, ContentBundle) or \
@@ -399,7 +399,7 @@ class BundleRegistry(gobject.GObject):
 
         install_path = act.get_path()
 
-        bundle.uninstall(install_path, force)
+        bundle.uninstall(install_path, force, delete_profile)
 
         if not self.remove_bundle(install_path):
             raise RegistrationException
-- 
1.6.0.4