[prev in list] [next in list] [prev in thread] [next in thread]
List: kfm-devel
Subject: Re: Review Request 117021: Fix Bug 332159 - dolphin does not remember scroll position when going bac
From: "Emmanuel Pescosta" <emmanuelpescosta099 () gmail ! com>
Date: 2014-04-04 13:08:45
Message-ID: 20140404130845.31792.70401 () probe ! kde ! org
[Download RAW message or body]
> On March 24, 2014, 11:45 p.m., Frank Reininghaus wrote:
> > Thanks for your analysis and your patch! You are right, the double emission of \
> > KFileItemModel's directoryLoadingCompleted() signal is the problem.
> > Modifying DolphinView::updateViewState() such that it still keeps the position to restore \
> > if the restoration was not successful looks like a good approach to fix the problem! The \
> > second call of that function will restore the correct position then. However, I'm not \
> > really sure why
> > KFileItemModel::setShowHiddenFiles(bool show)
> >
> > calls slotCompleted() at all (this is what triggers the emission of \
> > directoryLoadingCompleted() eventually). Removing that call also fixes the problem for me, \
> > but it will probably cause some regressions? There is probably a reason why the call is \
> > there, but it seems that the first commit that "git blame" points to simply changed the \
> > indentation of that line. Some more code archeology might be needed. But maybe you had \
> > already tried this approach and found that the change in DolphinView is better?
> > The reason why I'm asking is that I see a certain risk that the change in DolphinView will \
> > cause subtle bugs in the future. Imagine the following scenario:
> > 1. In folderA/, scroll down and click the very last folder (in Details View).
> >
> > 2. While in folderA/subfolder/, remove any other subfolder in folderA from a terminal.
> >
> > 3. Go "back". Restoring the position will fail because the view's total height is smaller \
> > than it used to be. However, with your patch, the desired position will still be stored in \
> > m_restoredContentsPosition, right?
> > 4. Go to any other folder, which has more items than folderA/. If I'm not mistaken, the \
> > view might now scroll down to the offset which should originally have been restored in step \
> > 3.
> > This reminds me a bit of https://bugs.kde.org/show_bug.cgi?id=329377, which was not exactly \
> > easy to debug. But I'm not completely sure if my analysis is right, and the same problem \
> > could indeed happen in the "restore scroll position" context.
> Removing that call also fixes the problem for me, but it will probably cause some \
> regressions?
I don't know if it will cause any regressions, this is why I have fixed it in \
DolphinView::updateViewState() so that all slotCompleted() calls try to scroll to the right \
position.
> subtle bugs in the future
No problems found so far.
I think we should fix it by removing the slotCompleted() call in setShowHiddenFiles, because it \
is a much nicer solution and if we get some regression bug reports (I doubt that ;) we can \
revert it and apply this patch. What do you think?
Thanks!
- Emmanuel
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117021/#review54044
-----------------------------------------------------------
On March 24, 2014, 4:19 p.m., Emmanuel Pescosta wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117021/
> -----------------------------------------------------------
>
> (Updated March 24, 2014, 4:19 p.m.)
>
>
> Review request for Dolphin.
>
>
> Bugs: 332159
> http://bugs.kde.org/show_bug.cgi?id=332159
>
>
> Repository: kde-baseapps
>
>
> Description
> -------
>
> Fix Bug 332159 - dolphin does not remember scroll position when going back
>
> DolphinView::updateViewState will be called multiple times in some special cases,
> so we only reset the restored contents position if we have successfully reached it.
>
>
> Diffs
> -----
>
> dolphin/src/views/dolphinview.cpp 2769d67
>
> Diff: https://git.reviewboard.kde.org/r/117021/diff/
>
>
> Testing
> -------
>
> Works.
>
> See Ashish's comment #5 in the bug report:
>
> Ashish 2014-03-23 19:02:46 CET
> I can reproduce this only when the 1st folder has "Show hidden files" enabled.
> Step 1: Enable Show Hideen Files in say, home folder.
> 2: Scroll down, open any folder.
> 3: click back. We reach the top position in home folder. When Hidden files is not enabled, \
> clicking on back remembers the scroll position. Version tested: 4.12.3 on Ubuntu 13.10
>
>
> Thanks,
>
> Emmanuel Pescosta
>
>
[Attachment #3 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/117021/">https://git.reviewboard.kde.org/r/117021/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On March 24th, 2014, 11:45 p.m. CET, <b>Frank Reininghaus</b> \
wrote:</p> <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; \
white-space: -o-pre-wrap; word-wrap: break-word;">Thanks for your analysis and your patch! You \
are right, the double emission of KFileItemModel's directoryLoadingCompleted() signal is \
the problem.
Modifying DolphinView::updateViewState() such that it still keeps the position to restore if \
the restoration was not successful looks like a good approach to fix the problem! The second \
call of that function will restore the correct position then. However, I'm not really sure \
why
KFileItemModel::setShowHiddenFiles(bool show)
calls slotCompleted() at all (this is what triggers the emission of directoryLoadingCompleted() \
eventually). Removing that call also fixes the problem for me, but it will probably cause some \
regressions? There is probably a reason why the call is there, but it seems that the first \
commit that "git blame" points to simply changed the indentation of that line. Some \
more code archeology might be needed. But maybe you had already tried this approach and found \
that the change in DolphinView is better?
The reason why I'm asking is that I see a certain risk that the change in DolphinView will \
cause subtle bugs in the future. Imagine the following scenario:
1. In folderA/, scroll down and click the very last folder (in Details View).
2. While in folderA/subfolder/, remove any other subfolder in folderA from a terminal.
3. Go "back". Restoring the position will fail because the view's total height is \
smaller than it used to be. However, with your patch, the desired position will still be stored \
in m_restoredContentsPosition, right?
4. Go to any other folder, which has more items than folderA/. If I'm not mistaken, the \
view might now scroll down to the offset which should originally have been restored in step 3.
This reminds me a bit of https://bugs.kde.org/show_bug.cgi?id=329377, which was not exactly \
easy to debug. But I'm not completely sure if my analysis is right, and the same problem \
could indeed happen in the "restore scroll position" context.</pre> </blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; \
white-space: -o-pre-wrap; word-wrap: break-word;">> Removing that call also fixes the \
problem for me, but it will probably cause some regressions? I don't know if it will cause \
any regressions, this is why I have fixed it in DolphinView::updateViewState() so that all \
slotCompleted() calls try to scroll to the right position.
> subtle bugs in the future
No problems found so far.
I think we should fix it by removing the slotCompleted() call in setShowHiddenFiles, because it \
is a much nicer solution and if we get some regression bug reports (I doubt that ;) we can \
revert it and apply this patch. What do you think?
Thanks!</pre>
<br />
<p>- Emmanuel</p>
<br />
<p>On March 24th, 2014, 4:19 p.m. CET, Emmanuel Pescosta wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: \
url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black solid;"> <tr>
<td>
<div>Review request for Dolphin.</div>
<div>By Emmanuel Pescosta.</div>
<p style="color: grey;"><i>Updated March 24, 2014, 4:19 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=332159">332159</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kde-baseapps
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px \
solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Fix Bug 332159 - \
dolphin does not remember scroll position when going back
DolphinView::updateViewState will be called multiple times in some special cases,
so we only reset the restored contents position if we have successfully reached it.
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid \
#b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Works.
See Ashish's comment #5 in the bug report:
Ashish 2014-03-23 19:02:46 CET
I can reproduce this only when the 1st folder has "Show hidden files" enabled.
Step 1: Enable Show Hideen Files in say, home folder.
2: Scroll down, open any folder.
3: click back. We reach the top position in home folder. When Hidden files is not enabled, \
clicking on back remembers the scroll position. Version tested: 4.12.3 on Ubuntu 13.10</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>dolphin/src/views/dolphinview.cpp <span style="color: grey">(2769d67)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/117021/diff/" style="margin-left: 3em;">View \
Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic