Merge lp:~stefan-schwarzburg/qreator/fixes_1173709 into lp:qreator

Proposed by Schwarzburg
Status: Merged
Merged at revision: 159
Proposed branch: lp:~stefan-schwarzburg/qreator/fixes_1173709
Merge into: lp:qreator
Diff against target: 21 lines (+2/-2)
1 file modified
qreator/qrcodes/QRCodeURLGtk.py (+2/-2)
To merge this branch: bzr merge lp:~stefan-schwarzburg/qreator/fixes_1173709
Reviewer Review Type Date Requested Status
David Planella Approve
Review via email: mp+163099@code.launchpad.net

Description of the change

This branch fixes a stupid mistake: I used return as a function "return()" instead of a statement "return ".
Somehow this resulted in problems with the Gtk code: the function "_shorten_and_display" was started via "idle_add", which either expects "False" (do not run again) or "True" (run again). Calling "return " seems to count as "False", however "return()", which returns an empty list, does not count as "False", but also not as "True". This somehow caused Gtk to crash.

To post a comment you must log in.
Revision history for this message
David Planella (dpm) wrote :

Thanks for looking into this! An easy error to fix, but it must have been a hard one to catch.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qreator/qrcodes/QRCodeURLGtk.py'
2--- qreator/qrcodes/QRCodeURLGtk.py 2013-05-08 18:21:38 +0000
3+++ qreator/qrcodes/QRCodeURLGtk.py 2013-05-09 07:37:27 +0000
4@@ -179,7 +179,7 @@
5 _("A network connection error occured: {0}".format(e)))
6 self.messagedialog.show()
7 GObject.idle_add(self._reset_shortener)
8- return()
9+ return
10 except Exception as e:
11 # TRANSLATORS: leave '{0}' as it is, it will be replaced by the
12 # exception's error message
13@@ -187,7 +187,7 @@
14 _("An error occured while trying to shorten the URL: {0}".format(e))) # pylint: disable=E0501
15 self.messagedialog.show()
16 GObject.idle_add(self._reset_shortener)
17- return()
18+ return
19 self.entry.set_tooltip_text(self.long_address)
20 self.entry.set_has_tooltip(True)
21 self.entry.set_text(self.short_address)

Subscribers

People subscribed via source and target branches

to all changes: