Hello Rajeev,

On 08/24/2012 02:51 PM, Rajeev Ranjan wrote:
> Hi Daniel,
>    Following is my reply to your queries.
> ------- Original Message -------
> Sender : Daniel Willmann<d.willm...@samsung.com> Engineer/SERI-Samsung Linux 
> Platform (SLP)/Samsung Electronics
> Date : Aug 24, 2012 19:06 (GMT+05:30)
> Title : Re: [E-devel] [Patch] [Elementary] elm_datetime widget bug fix : 
> Display AM/PM string(s) in all locales
> 
>> Hello,
> 
>> On 08/24/2012 02:03 PM, Rajeev Ranjan wrote:
>>> [Change Description]:
>>>    Datetime widget is modified to display default AM/PM strings incase, if, 
>>> it is not present in the locale.
>> Is that still going to display AM/PM even if the hours are in 24h mode?
>> If so I am against this. I quite like my 24h time :-)
> Nope,  it will not show AM/PM if hours are in 24h mode :).

Okay, then I have no problem :-)

>>> +   // If a locale doesn't support AM/PM strings, set the default values
>>> +   if ((buf[0] == 0) && (!strncmp(fmt, "%p", BUFF_SIZE) || strncmp(fmt, 
>>> "%P", BUFF_SIZE)))
>> Here you probably want to negate the second strncmp() as well, so:
>> ... && (!strncmp() || !strncmp())
> Basically  checking here if AM/PM is not present in the buffer(inside locale 
> string) and user wants AM/PM(by checking format here; will be set in case of 
> 12 hour settings), then setting AM/PM based on the current time.

I get that. I assume that you want to enter that branch if fmt contains
either "%p" or "%P" and not in any other case. This means checking for
!strncmp in both cases as strncmp returns zero if the strings match.

I believe in your case you will enter that branch every time buf[0]
equals zero and fmt is not equal to "%P" which I think is not what you want.

Regards,
Daniel

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to