Re: [evolution-patches] Patch for bug#36247



The only other advice I can give on this new patch is that you should
use spaces (to keep style with the surrounding code)

eg:

str=g_strdup_printf("<b> %s </b>",_("Start"));

should be changed to:

str = g_strdup_printf ("<b> %s </b>", _("Start"));


also, the g_free() call for the "Start" value should be indented
properly (currently it's not indented as much as it should be - another
tab should do it).

oh, and shouldn't it be:

g_strdup_printf ("<b>%s:</b>", ...) ?

rather than

g_strdup_printf ("<b> %s </b>", ...) ?


one last thing:

        gchar *filename;
-
+       gchar *str;
        priv = itip->priv;

there should *always* be a blank line after the variable definitions and
before the first statement.

Jeff

On Sat, 2004-06-05 at 02:00, Vardhman Jain wrote:
> Thanks Jeff, I have now updated the code with your suggestion.
> 
> 
> Vardhman
> 
> On Fri, 4 Jun 2004, Jeffrey Stedfast wrote:
> 
> > Date: Fri, 04 Jun 2004 19:29:45 -0400
> > From: Jeffrey Stedfast <fejj ximian com>
> > To: Vardhman Jain <vardhman students iiit net>
> > Cc: evolution-patches lists ximian com
> > Subject: Re: [evolution-patches] Patch for bug#36247
> > 
> > I think what you actually want to do is something more like the
> > following:
> > 
> > str = g_strdup_printf ("<b>%s:</b>", _("Starts"));
> > write_label_piece (itip, &datetime, buffer, 1024, str, "<br>", FALSE);
> > g_free (str);
> > 
> > Using really long variable names is generally frowned upon because it
> > means a lot of typing (plus it's kinda ugly).
> > 
> > You also want to avoid using static sized buffers since you don't really
> > know how long the translated string will be. I'm sure 1024 is probably
> > enough, but it also wastes a lot of space :-)
> > Besides, if you were really going to use a static sized buffer with
> > sprintf, you'd at the very least want to use snprintf instead.
> > 
> > Jeff
> > 
> > On Sat, 2004-06-05 at 03:50 +0530, Vardhman Jain wrote:
> > > To improved the performance of the translation function _(str) for a 
> > > particular kind of frequently occurring string.
> > > 
> > > 
> > > Vardhman
> > > 
> > 
-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  - www.ximian.com




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