RE: Missing API and API that needs improvements



Hi Philip,

>-----Original Message-----
>From: tinymail-devel-list-bounces gnome org 
>[mailto:tinymail-devel-list-bounces gnome org] On Behalf Of 
>ext Philip Van Hoof
>Sent: Thursday, August 24, 2006 01:15
>To: tinymail-devel-list gnome org
>Subject: Re: Missing API and API that needs improvements
>
>On Thu, 2006-08-24 at 00:11 +0200, Philip Van Hoof wrote:
>> On Wed, 2006-08-23 at 22:40 +0200, Philip Van Hoof wrote:
>> 
>> Because not a lot people would otherwise study the proposals, I'll 
>> give code examples of how they would look here:
>> 
>> > http://tinymail.org/trac/tinymail/wiki/HelpImplementingMissingAPI
>> > http://tinymail.org/trac/tinymail/wiki/HelpRedesignGettingFolders
>
>Opinions more than welcome ;-)

Well, 
========================================================================
===========
void tny_folder_iface_copy_message (TnyFolderIface *self, TnyMsgIface
*msg);
void tny_folder_iface_copy_message_by_uid (TnyFolderIface *self,
TnyFolderIface *src, const gchar *uid);
void tny_folder_iface_copy_message_by_header (TnyFolderIface *self,
TnyHeaderIface *header);
========================================================================
===========

"_by_header"? What should that do?

And there should be error handling, at the very least a gboolean return
value, but probably some
error code.


========================================================================
===========
void tny_folder_store_iface_remove_folder (TnyFolderStoreIface *self,
TnyFolderIface *folder);
TnyFolderIface *tny_folder_store_iface_create_folder
(TnyFolderStoreIface *self, const gchar *name);
========================================================================
===========

Same here, they need error handling. And I guess you'd need the parent
folder as well for these
functions.

========================================================================
========================
void tny_folder_store_iface_get_folders (TnyFolderStoreIface *self,
TnyListIface *list, 
    TnyFolderStoreQuery *query);
void tny_folder_store_iface_get_folders_async (TnyFolderStoreIface
*self, TnyListIface *list,
    TnyGetFoldersCallback callback, TnyGetFoldersStatusCallback
statuscb, TnyFolderStoreQuery *query);
========================================================================
===========

You seem to like out-params... Can't they return the list as the return
value?

========================================================================
===========
enum _TnyFolderStoreQueryOption
{
   TNY_FOLDER_STORE_QUERY_OPTION_SUBSCRIBED 1<<1,
   TNY_FOLDER_STORE_QUERY_OPTION_UNSUBSCRIBED 1<<2,
   TNY_FOLDER_STORE_QUERY_OPTION_REGEX_ON_NAME 1<<3,
   TNY_FOLDER_STORE_QUERY_OPTION_REGEX_ON_ID 1<<4,
/* Just an idea: */
   TNY_FOLDER_STORE_QUERY_OPTION_REGEX_ON_SUBJECT_HEADERS 1<<10,
   TNY_FOLDER_STORE_QUERY_OPTION_REGEX_ON_FROM_HEADERS 1<<11,
   TNY_FOLDER_STORE_QUERY_OPTION_REGEX_ON_TO_HEADERS 1<<12
};

TnyFolderStoreQuery* tny_folder_store_query_new (const gchar *regex,
TnyFolderStoreQueryOption options);
void tny_folder_store_query_add (const gchar *regex,
TnyFolderStoreQueryOption options);
========================================================================
===========



Regarding the query functions and "Just an idea", it's quite hard to do 
that correctly. For example, 'mutt' has nice patterns:
http://mutt.org/doc/manual/manual-4.html#ss4.2

But it's quite easy to over-engineer this. Or make it too inflexible.

The mutt-list mentions a great deal of things you'd want to search for,
the most important one being body-text of course. Which does not really
go
very well with tinymail I guess. Also, for dates and other ordered sets
you'd want to
be able to specify > and < instead of just ==. Regexen are bad for
numerical
comparisons.

Best wishes,
Dirk.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]