Review Request 128563: Preserve selected items when changing folders

Emmanuel Pescosta emmanuelpescosta099 at gmail.com
Sun Jan 29 14:59:18 GMT 2017



> On Jan. 29, 2017, 3:49 p.m., Emmanuel Pescosta wrote:
> > src/dolphinviewcontainer.cpp, lines 457-462
> > <https://git.reviewboard.kde.org/r/128563/diff/2/?file=473178#file473178line457>
> >
> >     Move this code to `DolphinViewContainer::slotUrlNavigatorLocationChanged` after `m_view->setUrl(url)` 
> >     or swap `QTimer::singleShot(0, this, &DolphinView::updateViewState)` and `emit directoryLoadingCompleted()` in `DolphinView::slotDirectoryLoadingCompleted`.
> >     I don't know what of boths approaches is the nicer one (maybe 1. because it doesn't rely on the event queue ordering), but it's up to you ;)
> >     
> >     This makes sure that the member variables (m_selectedUrls, ...) are restored before DolphinView::updateViewState() gets invoked and we can avoid the work-around in `DolphinView::restoreState`.

Or another and better approach:
* Remove `QTimer::singleShot(0, this, &DolphinView::updateViewState)` from `DolphinView::slotDirectoryLoadingCompleted`
* And instead call it at the end of `DolphinView::restoreState`

Because after thinking about it again, your approach (restore state when directory loading completed) seems to be the cleanest one.


- Emmanuel


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/128563/#review102312
-----------------------------------------------------------


On Dec. 11, 2016, 1:38 p.m., Martin Tobias Holmedahl Sandsmark wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128563/
> -----------------------------------------------------------
> 
> (Updated Dec. 11, 2016, 1:38 p.m.)
> 
> 
> Review request for Dolphin, David Faure, Elvis Angelaccio, Emmanuel Pescosta, and Sune Vuorela.
> 
> 
> Repository: dolphin
> 
> 
> Description
> -------
> 
> Instead of just clearing the selection when going back and forth in history, it now preserves the selected items.
> 
> Another bug it fixes is if you enter a folder, go back, and then hold down shift and press an arrow key to try to select something.
> 
> 
> Diffs
> -----
> 
>   src/dolphinviewcontainer.h 62f9110 
>   src/dolphinviewcontainer.cpp 1c43fc9 
>   src/views/dolphinview.cpp a737dd0 
> 
> Diff: https://git.reviewboard.kde.org/r/128563/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Martin Tobias Holmedahl Sandsmark
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20170129/d6ae640c/attachment.htm>


More information about the kfm-devel mailing list