2011-02-11 10:45:19 |
Alexander Belchenko |
description |
I don't understand this effect, but I have qdiff window geometry settings to expand the qdiff window to entire screen and it works well when invoked from console or qlog, or even qcommit (without pending merge).
But in the case of qcommit with pending merges when I'm trying to see individual diff for one file the qdiff window opens in the default size, not maximized, and I have to maximize it manually.
bzr 2.3.0 from windows standalone installer, QBzr from trunk revno 1355. |
I found the way to reproduce it.
run bzr qlog
invoke qdiff for some revision -> all ok
close qdiff -> all ok
invoke qdiff for other revision -> qdiff window is no more maximized,
and corresponding setting disappears from qbzr.conf
So, second qdiff invocation from qlog resets maximized flag to nothing,
and even the line
diff_window_maximized = True
disappears from qbzr.conf.
That's because in qbzr/lib/utils.py we have the following code in restoreSize:
is_maximized = config.get_option(name + "_window_maximized")
if is_maximized in ("True", "1"):
self.setWindowState(QtCore.Qt.WindowMaximized)
Adding trace point after config.get_option I see the following:
first time for qdiff we read qdiff_window_maximized option as u'True'
(unicode string), but second time we read the same option from the same
process as bool True. Why? I don't understand.
So the if statement in the second line is False for the second case.
The simplest fix is to extend the if statement, the better fix is to
adopt get_user_options_as_bool from bzrlib.config.
|
|