-
Michael Gratton authored
Conversation monitor was built around older assumptions of how a folder's remote connections work - that once a folder opens it will likely also eventually establish a remote connection, that once the connection is up it will hang around, and so on. This patch removes any public notion of (re)seeding, since it can't be relied to actually happen over the course of the session, ensures that all folder operations are local-only when the folder does not have a working remote connection so it doesn't block, and take the opportunity to reorganise and clean up the monitor API and documentation comments. * src/engine/app/app-conversation-monitor.vala (ConversationMonitor): Remove seed signals, and don't bother running an initial reseed if the folder is already open, since the fill operation will cause any locally incomplete messages to be filled out from the report. Manage and use an internal Cancellable for cancelling internal operations when shutting down. Construct a queue only when starting to monitor conversations, delete it when stopping. Move as much operation-specific code into the operations themselves as reasonably possible, making some methods internal so thy can be accessed from the ops. Ensure all folder listing operations specify LOCAL_ONLY when the remote is not open. Removed LocalLoadOperation since that is now redundant. Update the API for accessing conversations to match Gee conventions and update call sites. Update documentation comments. Hook back up to locally-complete signals so we don't miss emails being filled out by the prefetcher, for now. * src/engine/app/conversation-monitor/app-conversation-set.vala (ConversationSet): Rename conversations property to match Gee conventions, update call sites. * src/engine/app/conversation-monitor/app-conversation-operation.vala (ConversationOperation): Allow operations to specify if they should allow duplicates, and allow the execution method to throw errors, so they can be handled in a uniform way. * src/engine/app/conversation-monitor/app-conversation-operation-queue.vala (ConversationOperationQueue): Accept progress monitor property as a ctor arg rather than constructing on itself, so it is tied to the life-cycle of the ConversationMonitor rather than the queue. Add a signal for notifying of errors thrown when running operations, and use the new operation-independent support for determining if duplicates should be queued. * src/engine/app/conversation-monitor/app-fill-window-operation.vala (FillWindowOperation): Enforce a maximum window size as well as minimum to keep loading large windows semi-responsive. Remove code to handle inserts now that they are handled by their own op. * src/engine/app/conversation-monitor/app-insert-operation.vala (InsertOperation): New operation to manage inserts, handle it them by simply adding them to the conversation if they are newer than the oldest message, rather that relisting all loaded messages.
cf86d07b