Favorites Pane: no refresh

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, helmut, xnview

Post Reply
User avatar
m.Th.
XnThusiast
Posts: 1664
Joined: Wed Aug 16, 2006 6:31 am
Contact:

Favorites Pane: no refresh

Post by m.Th. »

After trying to answer Helmut's question here http://newsgroup.xnview.com/viewtopic.php?f=60&t=34691 (I was quite tired then) I did a more in-depth analysis of the matter and I found that Favorites Pane does not refresh itself after any(?) on-disk operation which can affect it.

Steps:

1. Open Folders Pane at c:\foo\bar
2. Open Favorites Pane at the same path (it the path doesn't exist, add c\foo as a favorite)
3. Do something in thumbs pane and/or in Folders Pane which should imply a refresh. For example, rename „bar” to „blah”.

Expected: In Favorites Pane „bar” should be updated to „blah”

Actual: In Favorites Pane the old name remains

How to solve: (A proposal)

Implement an Observer class/object (singleton) called eg. RefreshObserver which would have two lists:
- Trees : which will have (now) two members: Folders Tree and Favorites Tree
- Thumbs: which will have (so far) one member: Main Thumbs Pane

The RefreshObserver will implement a method DoRefresh(aPaths: TPathsList) which will take as an argument the list of the changed paths (with their change ie. added/deleted/changed = renamed + moved) and will apply this list of changed paths to each observed widget from the two lists mentioned above.

In this way, we will have an flexible, expandable architecture together with centralized code to handle the changes. IOW with a single piece of code we will handle the changes for all possible Trees (one procedure)/Thumbs (another procedure) panes in the future.

Of course, the specifics - for example the path resolving engine - is specific to each widget. The Favorites Tree resolves the path in another way than the Folders Tree.
m. Th.

- Dark Themed XnViewMP 1.6 64bit on Win11 x64 -
Post Reply