Re: [Evolution-hackers] New plugin (Purge Old Mail) [Patch attached]



Couple nit-picks on the code...

in org_gnome_purge_mail_purge(), it'd be better to not bother freezing
the camel folde until you need to (e.g. after querying the gconf
settings) and also not getting the uids until after that too... no sense
alocating memory for a ton of UIDs if you are just gonna toss them away
if !active, right? :)

g_object_unref (G_OBJECT (gconf));

no need to cast to a G_OBJECT, g_object_[un]ref take a void*

in org_gnome_purge_mail_construct(), you need to declare your variables
BEFORE making any function calls (must comply with C89) - looks like you
have the same problem in other functions as well.

Stuff like this:

gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_enabled), gconf_client_get_bool (gconf, g_strconcat(GCONF_PURGE_MAIL_KEY_ROOT, g_strcanon(folderuri,VALID_PURGE_MAIL_CHARS,'_'), GCONF_PURGE_MAIL_KEY_ENABLE, NULL), NULL));

is not only hard to read because of how long the line is, but also leaks
memory. Please do us all a favour and break that down a bit. Use a
temporary bool and string variable.


Jeff

On Tue, 2005-11-08 at 12:16 -0200, Alexandre Rocha Lima e Marcondes
wrote:
> Hello fellow Evolution Hackers,
> 
>     I'm proud to announce a patch to incorporate a new plug-in to
> evolution: purge old mail ....
>     This plug-in allows to set the number of days to keep messages on
> folder-by-folder basis as well as enable/disable the plug-in to any
> specific folder.
> 
>     The plug-in files and the patch that is used to compile and add it
> to evolution code base is attached.
> 
>     P.S.: Thank you very much Shreyas Srinivasan for helping me on
> this first journey to code an evolution plugin ...
> 
> --
> Regards,
>   Alexandre Rocha Lima e Marcondes
>    P4 Tecnologia e Desenvolvimento Humano 
> alexandre p4tecnologia com
> alexandre psl-pr softwarelivre org
> arlm users sourceforge net 
> www.p4tecnologia.com
> alexandre.p4tecnologia.com 
> Projetos:
> MonoBrasil MonoBASIC
> ACBr 
> Freedom ERP 
> 
> 
> 
> 
> 
> 
> To validate this message's signature follow the instructions: http://www.cacert.org/index.php?id=3&lang=en_US
> _______________________________________________
> Evolution-hackers mailing list
> Evolution-hackers gnome org
> http://mail.gnome.org/mailman/listinfo/evolution-hackers
-- 
Jeffrey Stedfast
Evolution Hacker - Novell, Inc.
fejj ximian com  - www.novell.com




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