Bug 321078 - Save the state of the mailboxes treeview
Summary: Save the state of the mailboxes treeview
Status: RESOLVED FIXED
Alias: None
Product: trojita
Classification: Applications
Component: Desktop GUI (show other bugs)
Version: git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Trojita default assignee
URL:
Keywords:
: 349655 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-06-12 20:24 UTC by Guido Berhoerster
Modified: 2016-11-24 08:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.7


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Berhoerster 2013-06-12 20:24:23 UTC
Please save the state of the mailboxes treeview, i.e. whether nested mailboxes and namespaces are expanded or not. I have dozens of mailboxes and multiple namespaces containing nested mailboxes up to three levels deep and it very tediuos to expand them as needed each time trojita is started or when it goes from offline to online or after editing preferences. This problem is compounded by the fact that there is no indication in the parent mailbox whether a child mailbox has unseen messages.


Reproducible: Always
Comment 1 Jan Kundrát 2013-06-13 10:11:11 UTC
This makes sense. However, due to the asynchronous nature of IMAP and its implementation in Trojita (the folders are loaded on demand, as you expand them), solving this will take some time.
Comment 2 Guido Berhoerster 2013-06-13 10:43:11 UTC
Pardon my ignorance on trojita internals, but could you not store a list of expanded folders and traverse it when you initialize the treeview and expand them if they exist by taking the same code paths as if a user expanded those mailboxes manually? Or would that be too hackish or visually disruptive?
Comment 3 Jan Kundrát 2013-06-13 12:13:00 UTC
By the time Trojita starts, there are no mailboxes in the view. These are filed in moments later from the on-disk cache, and at the same time a request for mailbox listing is sent to the server. When this listing arrives later, the cache mailboxes are destroyed and replaced by new instances as returned by the server. This happens for each level of nesting hierarchy.

I do not think that simply expanding these items in the view would do the right thing when this asynchronity enters the picture, but I might be wrong -- please feel free to create patch. What I think is actually required is some way of baing able to "wait" (asynchronously) for a given mailbox to become "available", and code for doing this (and working correctly with the cache, which will probably involve replacing the code which simply replaces entries obtained from cache with smarter code which will only do what is actually required) is not going to be trivial.
Comment 4 Jan Kundrát 2015-06-27 18:04:51 UTC
*** Bug 349655 has been marked as a duplicate of this bug. ***
Comment 5 Jan Kundrát 2016-11-24 08:41:02 UTC
This has actually been fixed in a release for some time (v0.7).