Merge lp:~qbzr-dev/qbzr/bug-503401 into lp:qbzr

Proposed by Alexander Belchenko
Status: Merged
Merged at revision: not available
Proposed branch: lp:~qbzr-dev/qbzr/bug-503401
Merge into: lp:qbzr
Diff against target: 49 lines (+16/-3)
2 files modified
NEWS.txt (+7/-0)
lib/commands.py (+9/-3)
To merge this branch: bzr merge lp:~qbzr-dev/qbzr/bug-503401
Reviewer Review Type Date Requested Status
Gary van der Merwe Approve
Review via email: mp+16859@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexander Belchenko (bialix) wrote :

This fixes the bug #503401 on Windows. Can anybody test it on Linux? If it does not harm there I will merge it to trunk. Otherwise I need to make it conditional depends on platfortm.

Revision history for this message
Gary van der Merwe (garyvdm) wrote :

Tested on ubuntu. No affects noticed.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS.txt'
2--- NEWS.txt 2009-12-12 07:33:45 +0000
3+++ NEWS.txt 2010-01-05 16:30:27 +0000
4@@ -1,3 +1,10 @@
5+0.18 "Pine-needles" - YYYY-MM-DD
6+--------------------------------
7+
8+ * Flush clipboard on exit, so data copied there is available after closing of
9+ q-window. (Bug #503401)
10+
11+
12 0.17 "Sapin de Noël" - 2009/12/12
13 ---------------------------------
14 What's new in this release:
15
16=== modified file 'lib/commands.py'
17--- lib/commands.py 2009-12-18 08:25:29 +0000
18+++ lib/commands.py 2010-01-05 16:30:27 +0000
19@@ -27,7 +27,7 @@
20 lazy_import(globals(), '''
21 import sys
22
23-from PyQt4 import QtGui
24+from PyQt4 import QtCore, QtGui
25
26 from bzrlib import (
27 builtins,
28@@ -160,14 +160,20 @@
29 sys.excepthook = excepthook
30
31 try:
32- ret_code = self._qbzr_run(*args, **kwargs)
33+ try:
34+ ret_code = self._qbzr_run(*args, **kwargs)
35+ finally:
36+ # ensure we flush clipboard data (see bug #503401)
37+ clipboard = self._application.clipboard()
38+ clipEvent = QtCore.QEvent(QtCore.QEvent.Clipboard)
39+ self._application.sendEvent(clipboard, clipEvent)
40 if ret_code is None:
41 main_window = getattr(self, "main_window", None)
42 if main_window is not None:
43 ret_code = getattr(main_window, "return_code", None)
44 return ret_code
45 except Exception:
46- ui_mode = ("ui_mode" in kwargs and kwargs["ui_mode"])
47+ ui_mode = kwargs.get("ui_mode", False)
48 from bzrlib.plugins.qbzr.lib.trace import report_exception
49 return report_exception(ui_mode=ui_mode)
50

Subscribers

People subscribed via source and target branches