Fix issues with clicking directories in tree view

Authored by muhlenpfordt on Jan 24 2018, 8:56 AM.

Description

Fix issues with clicking directories in tree view

Summary:
Selecting another directory in tree while showing an image in view mode,
opens the first image from the selected directory in view mode. If the
folder contains subfolders, gwenview selects the first one and switches
to browse mode.
This patch changes selection of first item back to first image
(introduced in D8934) to fix this and toggles between browse/view mode
only after clicking the already selected directory in tree.
Additionally a trailing slash is stripped from the current dir url in
context manager to fix a failing compare to initially stored dir url.

BUG: 306835

Test Plan:

  1. Open image in view mode
  2. Click on another directory in tree view

-> Should view the first image in new directory

  1. Open image in view mode
  2. Click multiple times on the same directory in tree view

-> Should toggle browse/view mode

Reviewers: rkflx

Reviewed By: rkflx

Subscribers: ngraham, rkflx

Differential Revision: https://phabricator.kde.org/D9886

Details

Committed
muhlenpfordtJan 26 2018, 7:35 AM
Reviewer
rkflx
Differential Revision
D9886: Fix issues with clicking directories in tree view
Parents
R260:5bcb8cc92d37: Add browse mode action to action collection again
Branches
Unknown
Tags
Unknown