D7477: Limit folder panel to home directory if inside home

Emmanuel Pescosta noreply at phabricator.kde.org
Thu Aug 31 21:09:36 BST 2017


emmanuelp added inline comments.

INLINE COMMENTS

> hoffmannrobert wrote in folderspanel.cpp:357
> 1. Create a subdirectory of `~` , e.g. `~/Documents`
> 2. go there --> `Documents` is selected in folders panel,
> 3. go back to `~` --> fail, selection in folders panel stays at `Documents` and is not cleared.
> 
> 4. Create another subdirectory level. e.g. `~/Documents/Test`
> 5. go there --> `Documents/Test` is selected in folders panel,
> 6. go back to `~` --> fail, selection in folders panel stays at `Documents/Test` and is not cleared.

Thanks for the steps! I can now reproduce the problem.

Please note that the same behavior occurs when e.g. going back from `/home` to `/`.

The reason is that the `index` is `-1` (preventing the immediate `updateCurrentItem` in line 347) but the url is already loaded and so `slotLoadingCompleted` won't be called.

I would suggest something like this to fix the problem:

  if (index >= 0) {
      updateCurrentItem(index);
  } else if (url == baseUrl) {
      // clear the selection when visiting the base url
      updateCurrentItem(-1);
  } else {
      ...
  }

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D7477

To: hoffmannrobert, #dolphin, elvisangelaccio, emmanuelp
Cc: emmanuelp, elvisangelaccio, #konqueror, #dolphin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20170831/74c0e637/attachment.htm>


More information about the kfm-devel mailing list