Bug 417230 - ShowItems does not work if folder is already open
Summary: ShowItems does not work if folder is already open
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-06 12:49 UTC by Kai Uwe Broulik
Modified: 2020-03-06 18:04 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.12.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Uwe Broulik 2020-02-06 12:49:45 UTC
SUMMARY
When using the FileManager1 interface it doesn't highlight the files if the folder is already open and it just witches to it

STEPS TO REPRODUCE
1. In any application that has an "open containing folder" select that option
2. and then do the same for another file in the same folder
3. 

OBSERVED RESULT
Dolphin comes to the front and switches tabs, if necessary, but doesn't highlight the file in the second attempt

EXPECTED RESULT
Dolphin always highlights the file

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.18
KDE Frameworks Version: 5.66.0
Qt Version: 5.13.2
Dolphin master

ADDITIONAL INFORMATION
In DolphinTabWidget::openFiles it assumes openDirectories will open new tabs, so it only marks the URL selection for the newly opened tabs. This assumption is incorrect as Dolphin might reuse tabs when the folder is already open.

Even then, markUrlsAsSelected does nothing when the folder is already opened. The selection seems to only be used when the folder finishes loading, calls made after that only change a variable without updating the actual selection.
Comment 1 a.saoutkin 2020-03-01 17:19:19 UTC
Git commit fef7eebc6e3c27e6653bfd5d8a1abec191dc9835 by Alexander Saoutkin.
Committed on 01/03/2020 at 17:17.
Pushed by asaoutkin into branch 'release/19.12'.

Fix files not being highlighted if directory of file is already open

Summary:
In DolphinTabWidget::openFiles it assumes openDirectories will open new tabs, so it
only marks the URL selection for the newly opened tabs. This assumption is incorrect
 as Dolphin might reuse tabs when the folder is already open.

Even then, markUrlsAsSelected does nothing when the folder is already opened.
The selection seems to only be used when the folder finishes loading, calls made after
that only change a variable without updating the actual selection.

A call to DolphinView::updateViewState() is required to restore the intended behaviour, so long as DolphinView::clearSelection() has been called on the relevant tab, otherwise updateViewState() is a no-op.
FIXED-IN: 19.12.3

Test Plan:
1. In any application that has an "open containing folder" select that option
2. and then do the same for another file in the same folder

Reviewers: broulik

Reviewed By: broulik

Subscribers: kfm-devel

Tags: #dolphin

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

M  +9    -1    src/dolphintabwidget.cpp
M  +6    -6    src/views/dolphinview.h

https://commits.kde.org/dolphin/fef7eebc6e3c27e6653bfd5d8a1abec191dc9835
Comment 2 Nate Graham 2020-03-06 18:04:08 UTC
*** Bug 418537 has been marked as a duplicate of this bug. ***