Commit Graph

17 Commits

Author SHA1 Message Date
fac0dbd69c If CAMEL_DEBUG is defined, print some useful ref/unref info.
2001-10-16  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-object.[c,h]: If CAMEL_DEBUG is defined, print some useful
	ref/unref info.

	* providers/imap/camel-imap-store.c (delete_folder): Fixed an
	assignment warning.

	* camel-uid-cache.c (camel_uid_cache_new): Make sure that the
	parent directory exists before trying to open the filename, if it
	doesn't, create it.

svn path=/trunk/; revision=13707
2001-10-16 21:47:34 +00:00
3
fc2062d77e Remove now unused 'recents' array/freeing func.
2001-10-03    <NotZed@Ximian.com>

        * providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
        Remove now unused 'recents' array/freeing func.

        * camel-object.c (camel_object_trigger_event): Oops, always run
        the prep function, even if we have no hooks listening.  Causes
        incoming imap recents to get ignored bythe camel-folder filter
        inbox code.

svn path=/trunk/; revision=13398
2001-10-03 23:57:41 +00:00
2
6df609098d Change the lock to a recursive e-mutex. (camel_object_hook_event):
2001-10-02    <NotZed@Ximian.com>

        * camel-object.c (camel_object_get_hooks): Change the lock to a
        recursive e-mutex.
        (camel_object_hook_event): Maintain list length of hook list.
        (camel_object_unhook_event): "
        (camel_object_unhook_event): If we are in an event, just mark the
        pair as removed, without removing it.
        (camel_object_trigger_event): Before running events, copy the
        list, and also ignore 'removed' events.  After running events, if
        we're all out of events, then free up any pending-removed events.
        (camel_object_free_hooks): Add some new assertions on the state of
        the hook structure.
        Removed the #error if threads not defined.  It _should_ actually
        work without threads.
        (camel_object_free_hooks): Free mutex when done.

svn path=/trunk/; revision=13347
2001-10-02 20:33:11 +00:00
7
c3d6f44895 Fill the finalised data with nonsense, rather than 0's - more easily
2001-09-27    <NotZed@Ximian.com>

	* camel-object.c (camel_object_unref): Fill the finalised data
	with nonsense, rather than 0's - more easily detect bad data.
	(camel_object_new): Clear instance data when we retrieve it off
	the list.

	* camel-object.h (_CamelObject): Added an event lock pointer for
	uh, locking event stuff.  Also change the hooklist hashtable into
	a list.  Changed all the code to handle it.  Result: thread-safe
	events, event-hooks, and save memory too, and SHOULD FINALLY FIX
	THAT UNREAD COUNT PROBLEM.

svn path=/trunk/; revision=13201
2001-09-27 22:36:53 +00:00
61b4c7ffee Make the locking more fine-grained on destruction; specifically, don't
2001-08-28  Peter Williams  <peterw@ximian.com>

	* camel-object.c (camel_object_unref): Make the locking more
	fine-grained on destruction; specifically, don't hold the
	type lock while calling the finalize functions.

svn path=/trunk/; revision=12501
2001-08-28 18:28:14 +00:00
5dfe756f5f Properly determine match type to pass to header_match.
2001-08-08  Not Zed  <NotZed@Ximian.com>

        * camel-filter-search.c (check_header): Properly determine match
        type to pass to header_match.
        (address_matches_exactly): Removed, effectively added to
        camel_search_header_match.

        * camel-folder-search.c (check_header): Properly determine the
        match type to pass to header_match.

        * camel-search-private.c (camel_search_header_match): Add a new
        parameter 'type' which is the type of header we're matching
        against.  ASIS means utf8 format, ADDRESS means an internet
        address ('formatted'), ADDRESS_ENCODED means a raw address header,
        ENCODED means rfc 2047 encoded text.
        (header_match): Move original logic here, have search_header_match
        call it as appropriate for the 'type' of match.

2001-08-07  Not Zed  <NotZed@Ximian.com>

        * camel-session.c (camel_session_class_init): Only init the vee
        provider struct once (if we're subclassed this will get called
        multiple times).

        * camel-object.c (obj_finalize): Removed a bit of a debug that
        crept in with jacob's poolv patch (?).

svn path=/trunk/; revision=11772
2001-08-08 09:37:40 +00:00
eda4386f98 Make sure that after the finalization event has happened and the
2001-07-06  Peter Williams  <peterw@ximian.com>

	* camel-object.c (camel_object_unref): Make sure that after the
	finalization event has happened and the finalization functions
	have been called that the object still has a zero refcount.

svn path=/trunk/; revision=10844
2001-07-06 13:00:48 +00:00
d0eee48606 Move this before the camel_vee_folder_remove_folder because that function
2001-07-05  Peter Williams  <peterw@ximian.com>

	* camel-vee-folder.c (camel_vee_folder_finalise): Move this before the
	camel_vee_folder_remove_folder because that function modifies p->folders
	messing up our iteration.
	(camel_vee_folder_finalise): Don't unref our summary; camel-folder now
	does this.

	* camel-object.h (CamelObject): Add a 'destroying' flag to CamelObject.

	* camel-object.c (obj_init): Clear 'destroying'.
	(camel_object_unref): If 'destroying' then do not send the finalize
	event and do not call finalize functions. Otherwise, set destroying
	so just in case we get refed (eg event code) we don't get doubly
	finalized.

svn path=/trunk/; revision=10811
2001-07-05 16:40:45 +00:00
91cc026904 Update the copyrights, replacing Helix Code with Ximian and
helixcode.com with ximian.com all over the place.

svn path=/trunk/; revision=10440
2001-06-23 08:52:02 +00:00
7d9faeb00c Applied jacob's patches for e-poolv stuff.
2001-04-26  Not Zed  <NotZed@Ximian.com>

        * Applied jacob's patches for e-poolv stuff.

svn path=/trunk/; revision=9571
2001-04-26 01:09:05 +00:00
044fde0583 Plug leaks.
* camel-object.c (camel_object_hook_event):
        * camel-uid-cache.c (camel_uid_cache_get_new_uids):
        * camel-url.c (camel_url_new_with_base): Plug leaks.

        * camel-remote-store.c (camel_remote_store_init): Don't
        re-initialize the folders hash table.

        * providers/imap/camel-imap-store.c (imap_disconnect): Free
        authtypes since they'll be re-read on re-connect.
        (get_folder_info): Free folderinfos that we're discarding from the
        list.

svn path=/trunk/; revision=9302
2001-04-13 21:36:09 +00:00
fe962a2055 Big header cleanups and nntp compile fix
svn path=/trunk/; revision=9024
2001-03-29 20:31:40 +00:00
229f78b929 No, we must not encode the headers here. These interfaces ARE raw
2000-10-18  Not Zed  <NotZed@HelixCode.com>

	* camel-mime-part.c (add_header): No, we must not encode the
	headers here.  These interfaces ARE raw interfaces as they are
	defined in camel_medium.  Also removed a bogus/meaningless FIXME.
	(set_header): Likewise here, we must not.
	(process_header): Removed another bogus comment.

	* camel-object.c (shared_is_of_type): Comment out the spitting of
	a big warning when we're trying to determine types from code.

	* providers/mbox/camel-mbox-summary.c
	(message_info_new_from_parser): Only call ibex funcitons if we
	have an index.

	* providers/mh/camel-mh-summary.c (camel_mh_summary_add): Only
	call ibex functions if we have an index.
	(remove_summary): Likewise.
	(camel_mh_summary_check): Likewise.

	* providers/nntp/camel-nntp-store.c (nntp_store_get_folder):
	get_folder -> flags argument.

	* providers/vee/camel-vee-store.c (vee_get_folder): create->flags.

	* providers/pop3/camel-pop3-store.c (get_folder): Changed create
	-> flags.

	* providers/imap/camel-imap-store.c (get_folder): Added flags
	argument.

	* providers/mh/camel-mh-folder.c (camel_mh_folder_new): Added
	flags argument, and fixed code appropriately.

	* providers/mh/camel-mh-store.c (get_folder): Added flags argument.

	* camel-folder-search.c (message_body_contains): Perform a regex
	match on the contents of messages.  This wont quite work yet as
	message contents are encoded when written to a stream.
	(build_match_regex): Converts a number of strings into a regex
	matching pattern, escaping special chars.
	(match_message): match a single message from a folder, by uid.
	Slow.
	(search_body_contains): Changed to support matching where no index
	is supplied.  Matches are performed by retrieving message
	contents, etc.
	() WTF?  camel should not be including any widget headers.

	* providers/mbox/camel-mbox-folder.c (camel_mbox_folder_new):
	Added flags argument.
	(mbox_refresh_info): Changed into a NOP, the refresh info code
	moved into the new function.
	(camel_mbox_folder_new): If we have an index requested, build one,
	otherwise, remove an old one, or just dont do anything.

	* providers/mbox/camel-mbox-store.c (get_folder): Changed create
	to flags, changed code to suit.

	* camel-store.c (camel_store_get_folder): Changed create to flags.
	(get_folder_internal): And here.
	(get_folder): And here too.

	* camel-store.h (camel_store_get_folder): Change the create
	argument to be a flags argument.

svn path=/trunk/; revision=5978
2000-10-18 06:11:54 +00:00
aa670b3306 Plug mem leaks.
svn path=/trunk/; revision=4854
2000-08-16 18:33:20 +00:00
40eea3692e Fixed some warnings.
2000-08-10  Christopher James Lahey  <clahey@helixcode.com>

	* camel-folder-search.c, camel-folder-summary.c, camel-medium.c,
	camel-mime-filter-charset.c, camel-mime-filter.c,
	camel-mime-filter.h, camel-mime-message.c, camel-mime-parser.c,
	camel-mime-part-utils.c, camel-mime-part.c, camel-mime-utils.c,
	camel-movemail.c, camel-multipart.c, camel-object.c,
	camel-stream-mem.c, providers/mbox/camel-mbox-folder.c,
	providers/mbox/camel-mbox-summary.c,
	providers/mh/camel-mh-folder.c,
	providers/smtp/camel-smtp-transport.c: Fixed some warnings.

svn path=/trunk/; revision=4719
2000-08-11 02:57:11 +00:00
8cb514d6dd Merge with camel-async.
svn path=/trunk/; revision=4687
2000-08-10 17:30:50 +00:00
580d885820 Make camel not leak like a sieve.
* camel-object.c: New subclass of GtkObject which is now the base
	of the Camel object hierarchy. Currently the only difference
	between CamelObject and GtkObject is that CamelObjects don't start
	out floating.

	* *.h: Move a bunch of typedefs to camel-types.h. Standardize on
	using <camel/foo.h> in header files rather than <foo.h>, "foo.h",
	or "camel/foo.h". Remove some unneeded includes.

	* camel-address.c, camel-data-wrapper.c, camel-folder-search.c,
	camel-folder-summary.c, camel-folder.c, camel-mime-filter.c,
	camel-mime-parser.c, camel-service.c, camel-session.c,
	camel-stream.c: These are now subclasses of CamelObject.

	* camel-data-wrapper.c (set_output_stream):
	* camel-medium.c (set_content_object):
	* camel-seekable-substream.c
	(init_with_seekable_stream_and_bounds):
	* providers/mbox/camel-mbox-folder.c (mbox_get_message_by_uid):
	remove gtk_object_sink calls.

	* camel-stream-buffer.c (init_vbuf):
	* camel-stream-filter.c (camel_stream_filter_new_with_stream):
	ref the original stream.

	* camel-folder-summary.c (camel_folder_summary_finalise): unref
	the filters when finalizing.

	* camel-mime-part-utils.c
	(simple_data_wrapper_construct_from_parser,
	camel_mime_part_construct_content_from_parser):
	* camel-mime-part.c (camel_mime_part_set_content): Unref objects
	that are created only to be handed off to other objects. If
	they're going to be needed later, they will have been additionally
	ref'ed by the object that needs them.

	* providers/pop3/camel-pop3-folder.c (get_message_by_number):
	unref the message stream after creating the data from it.

	* camel-stream.c, camel-stream-buffer.c, camel-stream-filter.c,
	camel-stream-fs.c, camel-stream-mem.c: Remove camel_stream_close,
	since its semantics are dubious (what happens when you close a
	stream other people still have references on?).

	* providers/nntp/camel-nntp-store.c:
	* providers/smtp/camel-smtp-transport.c:
	* providers/pop3/camel-pop3-store.c:
	replace camel_stream_close calls with gtk_object_unref.

	* providers/mbox/camel-mbox-folder.c:
	* providers/nntp/camel-nntp-folder.c:
	* providers/sendmail/camel-sendmail-transport.c:
	replace camel_stream_close with camel_stream_flush +
	gtk_object_unref

svn path=/trunk/; revision=2882
2000-05-07 21:56:32 +00:00