Bug 267171 - Version state in details-view with expandable folders not shown
Summary: Version state in details-view with expandable folders not shown
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: plugins: git (show other bugs)
Version: 2.1
Platform: Chakra Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-25 20:37 UTC by Peter Penz
Modified: 2013-09-29 16:08 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.3


Attachments
POC show the right version state for expanded items (8.64 KB, patch)
2013-09-11 18:38 UTC, Emmanuel Pescosta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Penz 2011-02-25 20:37:30 UTC
Version:           unspecified (using KDE 4.6.0) 
OS:                Linux

When using the git-plugin with the details-view where "expandable-folders" is enabled (context-menu -> [x] Expandable Folders), no correct version state is shown for the items below an expanded folder.

Reproducible: Always

Steps to Reproduce:
- Assure that the details-view with expandable folders is enabled
- Go to a git-repository that has sub-directories and where items of a sub-directories have been modified
- Open the sub-directory with the modifications by clicking on the expand-button left from the directory icon


Actual Results:  
No version state is shown at all

Expected Results:  
Version state of the items in the sub-directory is shown
Comment 1 Jeroen van Meeuwen (Kolab Systems) 2012-08-24 16:21:30 UTC
Resetting assignee to default as per bug #305719
Comment 2 Adrián Chaves (Gallaecio) 2012-10-28 17:47:55 UTC
I can confirm the version-control-status-icon of the files in the expanded folder does not provide the status information. It does work, however, when you actually enter the expanded folder.
Comment 3 Emmanuel Pescosta 2013-09-10 15:46:35 UTC
The problem is in UpdateItemStatesThread::run().
We use the directory url of the first item to retrieve the item version states of all items, which
makes it impossible to get the infos for expanded items.

plugin->beginRetrieval(directory)
   foreach item in items
         plugin->itemVersion(item)
plugin->endRetrieval()

I haven't found any simple and good solution yet to fix this problem.
Comment 4 Emmanuel Pescosta 2013-09-11 18:38:16 UTC
Created attachment 82281 [details]
POC show the right version state for expanded items

With this patch the right version states for expanded items are shown.

The only problem so far:
The "root folder" must be under version control.
Comment 5 Frank Reininghaus 2013-09-12 16:02:44 UTC
Thanks for looking into the problem, Emmanuel!

(In reply to comment #4)
> The only problem so far:
> The "root folder" must be under version control.

If we tried to fix this problem, then we would always have to let the plugins run when expanding any folder, right? I'm not sure if we really want that. Note that the bug description mentions only the case that the "root folder" is version-controlled.
Comment 6 Emmanuel Pescosta 2013-09-14 20:22:57 UTC
> If we tried to fix this problem, then we would always have to let the plugins run when expanding
> any folder, right?
Yes, we must check if every opened/expanded folder is under version control.
Comment 7 Emmanuel Pescosta 2013-09-29 16:08:59 UTC
Git commit bbbfeb28c54badce6e4643854bfe15a8705f5ad5 by Emmanuel Pescosta.
Committed on 29/09/2013 at 16:08.
Pushed by emmanuelp into branch 'KDE/4.11'.

Show the right version states for expanded items.
FIXED-IN: 4.11.3
REVIEW: 112980

M  +19   -17   dolphin/src/views/versioncontrol/updateitemstatesthread.cpp
M  +3    -3    dolphin/src/views/versioncontrol/updateitemstatesthread.h
M  +47   -16   dolphin/src/views/versioncontrol/versioncontrolobserver.cpp
M  +16   -0    dolphin/src/views/versioncontrol/versioncontrolobserver.h

http://commits.kde.org/kde-baseapps/bbbfeb28c54badce6e4643854bfe15a8705f5ad5