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

File 0002-Delete-profile-data-only-when-erased.3.patch, 2.0 KB (added by tch, 14 years ago)
  • src/jarabe/desktop/activitieslist.py

    From c0dcfaf0a0aa3fadc0c9b4c5b7f40fb0f98f21b8 Mon Sep 17 00:00:00 2001
    From: Martin Abente <mabente@paraguayeduca.org>
    Date: Tue, 6 Jul 2010 15:39:48 -0400
    Subject: [PATCH] Delete profile data only when erased
    Organization: Paraguay Educa
    
    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 b class ActivitiesList(gtk.VBox): 
    376376        if response_id == gtk.RESPONSE_OK:
    377377            registry = bundleregistry.get_registry()
    378378            bundle = registry.get_bundle(bundle_id)
    379             registry.uninstall(bundle)
     379            registry.uninstall(bundle, delete_profile=True)
    380380
    381381class ActivityListPalette(ActivityPalette):
    382382    __gtype_name__ = 'SugarActivityListPalette'
  • src/jarabe/model/bundleregistry.py

    diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py
    index 86a2738..ae42583 100644
    a b class BundleRegistry(gobject.GObject): 
    376376        elif not self.add_bundle(install_path):
    377377            raise RegistrationException
    378378
    379     def uninstall(self, bundle, force=False):       
     379    def uninstall(self, bundle, force=False, delete_profile=False):
    380380        # TODO treat ContentBundle in special way
    381381        # needs rethinking while fixing ContentBundle support
    382382        if isinstance(bundle, ContentBundle) or \
    class BundleRegistry(gobject.GObject): 
    399399
    400400        install_path = act.get_path()
    401401
    402         bundle.uninstall(install_path, force)
     402        bundle.uninstall(install_path, force, delete_profile)
    403403
    404404        if not self.remove_bundle(install_path):
    405405            raise RegistrationException