GTG

Merge lp:~invernizzi/gtg/tomboy-fix into lp:~gtg/gtg/old-trunk

Proposed by Luca Invernizzi
Status: Merged
Merge reported by: Luca Invernizzi
Merged at revision: not available
Proposed branch: lp:~invernizzi/gtg/tomboy-fix
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: 23 lines (+3/-2)
1 file modified
GTG/plugins/tomboy/tomboy.py (+3/-2)
To merge this branch: bzr merge lp:~invernizzi/gtg/tomboy-fix
Reviewer Review Type Date Requested Status
Lionel Dricot (community) Approve
Bertrand Rousseau (community) Approve
Review via email: mp+15973@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Luca Invernizzi (invernizzi) wrote :

This is a very small fix, please consider it for merging.
I won't be here all day, so if you accept please merge it yourselves.

Revision history for this message
Bertrand Rousseau (bertrand-rousseau) :
review: Approve
Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

Hello Luca, can you explain a bit more what you are doing?

I don't understand why you are removing the self.activated and how the new check fix the bug.

Thanks

review: Needs Information
Revision history for this message
Luca Invernizzi (invernizzi) wrote :

sure.
The check checkTomboyPresent() has been introduced after removing the dbus dependency of the plugin (because looking for tomboy in dbus launches tomboy as a side effect). checkTomboyPresent() simply checks that tomboy is installed.
In order to avoid checking each time that some action require tomboy presence, the plugin checks once per run and then sets the self.activated flag to true.

The self.activated = True in the fist line in onTaskOpened is what causes the problem. Is a leftover of before the intruduction of checkTomboyPresent().
In practice, it disables the following check of tomboy presence, because checkTomboyPresent() skips the check since self.activated is already set to true.

The other modification, in addButtonToToolbar(), shouldn't be needed, since the check of tomboy presence should happen before. I put it there because, in case anything goes wrong, it gracefully disables the plugin without making it crash.

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

Thanks for the information, I understand better now and, indeed, this should be unlikely to break something.

Agreed for 0.2 then.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GTG/plugins/tomboy/tomboy.py'
2--- GTG/plugins/tomboy/tomboy.py 2009-12-03 09:59:33 +0000
3+++ GTG/plugins/tomboy/tomboy.py 2009-12-10 18:43:12 +0000
4@@ -113,6 +113,8 @@
5
6 # adds a item(button) to the ToolBar, with a nice icon
7 def addButtonToToolbar(self, plugin_api):
8+ if not self.checkTomboyPresent():
9+ return
10 tb_Taskbutton_image = gtk.Image()
11 tb_Taskbutton_image_path = self.tomboy_icon_path
12 tb_Taskbutton_pixbuf=gtk.gdk.\
13@@ -158,9 +160,8 @@
14 token_ending = text.find(self.token_end)
15
16 def onTaskOpened(self, plugin_api):
17- self.activated = True
18 if not self.checkTomboyPresent():
19- return False
20+ return
21 #NOTE: get_textview() only works in this function
22 # (see GTG/core/plugins/api.py docs)
23 self.textview = plugin_api.get_textview()

Subscribers

People subscribed via source and target branches

to status/vote changes: