Ticket #2074: 0002-Delete-profile-data-only-when-erased.patch.6

File 0002-Delete-profile-data-only-when-erased.patch.6, 2.1 KB (added by tch, 14 years ago)
Line 
1From 716ce8473ab38edf47eb681925c42d6f24779092 Mon Sep 17 00:00:00 2001
2From: Martin Abente <mabente@paraguayeduca.org>
3Date: Tue, 6 Jul 2010 15:39:48 -0400
4Subject: [PATCH] Delete profile data only when erased #2074
5Organization: Paraguay Educa
6
7Profile data should be deleted _only_ when the
8user explicitly erases the activity from the
9activities list.
10
11Signed-off-by: Martin Abente <mabente@paraguayeduca.org>
12---
13 src/jarabe/desktop/activitieslist.py |    2 +-
14 src/jarabe/model/bundleregistry.py   |    4 ++--
15 2 files changed, 3 insertions(+), 3 deletions(-)
16
17diff --git a/src/jarabe/desktop/activitieslist.py b/src/jarabe/desktop/activitieslist.py
18index e14d0f7..c14d31e 100644
19--- a/src/jarabe/desktop/activitieslist.py
20+++ b/src/jarabe/desktop/activitieslist.py
21@@ -371,7 +371,7 @@ class ActivitiesList(gtk.VBox):
22         if response_id == gtk.RESPONSE_OK:
23             registry = bundleregistry.get_registry()
24             bundle = registry.get_bundle(bundle_id)
25-            registry.uninstall(bundle)
26+            registry.uninstall(bundle, delete_profile=True)
27 
28 class ActivityListPalette(ActivityPalette):
29     __gtype_name__ = 'SugarActivityListPalette'
30diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py
31index 858655f..b96de86 100644
32--- a/src/jarabe/model/bundleregistry.py
33+++ b/src/jarabe/model/bundleregistry.py
34@@ -386,7 +386,7 @@ class BundleRegistry(gobject.GObject):
35         elif not self.add_bundle(install_path):
36             raise RegistrationException
37 
38-    def uninstall(self, bundle, force=False):       
39+    def uninstall(self, bundle, force=False, delete_profile=False):
40         # TODO treat ContentBundle in special way
41         # needs rethinking while fixing ContentBundle support
42         if isinstance(bundle, ContentBundle) or \
43@@ -409,7 +409,7 @@ class BundleRegistry(gobject.GObject):
44 
45         install_path = act.get_path()
46 
47-        bundle.uninstall(install_path, force)
48+        bundle.uninstall(install_path, force, delete_profile)
49 
50         if not self.remove_bundle(install_path):
51             raise RegistrationException
52--
531.6.0.4
54