Review Request: Save scrollbar position on plasma exit

Ignat Semenov 13thguards at gmail.com
Tue Mar 13 13:51:30 UTC 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104258/
-----------------------------------------------------------

(Updated March 13, 2012, 1:51 p.m.)


Review request for Plasma, Aaron J. Seigo, Marco Martin, and Fredrik Höglund.


Changes
-------

Check the saved position for validity.

Actually, I used to have that check, but removed it later because it was in restoreScrollbarPosition() and the range was of course invalid in that method. Silly me did not think about putting it where it belongs. :)


Description
-------

This patch implements scrolbar position saving on plasma exit. The change is fairly trivial, however, due to the fact that the view is not populated and layouted immediately simply scrolling to the desired position on creating the view does not work. Instead a signal is emitted on finishing the item layout, when the view has a valid size and the scrollbar has a valid range. The signal is connected to a slot which scrolls the view to the desired position and then disconnects the signal. For the user, a public function in AbstractItemView is introduced, which performs the connection.

The only problem is that ListView turned out not to have any layout method. It just paints the items one by one, calculating their position on the fly, so I put the signal at the end of updateScrollbar to ensure the scrollbar range is valid. Maybe it should go into the "if (max>0)" branch?


This addresses bug 261139.
    http://bugs.kde.org/show_bug.cgi?id=261139


Diffs (updated)
-----

  plasma/applets/folderview/abstractitemview.h aa68b90 
  plasma/applets/folderview/abstractitemview.cpp 3debb70 
  plasma/applets/folderview/folderview.h 4e441eb 
  plasma/applets/folderview/folderview.cpp a94ce87 
  plasma/applets/folderview/iconview.cpp 5c4e086 
  plasma/applets/folderview/listview.cpp b17e7c4 

Diff: http://git.reviewboard.kde.org/r/104258/diff/


Testing
-------

Tested both the icon view and the list view, works fine.


Thanks,

Ignat Semenov

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20120313/0b8638b9/attachment.html>


More information about the Plasma-devel mailing list