Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-06-07 11:07:25 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-06-07 11:07:25 (GMT)
commit340fcc271d23f74c5d53a50e522d345c5817b79c (patch)
tree58f4b18d0f2202d60ffe7ec24f16d7c57b474165
parentfde3159002f659906c889f897e7de41af8cf38b0 (diff)
set_state() could be called when there are still no formats.
-rw-r--r--shell/view/clipboardicon.py5
-rw-r--r--shell/view/frame/clipboardpanelwindow.py4
2 files changed, 6 insertions, 3 deletions
diff --git a/shell/view/clipboardicon.py b/shell/view/clipboardicon.py
index fc609f6..02edb65 100644
--- a/shell/view/clipboardicon.py
+++ b/shell/view/clipboardicon.py
@@ -91,7 +91,10 @@ class ClipboardIcon(CanvasIcon):
def set_state(self, name, percent, icon_name, preview, activity):
cb_service = clipboardservice.get_instance()
obj = cb_service.get_object(self._object_id)
- installable = (obj['FORMATS'][0] == 'application/vnd.olpc-x-sugar')
+ if obj['FORMATS'] and obj['FORMATS'][0] == 'application/vnd.olpc-x-sugar':
+ installable = True
+ else:
+ installable = False
self._name = name
self._percent = percent
diff --git a/shell/view/frame/clipboardpanelwindow.py b/shell/view/frame/clipboardpanelwindow.py
index 0eb8b1d..75e2998 100644
--- a/shell/view/frame/clipboardpanelwindow.py
+++ b/shell/view/frame/clipboardpanelwindow.py
@@ -46,11 +46,11 @@ class ClipboardPanelWindow(FrameWindow):
self.connect("drag_data_get", self._clipboard_box.drag_data_get_cb)
def _owner_change_cb(self, clipboard, event):
+ logging.debug("owner_change_cb")
+
if self._clipboard_box.owns_clipboard():
return
- logging.debug("owner_change_cb")
-
cb_service = clipboardservice.get_instance()
key = cb_service.add_object(name="")
cb_service.set_object_percent(key, percent = 100)