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

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