Re: [PATCH 3/6] core: added grl_media_set_date_from_iso8601()



On 24/06/2011 11:50, Iago Toral wrote:
> 
> On Wed, 22 Jun 2011 19:07:53 +0200, Guillaume Emont
> <guijemont igalia com> wrote:
>> ---
>>  src/data/grl-media.c |   23 +++++++++++++++++++++++
>>  src/data/grl-media.h |    2 ++
>>  2 files changed, 25 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/data/grl-media.c b/src/data/grl-media.c
>> index eea3602..9d7a50b 100644
>> --- a/src/data/grl-media.c
>> +++ b/src/data/grl-media.c
>> @@ -686,6 +686,29 @@ grl_media_set_date (GrlMedia *media, const
>> GDateTime *date)
>>                        date);
>>  }
> 
> This is a public function, please add the corresponding gtk-doc and the
> corresponding gobject-introspection annotations.
In a subsequent patch, this function got replaced by
_set_{modification,publication,creation}_date_from_iso8601(). I think
all these three functions have the necessary gtk-doc.

> 
>> +gboolean
>> +grl_media_set_date_from_iso8601 (GrlMedia *media, const gchar *date)
>> +{
>> +  GTimeVal t = { 0, };
>> +
>> +  if (g_time_val_from_iso8601 (date, &t)) {
>> +    GDateTime *date_time;
>> +
>> +    /* work around https://bugzilla.gnome.org/show_bug.cgi?id=650968 */
>> +    if (t.tv_sec == 0 && t.tv_usec == 0)
>> +      return FALSE;
> 
> Should we drop a warning or something here? I don't like functions
> failing without giving any way to actually know what happened to the
> developer.
The developer knows through the return value that the date they passed
cannot be parsed. What more could we tell them?

> 
> Iago
> _______________________________________________
> grilo-list mailing list
> grilo-list gnome org
> http://mail.gnome.org/mailman/listinfo/grilo-list
> 



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