Commit Graph

44 Commits

Author SHA1 Message Date
5
cab9406217 So apparently the uicomp can just 'vanish' while we're using it. Joy. Take
2001-10-25    <NotZed@Ximian.com>

	* folder-browser-ui.c (fbui_sensitize_timeout): So apparently the
	uicomp can just 'vanish' while we're using it.  Joy.  Take care of
	that case here, fixes #13482.
	(fbui_sensitise_item): Check here too just for kicks.

	* mail-folder-cache.c (store_finalised): If we can't destroy our
	async event, then queue another one to do it.
	(store_finalised_finish): And handle it here, until we can, then
	free it.
	(mail_note_store): Queue an async event to get folderinfo, dont
	use mail_get_folderinfo.
	(update_folders_get): thread-async event to retrieve the
	folderinfo, and build it, then queues gui-async event to update
	the gui.
	(add_unmatched_info): Taken from mail-ops, adds unmatched if
	required.
	(add_vtrash_info): From mail-ops, add trash if required.
	(update_folders): Thread async event to update gui.
	(mail_note_store): Ref the store and storage when created.
	(update_1folder): Changed to assume we have info_lock, and store
	updates in an updates list.
	(setup_folder): Same.
	(folder_changed): Changed to call update_1folder directly.
	(real_folder_changed): Removed.
	(mail_note_folder): Changed to call update_1folder directly.
	(real_note_folder): Removed.
	(store_folder_subscribed): Call setup_folder directly.
	(real_folder_created): Removed.
	(real_flush_update): Function that actually does the updates in
	the gui thread.
	(mail_note_store): Go back to using mail_get_folderinfo.
	(update_folders): Fixed upf ro changed api's.
	(unset_folder_info): Changed to queue pending updates.
	(real_folder_deleted): Removed.
	(store_folder_unsubscribed): Do the removal work directly.
	(mail_note_store): Dont link to finalised event of store - we now
	ref it.
	(mail_note_store_remove): If we have any pending updates, clear
	them out.  Also cancel any pending folderinfo retrieve operations.
	(update_folders): Remove our update from the storeinfo list, if it
	still exists.
	(update_1folder): Make 'sent folder shows all counts' optional via
	an environmental variable EVOLUTION_COUNT_SENT for all those
	bloody whinging lusers out there.
	(mail_note_store_remove): Unref the storage when done.

	* mail-mt.c (mail_async_event_emit): If we're in main and have a
	gui task, set it to run via an idle function.
	(idle_async_event): Wrapper for calling do_async_event from idle
	function, and freeing the message when done.
	(idle_async_event): Call mail_msg_free not free on the finished
	message.

	* component-factory.c (mail_remove_storage): Destroy the storage
	async.
	(store_disconnect): This does the work.
	(free_storage): Un-note the store when we remove it, so the store
	noting code can unref things properly.
	(idle_quit): Return false when done, dont loop.

2001-10-24    <NotZed@Ximian.com>

	* component-factory.c (owner_set_cb): Setup an async_event
	handler.
	(idle_quit): Try to destroy the async_event, or keep dropping out
	if it can't (deadlock).

	* mail-mt.c (do_async_event): Set the threadid of the thread we're
	running in so we know its running/which thread its in.
	(mail_async_event_emit): Added new argument 'type' which is the
	type of thread to execute against, gui or another one.  Fixed all
	callers.
	(mail_async_event_destroy): Return -1 if this operation will fail
	(deadlock possibility).  If we're in the thread of the task
	we're going to wait for, then return a failure (since we will
	deadlock).
	(mail_async_event_emit): Chagned to use MailAsyncFunc type as the
	function type, which just takes 3 void args, change args to suit.

	* mail-folder-cache.c (mail_note_store): Record the pending update
	events in a pending list.  We should really be able to use an
	async event for this, but that doesn't return to the gui loop when
	done :-/
	(update_folders): Remove from pending update when done.

svn path=/trunk/; revision=14101
2001-10-25 21:21:33 +00:00
9
3e6cd9a7e5 Free folders_uri. (real_folder_deleted): If folder is deleted, remove it
2001-10-19    <NotZed@Ximian.com>

	* mail-folder-cache.c (store_finalised): Free folders_uri.
	(real_folder_deleted): If folder is deleted, remove it from the
	hashtables.

	* subscribe-dialog.c (get_short_folderinfo_get): Remove the
	register/unregister, they're already done above us.

	* mail-vfolder.c
	(mail_vfolder_delete_uri): Dont do any work to remove the actual
	folder from the vfolder (we'd have to look it up first), let the
	vfolder remove it itself.  Just update the rules.

svn path=/trunk/; revision=13787
2001-10-19 05:40:42 +00:00
8
ae5590f88d Added remove flag - its not adduri, its removeuri, its less typing than
2001-10-18    <NotZed@Ximian.com>

        * mail-vfolder.c (vfolder_adduri): Added remove flag - its not
        adduri, its removeuri, its less typing than creating a removeuri.
        (vfolder_adduri_do): Implement the remove flag.
        (mail_vfolder_remove_uri): Changed to mail_vfolder_delte_uri, to
        indicate its actually been deleted.
        (mail_vfolder_add_uri): Added remove flag.
        (rule_changed): When adding existing folders to a new rule, strdup
        the list data.

        * mail-folder-cache.c (store_finalised): Unhook from all events
        when done.
        (mail_note_store_remove): Remove a store from being noted.
        (free_folder_info): Also if we have a folder, unhook all events.
        Also remove the uri from vfolders.
        (mail_note_folder): Remove warning about adding folders to stores
        that aren't added yet - we might actually be removing the store.

        * component-factory.c (mail_remove_storage): Call
        mail_note_store_remove when we remove the storage.

svn path=/trunk/; revision=13782
2001-10-19 00:45:02 +00:00
7
a31ef049c0 Clone the folderinfo before passing to async event. (real_folder_created):
2001-10-17    <NotZed@Ximian.com>

        * mail-folder-cache.c (store_folder_subscribed): Clone the
        folderinfo before passing to async event.
        (real_folder_created): Free when done.
        (store_folder_unsubscribed):
        (real_folder_deleted): And same here.

        * mail-ops.c (mail_expunge_folder): Use the queued thread for
        expunging folders.

svn path=/trunk/; revision=13741
2001-10-17 22:45:18 +00:00
8c85ed61ba Added an async_event handler to store_info. (mail_note_store): Setup async
* mail-folder-cache.c: Added an async_event handler to store_info.
	(mail_note_store): Setup async event handler here.
	(store_finalised): Flush out async events here.
	(folder_changed): Use async event handler to emit event.
	(mail_note_folder): Chagned, do most of the work in the calling
	context, only do the corba stuff in main.
	(store_folder_subscribed): Use async event, and do more work locally.
	(store_folder_unsubscribed): Same.
	(store_folder_deleted): Call store_folder_unsubscribed if we have
	to do any work.
	(store_folder_created): Call store_folder_subscribed if we have to
	do any work.
	(store_folder_unsubscribed): Ref store while busy.
	(real_folder_deleted): And unref here.
	(store_folder_subscribed): Reg store while busy.
	(real_folder_created): Unref here.
	(mail_note_folder): Ref folder while busy.
	(real_note_folder): And unref here.
	(mail_note_folder): Hook onto folder_deleted event.
	(folder_deleted): Just mark this folder as no longer available.

	* mail-session.c (register_timeout): Use mail_call_main instead of
	proxy_event.
	(remove_timeout): Same here.

	* folder-browser.c (folder_changed): use the new mail_async_event
	stuff.
	(folder_changed_main): Remove old async event handling stuff.
	(FOLDER_BROWSER_LOCK/UNLOCK): Removed.
	(FolderBrowserPrivate): Removed too, sigh.

	* mail-mt.c (mail_async_event_new, mail_async_event_emit,
	mail_async_event_destroy): New functions to handle async events.
	(mail_proxy_event, mail_proxy_event_id): Removed old functions for
	async events.
	(do_call): Add suport for MAIL_CALL_p_pp.
	(mail_msg_free): Use mail_async_event instead of proxy_event.

	* message-list.c (message_changed): Promote the message_changed to
	a folder_changed and use main_folder_changed to process it.
	(main_message_changed): Remove.d
	(message_list_init): Setup async event handler.
	(message_list_destroy): Remove async handler.
	(folder_changed): Use async hanler to emit event in main loop.
	(message_changed): Same.

svn path=/trunk/; revision=13698
2001-10-16 19:13:31 +00:00
f620356a6f Call mail_vfolder_shutdown.
2001-10-15  Jeffrey Stedfast  <fejj@ximian.com>

	* component-factory.c (owner_unset_cb): Call
	mail_vfolder_shutdown.

	* mail-vfolder.c (mail_vfolder_shutdown): Unref all of our
	VFolders.

	* mail-folder-cache.c (real_note_folder): Remember to unref the
	folder before returning if we have already noted this folder.

svn path=/trunk/; revision=13682
2001-10-15 20:18:08 +00:00
a2db1f2033 No longer need to pass folder display name to storage update_folder
* mail-folder-cache.c (update_1folder): No longer need to pass
	folder display name to storage update_folder methods.
	(setup_folder, free_folder_info): Meaning we no longer need to
	keep track of it.

	* evolution-outlook-importer.[ch], evolution-mbox-importer.[ch]:
	These copies are cruft. The real ones are in importers/.

svn path=/trunk/; revision=13589
2001-10-11 18:59:36 +00:00
9
b620893135 Ref folder so it hangs around till we're done with it.
2001-10-09    <NotZed@Ximian.com>

        * mail-folder-cache.c (folder_changed): Ref folder so it hangs
        around till we're done with it.
        (real_folder_changed): Unref folder when we are done with it.
        Should fix #11981.

svn path=/trunk/; revision=13543
2001-10-10 01:39:56 +00:00
5
e2aaec85d0 reformatted the menu tables so they're a bit more bloody readable.
2001-10-05    <NotZed@Ximian.com>

        * folder-browser.c: reformatted the menu tables so they're a bit
        more bloody readable.

        * mail-folder-cache.c (mail_note_store): Hook into
        subscribed/unsubscribed events.  Only 'add/remove' folders from
        the add/removed events if we aren't subscribed, otherwise use the
        subscribed events.  Rest of fix for #11831

svn path=/trunk/; revision=13472
2001-10-05 21:50:12 +00:00
4
b4d1e6b70e Show "nn sent" as total in sent folder, rather than just 'total'.
2001-10-04    <NotZed@Ximian.com>

        * folder-browser.c (update_status_bar): Show "nn sent" as total in
        sent folder, rather than just 'total'.

        * mail-folder-cache.c (update_1folder): Also show total message
        count for sent_folder.

svn path=/trunk/; revision=13429
2001-10-05 00:21:28 +00:00
3
63fe218a16 Handle vtrash case, emit 'folder_created' event for the folder-cache to
2001-10-03    <NotZed@Ximian.com>

        * mail-local.c (local_storage_new_folder_cb): Handle vtrash case,
        emit 'folder_created' event for the folder-cache to work, etc.

svn path=/trunk/; revision=13387
2001-10-03 21:10:12 +00:00
3
cb9d644a2e Dont wait for event to finish before returning. This could however mean we
2001-10-03    <NotZed@Ximian.com>

        * mail-folder-cache.c (folder_changed): Dont wait for event to
        finish before returning.  This could however mean we process it
        after things have vanished below us?  Fixes another case of ctrl-d
        deadlock.

        * mail-ops.c
        (remove_folder_get): Freeze/thaw around deleting all messages in
        folder.

svn path=/trunk/; revision=13382
2001-10-03 18:48:47 +00:00
8
4b14db5520 Emit folder_deleted event. (remove_find_path): Fix, compare against path,
2001-09-28    <NotZed@Ximian.com>

	* mail-local.c (mail_local_store_remove_folder): Emit
	folder_deleted event.
	(remove_find_path): Fix, compare against path, not full_name.

	* mail-tools.c (mail_tool_uri_to_folder): Dont
	vfolder_register_source anymore.

	* mail-vfolder.c (rule_changed): Changed to access
	mail_fodler_cahce to find out if the folder exist yet before
	trying to open them, also use the cache as a cache so we dont have
	to open the folder if its already been opened.
	(vfolder_register_source, register_source): Removed.
	(source_finalise): Removed,
	(check_source): Removed.  All handled through diff mechanism.
	(mail_vfolder_add_uri): New function, records uri's of available
	folders, and adds them to any active vfolders if required.
	(mail_vfolder_remove_uri): New function, removes a uri from
	available folders, and checks any rules to see fi they need
	updating.
	(vfolder_adduri): New async function to add a uri to all vfolders
	that need it.
	(store_folder_deleted): oops!  free user, not rule!!

	* mail-folder-cache.c: Add uri->folderinfo hashtable, and the
	store from which they come into the store info struct.
	Add uri to the folder_info.
	(setup_folder): Store the uri in the folderinfo.
	(setup_folder): And the uri in the folder_uri hashtable.
	(mail_note_store): Store the store in the storeinfo, and setup the
	folders_uri hashtable via the store's hash functions.
	(setup_folder): Call mail_vfolder_add_uri to note this newly setup
	folder uri.
	(store_folder_deleted): Proxy call to main thread.
	(real_folder_deleted): And tell the vfolder to remove this uri
	from its folder list.
	(setup_folder): Dont call vfolder_add_uri if noselect is set on
	the uri.

2001-09-27    <NotZed@Ximian.com>

	* mail-vfolder.c: Removed vfolder_info struct, vfolder_storage.
	Neither used anymore.

svn path=/trunk/; revision=13242
2001-09-28 23:54:30 +00:00
7
0ac20c6064 No such event finalized! Its finalize. (mail_note_store): "
2001-09-27    <NotZed@Ximian.com>

        * mail-folder-cache.c (real_note_folder): No such event finalized!
        Its finalize.
        (mail_note_store): "

        Fixed dan's comment a bit, info != NULL for folder_created, info==
        NULL for changed.

2001-09-26    <NotZed@Ximian.com>

        * mail-local.c (mlf_set_message_flags): Proxy the
        set_message_flags call too.  Doesn't fix the 'local folder counts
        dont update' problem, but its more correct.

svn path=/trunk/; revision=13200
2001-09-27 22:34:12 +00:00
3bf97142fa Add a big comment explaining unread message counts so no one can mess them
* mail-folder-cache.c: Add a big comment explaining unread message
	counts so no one can mess them up again in the future. :-)
	(update_1folder): If info->unread_message_count is -1, don't do
	anything.

	* component-factory.c (component_factory_init): warn and exit if
	oaf_active_server_register returns OAF_REG_ALREADY_ACTIVE.

svn path=/trunk/; revision=13155
2001-09-26 19:28:14 +00:00
36da2069e0 The folder-info needs to take priority over the folder because of the way
2001-09-25  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-folder-cache.c (update_1folder): The folder-info needs to
	take priority over the folder because of the way IMAP works (which
	is that it doesn't actually update the folders until you SELECT
	them and so when you do get_folder_info(), it doesn't actually
	SELECT the folders, it just STATUS's them).

svn path=/trunk/; revision=13133
2001-09-25 23:09:45 +00:00
1
b2e7adf9b8 Take a new argument 'done' that can callback when complete. Fixed callers
2001-09-21    <NotZed@Ximian.com>

        * mail-folder-cache.c (mail_note_store): Take a new argument
        'done' that can callback when complete.  Fixed callers
        appropriately.

        * mail-ops.c (mail_update_subfolders): Removed.  Isn't used
        anymore.

        * mail-send-recv.c (receive_update_got_store): Remove call to
        mail_update_subfolders.

svn path=/trunk/; revision=13044
2001-09-21 05:58:31 +00:00
0
096dad5a2a trigger a folder changed event, so the folderinfocache stuff has a chance
2001-09-20    <NotZed@Ximian.com>

        * component-factory.c (got_folder): trigger a folder changed
        event, so the folderinfocache stuff has a chance to see if this is
        the outbox_folder or not.

        * mail-folder-cache.c (update_1folder): If we have -1 unread
        count, pass that as 0 to the shell so it doesn't go bolding.
        (setup_folder): Same.

svn path=/trunk/; revision=13041
2001-09-21 03:10:02 +00:00
0
a68b568135 Update the status bar here, assuming we've just been activated.
2001-09-20    <NotZed@Ximian.com>

	* folder-browser.c (folder_browser_set_shell_view): Update the
	status bar here, assuming we've just been activated.

	* mail-ops.c (add_vtrash_info): Scan whole list, rather than
	missing the last one.  Also dont assume its always the last,
	otherwise we could lose following folders.

	* mail-vfolder.c
	(all): d(x) out debug printfs

	* mail-folder-cache.c
	(update_1folder): If its a vtrash folder, or the outbox_folder,
	and we have a folder, then make the 'count' the total message
	count, not unread messages count.

svn path=/trunk/; revision=13036
2001-09-21 00:56:49 +00:00
0
586f083c3a Lock around hashtable/list manipulation. Also dont try scan vfolder_hash
2001-09-20    <NotZed@Ximian.com>

	* mail-vfolder.c (vfolder_register_source): Lock around
	hashtable/list manipulation.  Also dont try scan vfolder_hash if
	it hasn't been setup yet.
	(source_finalise): Lock around list access.
	(rule_changed): Lock around hash access.
	(context_rule_added): Lock around hash access.
	(context_rule_removed): "
	(rule_changed): Lock around list access.

	* mail-local.c (storage_listener_startup): Fix for api change.
	(local_storage_new_folder_cb): Dont skip over leading / in path.
	(local_storage_removed_folder_cb): ditto.

	* mail-folder-cache.c (create_folders): No longer pass prefix
	between recursive calls - we have the path in the folderinfo.
	(setup_folder): No longer take path arg, we get it from
	folderinfo.
	(mail_note_folder): No longer take path arg, we use
	folder->full_name to key the folder table.
	(mail_note_store): Consolidate note_store interface, pass storage
	or corba_storage to it.
	(mail_note_local_store): Removed.

	* mail-ops.c
	(add_unmatched_info): Scan for unmatched name and re-title.

svn path=/trunk/; revision=13023
2001-09-20 22:59:11 +00:00
0
412c2967bb Register vfolder sources here.
2001-09-20    <NotZed@Ximian.com>

        * mail-tools.c(mail_tool_uri_to_folder): Register vfolder sources here.

        * folder-browser.c (got_folder): Dont register vfolder sources
        here.

        * mail-ops.c (mail_get_folder): Add thread parameter.  Fix callers.

        * mail-vfolder.c (vfolder_setup): Use the 'slow' queue for setting
        up vfolders.

        * mail-mt.c (mail_msg_init): Limit the maximum number of threads
        on the 'new' thread to 10.
        (mail_msg_init): Create a new queue 'slow' for doing slow
        operations.

svn path=/trunk/; revision=13017
2001-09-20 21:01:53 +00:00
0
55690284e1 Dont special case file: url's anymore.
2001-09-20    <NotZed@Ximian.com>

        * mail-tools.c (mail_tool_uri_to_folder): Dont special case file:
        url's anymore.

        * mail-local.c: Add real_path to MailLocalFolder.
        (mail_local_folder_construct): Added path argument, setup
        full_name == path, and real_path == full_name.
        (mls_get_folder): First lookup folderinfo to confirm this folder
        exists, then use that to properly construct the folder paths.
        (mail_local_folder_reconfigure): Use real_path not full_name to
        create the store uri.
        (mlf_set_folder): Use real_path not folder_name to get real uri
        path.

2001-09-19    <NotZed@Ximian.com>

        * mail-folder-cache.c (setup_store): Use the wrong spelling of
        finalised for the event hook.
        (real_note_folder): Use the wrong spelling of finalised for the
        event hook.
        (free_folder_info): Free the full_name parameter.
        (setup_folder):
        (real_note_folder): Key the folderinfo table on full_name, not
        path.

svn path=/trunk/; revision=13014
2001-09-20 19:34:58 +00:00
9
73c74dd70d General cleanup of mail debug printfs.
2001-09-19    <NotZed@Ximian.com>

        * General cleanup of mail debug printfs.

        * mail-folder-cache.[ch]: Completely rewritten.  Removed all calls
        to the old code everywhere they were used.  Nuff said.

        * folder-browser.h: Add shell_view to folder_browser & api to set
        it.

        * folder-browser-factory.c (control_activate): Set the shell-view
        on the folder_browser.
        (control_deactivate): And clear it here.

        * folder-browser.c (folder_browser_destroy): Unhook from changed
        events on the folder before giving it away.
        (got_folder): Hook onto the folder-changed events.
        (folder_changed): Event hook proxy for folder_changed events
        (main_folder_changed): And the main code version.
        (update_status_bar): And the one that actually does the work.
        (on_selection_changed): Also call update_status_bar() to update
        the selection count.
        (folder_browser_set_shell_view): Implement function to set the
        shell_view on the folder_browser.
        (folder_browser_destroy): Release the shell_view here too.

        * mail-tools.c (mail_tool_uri_to_folder): Dont 'note' the new
        folder if its from a file: url, this is handled by hte local store
        (yeeruughck).

        * mail-local.c (mls_init):
        (free_info):
        (mls_finalise): Setup init/finalise funcs for the folderinfo hash.
        (local_storage_removed_folder_cb): re-enable.

2001-09-18    <NotZed@Ximian.com>

        * mail-local.c (MailLocalStore): Add a hash table to store
        uri<>folderinfo data.
        (mail_local_store_add_folder): Add a new folderinfo to our hash.
        (mail_local_store_remove_folder): Remove a folder by uri.
        (storage_listener_startup): Add this store to those monitored by
        the folder tree.

svn path=/trunk/; revision=12974
2001-09-19 08:29:13 +00:00
d0196161ec Don't set the folderinfo's unread count to 0 when camel reports -1, since
* mail-folder-cache.c (mail_folder_cache_note_folderinfo): Don't
	set the folderinfo's unread count to 0 when camel reports -1,
	since that may overwrite a valid unread count from before.
	(get_folder_info): Do it here instead when first creating a new
	folderinfo structure.
	Should fix bug #1756.

svn path=/trunk/; revision=12768
2001-09-11 19:29:13 +00:00
0
c7e1b2cbb0 Dynamically create the folder type list from camel. (reconfigure_clicked):
2001-09-10    <NotZed@Ximian.com>

        * mail-local.c (mail_local_reconfigure_folder): Dynamically create
        the folder type list from camel.
        (reconfigure_clicked): And change code to handle changes.

2001-09-10    <NotZed@Ximian.com>

        * merged mail_local patch from peterw.  Many changes.

svn path=/trunk/; revision=12759
2001-09-11 00:32:20 +00:00
35ecbe2de5 Due to the introduction of mail_folder_cache_remove(), we can no longer
2001-08-30  Peter Williams  <peterw@ximian.com>

	Due to the introduction of mail_folder_cache_remove(), we can no
	longer assume that mail_folder_info's always exist, so we need
	to robustify a lot of this.

	* mail-folder-cache.c (folder_browser_destroyed): New
	function. Called when the folder browser is destroyed -- analogous
	to camel_folder_finalized.
	(mail_folder_cache_note_fb): Hook it up here.
	(struct _mail_folder_info): Add a member, mail_info_id, that
	records the get_mail operation's id, so that we can cancel it if
	we need to.
	(get_folder_info): Initialize it here.
	(get_mail_info_reply): Clear it here.
	(mail_folder_cache_remove_folder): If necessary, cancel it here.
	(mail_folder_cache_note_folder): Check it here before starting a
	new operation, just in case.
	(update_message_counts_main): Take a URI instead of a
	mail_folder_info *, in case the MFI has gotten destroyed.
	(update_message_counts): Take a quark of the URI instead of a
	mail_folder_info *, for the same reason. We use a quark instead of
	an allocated gchar * because figuring out when to free the string
	gets tricky. Then go from quark -> URI string -> MFI. Return if
	the folder is no longer valid, because this indicates that the MFI
	was removed before this signal got called. Pass a string to
	update_message_counts_main instead of an MFI.
	(camel_folder_finalized): Don't bother unhooking the signals here.
	Same change as above, but don't bother checking for a valid folder
	because we're about to make it invalid anyway.
	(message_list_built): Analogous to the above, except with the
	FolderBrowser instead of the CamelFolder.
	(selection_changed): As above.
	(folder_browser_destroyed): As above.
	(struct get_mail_info_msg): Instead of taking a mail_folder_info
	*, take a URI, for reasons explained above.
	(get_mail_info_receive): Go from URI -> MFI before doing anything.
	(get_mail_info_reply): Same.
	(get_mail_info_destroy): Free the URI.
	(get_mail_info): Take a URI and return the message id so that it
	can be cancelled if necessary.
	(mail_folder_cache_remove_folder): Disconnect from signals and
	events before removing.
	(mail_folder_cache_note_folder): Use a GQuark instead of the
	mail_folder_info * as the user_data.
	(mail_folder_cache_note_fb): Same.
	(mail_folder_cache_note_folderinfo): Little formatting change.

svn path=/trunk/; revision=12532
2001-08-30 19:34:32 +00:00
17a89d643a Record the timeout_id so we can cancel it if the mail_folder_info is later
2001-08-23  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (maybe_update): Record the timeout_id so we
	can cancel it if the mail_folder_info is later freed. Also obviates
	the use of the _UPDATE_QUEUED flag.
	(mail_folder_cache_remove_folder): Cancel the timeout if we need to.
	Lock around the hash table operations. Free mfi itself. Add debugging
	spew.
	(get_folder_info): Initialiae the timeout_id to 0.

svn path=/trunk/; revision=12417
2001-08-23 15:12:28 +00:00
866a960fd9 Fix bug #215... desensitize menu items based on the number of selected
2001-08-09  Peter Williams  <peterw@ximian.com>

	Fix bug #215... desensitize menu items based on the number of
	selected messages (and whether there's a message in the pane)

	* folder-browser-ui.c (folder_browser_ui_add_message): Sensitize
	the menu items appropriately based on the old state.
	(fbui_sensitize_items): New function. Set the sensitivity of a
	list of commands.
	(folder_browser_ui_set_selection_state): New function. Move the FB
	to a new state of selected-ness, and sensitize menu items
	appropriately.
	(folder_browser_ui_message_loaded): New function. When notified
	that a message has been loaded, sensitize some menu items.

	* folder-browser-ui.h: Prototype new functions.

	* folder-browser.h: New enumeration,
	FolderBrowserSelectionState, that records the previous state
	of the selection (_NONE, _SINGLE, _MULTIPLE).

	* folder-browser.c (got_folder): If the component is set,
	set our selection state to _NONE, because that's the default
	state of the ETree.
	(on_selection_changed): When the number of selected messages
	is updated, notify the FBUI code of our new state.
	(folder_browser_gui_init): Hook up to the selection_changed
	signal and default to the _NONE selection state.
	(done_message_selected): Notify when a message is loaded.

2001-08-08  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c: Display how many messages are selected,
	too.
	(make_folder_status): If multiple messages are selected, add that
	to the string (the 0 and 1 cases are boring)
	(selection_changed): New function, update the selected count.
	(mail_folder_cache_note_fb): Connect to the selection_changed
	signal.

svn path=/trunk/; revision=12012
2001-08-14 15:26:00 +00:00
854fb9e9b0 Remove all the messages from a folder that's being deleted before actually
2001-08-10  Jason Leach  <jleach@ximian.com>

	* mail-ops.c (remove_folder_get): Remove all the messages from a
	folder that's being deleted before actually doing the
	camel_store_delete_folder, so it won't leave behind an mbox file
	that's going to prevent the actual directory from being deleted,
	and strange effects like new folders with the same name being made
	in it's place.  Bug #5618.

	* mail-folder-cache.c (mail_folder_cache_remove_folder): New
	function, a way to get something out of the folder cache, like
	folders being deleted.  Bug #6878.

svn path=/trunk/; revision=11887
2001-08-10 18:25:31 +00:00
c4ea7875dc Removed this function, it's not needed anymore.
2001-08-06  Jason Leach  <jleach@ximian.com>

	* mail-folder-cache.c (make_folder_name): Removed this function,
	it's not needed anymore.
	(mail_folder_cache_note_folderinfo): Initialize mfi->unread to 0
	always, so the shell won't get sent a random int for vtrash or
	potentially other folders.

svn path=/trunk/; revision=11699
2001-08-06 16:39:15 +00:00
3732e11baf Updates for EvolutionStorage API changes.
2001-08-03  Jason Leach  <jleach@ximian.com>

	* mail-folder-cache.c (update_idle): Updates for EvolutionStorage
	API changes.

	* mail-importer.c (mail_importer_create_folder): Ditto.

	* mail-local.c: Same here.

svn path=/trunk/; revision=11636
2001-08-03 23:12:14 +00:00
a167730678 Don't display "0 hidden".
2001-07-26  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (make_folder_status): Don't display
	"0 hidden".

svn path=/trunk/; revision=11427
2001-07-26 16:15:40 +00:00
488f755ce8 Don't display "(0 unsent)" if the outbox is empty.
2001-07-24  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (make_folder_name): Don't display "(0 unsent)" if
	the outbox is empty.

svn path=/trunk/; revision=11347
2001-07-24 18:29:23 +00:00
57d3c094da Make the error reporting a little but more descriptive.
2001-07-24  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (update_idle): Make the error reporting a little
	but more descriptive.

svn path=/trunk/; revision=11341
2001-07-24 15:41:31 +00:00
79d07ca8ca prototype outbox_folder so we can check if a folder is it.
2001-07-16  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (outbox_folder): prototype outbox_folder so we
	can check if a folder is it.
	(make_folder_name): If the folder is the outbox, display the count of
	total messages as "unsent".
	(make_folder_status): If the folder is the outbox, display "unsent"
	instead of "total"

svn path=/trunk/; revision=11132
2001-07-16 19:06:55 +00:00
e215bcef02 DUH. No need to update every folder if we set the folder browser to NULL.
2001-07-16  Peter Williams  <peterw@ximian.com>

       * mail-folder-cache.c (mail_folder_cache_set_folder_browser): DUH.
       No need to update every folder if we set the folder browser to
       NULL.

svn path=/trunk/; revision=11128
2001-07-16 14:55:19 +00:00
b9578e4858 Gave up and got rid of dm. Just replaced it with d(g_message()) and set
2001-07-09  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (dm): Gave up and got rid of dm. Just replaced it
	with d(g_message()) and set G_LOG_DOMAIN.

svn path=/trunk/; revision=10911
2001-07-09 15:17:23 +00:00
b66a80f71b Deleted (as opposed to #if 0) (get_folder_info): Changed to assume it has
2001-07-09  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (mail_folder_cache_set_update_shellview): Deleted
	(as opposed to #if 0)
	(get_folder_info): Changed to assume it has the folder lock.
	(make_folder_name): Same.
	(make_folder_status): Same.
	(update_idle): Don't unlock around the make_folder_ functions.
	(*): Changed behavior wrt. get_folder_info. Lock before calling, but
	also move preconditions before -- get_folder_info can only return NULL
	if uri is NULL. Also add preconditions for other arguments where
	necessary.

svn path=/trunk/; revision=10910
2001-07-09 14:56:13 +00:00
068ae263a0 Don't free the psd here -- it will be freed on the "destroy" signal.
2001-07-06  Peter Williams  <peterw@ximian.com>

	* mail-callbacks.c (composer_postpone_cb): Don't free the psd here --
	it will be freed on the "destroy" signal.

	* mail-folder-cache.c (maybe_update): Instead of an idle, use a very
	short timeout in hopes of reducing the number of redundant updates.

	* mail-tools.c (mail_tool_uri_to_folder): Only note the folder in the
	cache if we successfully got it.

svn path=/trunk/; revision=10852
2001-07-06 18:58:48 +00:00
40c22b25f1 Fix obvious bug in previous bugfix: Pass "fb" to check_for_fb_match() so
* mail-folder-cache.c (mail_folder_cache_set_folder_browser): Fix
	obvious bug in previous bugfix: Pass "fb" to check_for_fb_match()
	so only the selected folder gets updated, instead of "all folders
	that haven't yet been selected".

svn path=/trunk/; revision=10846
2001-07-06 16:48:47 +00:00
5438b27589 Clear the shell view label if mailer loses focus.
2001-07-05  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (mail_folder_cache_set_folder_browser): Clear the
	shell view label if mailer loses focus.

	* mail-ops.c (do_update_subfolders_rec): Check for NULL url before
	calling folder cache functions.

svn path=/trunk/; revision=10804
2001-07-05 14:37:54 +00:00
b9df218b34 Split make_string into these. (update_idle): Use (name and status) instead
2001-07-03  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (make_folder_name, make_folder_status): Split
	make_string into these.
	(update_idle): Use (name and status) instead of (wide and thin) for
	the text.

svn path=/trunk/; revision=10766
2001-07-03 21:02:50 +00:00
0e893f8bc4 Prevent folders from appearing to have -1 new messages. Prevent nonactive
2001-07-03  Peter Williams  <peterw@ximian.com>

	Prevent folders from appearing to have -1 new messages. Prevent
	nonactive folders from updating the title bar. Make the title
	bar update when switching to an already-opened folder.

	* mail-folder-cache.c (update_message_counts): Ignore the value for
	'unread' if it is -1.
	(get_mail_info_receive): Same
	(mail_folder_cache_note_folderinfo): Same.
	(get_folder_info): Initialize 'fb' to NULL.
	(mail_folder_info): Add 'fb' member.
	(mail_folder_cache_note_fb): Change note_message_list to this.
	(update_idle): Only update the ShellView if the active folder browser
	is the same as the one that the MFI references.
	(mail_folder_cache_set_folder_browser): New function. Use it to set
	the active folder browser. NULL is okay.
	(check_for_fb_match): Called from the above. If the MFI has the
	new folder browser as its view, queue an update.

	* mail-folder-cache.h: Fix prototypes.

	* mail-callbacks.c (create_folders): Check if fi->url is nonnull.

	* folder-browser.c (got_folder): Change to use note_fb instead of
	note_messge_list.

	* folder-browser-factory.c (control_activate): Set the folder browser
	(control_deactivate): Clear it here.
	(fb_get_svi): Kill some inappropriately cut-n-pasted code.

svn path=/trunk/; revision=10755
2001-07-03 17:15:26 +00:00
26b8fe817e New file. Protoypes for the Mail Folder Cache, which provides a place for
2001-07-02  Peter Williams  <peterw@ximian.com>

        * mail-folder-cache.h: New file. Protoypes for the Mail Folder Cache, which
        provides a place for all the disparate pieces of the mailer to save bits of
        information about a folder. Centralizes the information display code.

        * mail-folder-cache.c: New file. Implements the Mail Folder Cache.

        * Makefile.am (evolution_mail_SOURCES): Add the mail-folder-cache.{c,h}

        * folder-browser-factory.c (fb_get_svi): Copy of that absurdly long-named
        function in mail-display.c that gets the GNOME_Evolution_ShellView.
        (control_activate): Set the ShellView for the folder cache.

        * folder-browser.c (got_folder): Tell the folder browser about this folder.

        * mail-callbacks.c (create_folders): Tell the folder cache about the new
        folders.

        * mail-local.c (reconfigure_folder_reconfigure): Don't unhook our
        events as we no longer hook them up.
        (register_folder_registered): Tell the folder cache about this
        folder's place in the local storage.
        (register_folder_register): No longer hook events; the Folder Cache
        will do this.
        (local_folder_changed, local_folder_changed_proxy): Move to mail-folder-cache.c
        (free_local_folder): No longer unhook events.

        * mail-ops.c (do_update_subfolders_rec): Instead of setting the
        folder status ourselves, inform the Folder Cache about the changes.

        * mail-tools.c (mail_tool_uri_to_folder): Replace danw's cache
        with the new Mail Folder Cache.
        (cache_folder, etc): removed.

svn path=/trunk/; revision=10694
2001-07-02 18:42:18 +00:00