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): |
376 | 376 | if response_id == gtk.RESPONSE_OK: |
377 | 377 | registry = bundleregistry.get_registry() |
378 | 378 | bundle = registry.get_bundle(bundle_id) |
379 | | registry.uninstall(bundle) |
| 379 | registry.uninstall(bundle, delete_profile=True) |
380 | 380 | |
381 | 381 | class ActivityListPalette(ActivityPalette): |
382 | 382 | __gtype_name__ = 'SugarActivityListPalette' |
diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py
index 86a2738..ae42583 100644
a
|
b
|
class BundleRegistry(gobject.GObject): |
376 | 376 | elif not self.add_bundle(install_path): |
377 | 377 | raise RegistrationException |
378 | 378 | |
379 | | def uninstall(self, bundle, force=False): |
| 379 | def uninstall(self, bundle, force=False, delete_profile=False): |
380 | 380 | # TODO treat ContentBundle in special way |
381 | 381 | # needs rethinking while fixing ContentBundle support |
382 | 382 | if isinstance(bundle, ContentBundle) or \ |
… |
… |
class BundleRegistry(gobject.GObject): |
399 | 399 | |
400 | 400 | install_path = act.get_path() |
401 | 401 | |
402 | | bundle.uninstall(install_path, force) |
| 402 | bundle.uninstall(install_path, force, delete_profile) |
403 | 403 | |
404 | 404 | if not self.remove_bundle(install_path): |
405 | 405 | raise RegistrationException |