Hi,
one patch for sugar and the other for sugar-toolkit.
Thanks,
Tomeu
From 536ac3b775ea7c10955cce6f583a7f7804584189 Mon Sep 17 00:00:00 2001
From: Tomeu Vizoso <[EMAIL PROTECTED]>
Date: Thu, 26 Jun 2008 15:07:23 +0200
Subject: [PATCH] #7046: Fix removal of activities
---
src/view/home/activitieslist.py | 4 ++--
src/view/home/favoriteslayout.py | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/view/home/activitieslist.py b/src/view/home/activitieslist.py
index e542859..da34515 100644
--- a/src/view/home/activitieslist.py
+++ b/src/view/home/activitieslist.py
@@ -65,10 +65,10 @@ class ActivitiesList(gtk.ScrolledWindow):
self._add_activity(activity_info)
def __activity_removed_cb(self, activity_registry, activity_info):
- for entry in self.get_children():
+ for entry in self._box.get_children():
if entry.get_bundle_id() == activity_info.bundle_id and \
entry.get_version() == activity_info.version:
- self.remove(entry)
+ self._box.remove(entry)
return
def _compare_activities(self, entry_a, entry_b):
diff --git a/src/view/home/favoriteslayout.py b/src/view/home/favoriteslayout.py
index 0400350..9329fe1 100644
--- a/src/view/home/favoriteslayout.py
+++ b/src/view/home/favoriteslayout.py
@@ -64,7 +64,8 @@ class FavoritesLayout(gobject.GObject, hippo.CanvasLayout):
int(relative_y * _BASE_SCALE / float(height)))
def remove(self, icon):
- del self.fixed_positions[icon]
+ if icon in self.fixed_positions:
+ del self.fixed_positions[icon]
self.box.remove(icon)
def move_icon(self, icon, x, y, locked=False):
--
1.5.4.3
From 9de71ff9011c2b93ecf318aa04e540d5a7b8ee81 Mon Sep 17 00:00:00 2001
From: Tomeu Vizoso <[EMAIL PROTECTED]>
Date: Thu, 26 Jun 2008 15:07:27 +0200
Subject: [PATCH] #7046: Fix removal of activities
---
src/sugar/bundle/activitybundle.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/sugar/bundle/activitybundle.py b/src/sugar/bundle/activitybundle.py
index 6607e96..b126bd3 100644
--- a/src/sugar/bundle/activitybundle.py
+++ b/src/sugar/bundle/activitybundle.py
@@ -23,8 +23,7 @@ import os
import tempfile
from sugar.bundle.bundle import Bundle, MalformedBundleException, \
- AlreadyInstalledException, RegistrationException, \
- NotInstalledException
+ AlreadyInstalledException, RegistrationException, NotInstalledException
from sugar import activity
from sugar import env
@@ -55,6 +54,7 @@ class ActivityBundle(Bundle):
self._mime_types = None
self._show_launcher = True
self._activity_version = 0
+ self._installation_time = os.stat(path).st_mtime
info_file = self.get_file('activity/activity.info')
if info_file is None:
@@ -65,7 +65,7 @@ class ActivityBundle(Bundle):
if linfo_file:
self._parse_linfo(linfo_file)
- self.manifest = None #This should be replaced by following function
+ self.manifest = None # This should be replaced by following function
self.read_manifest()
def _raw_manifest(self):
@@ -226,7 +226,7 @@ class ActivityBundle(Bundle):
def get_installation_time(self):
"""Get a timestamp representing the time at which this activity was
installed."""
- return os.stat(self._path).st_mtime
+ return self._installation_time
def get_bundle_id(self):
"""Get the activity bundle id"""
--
1.5.4.3
_______________________________________________
Sugar mailing list
[email protected]
http://lists.laptop.org/listinfo/sugar