Change Description:
[elm_datetime.c] Separator parsing logic is changed in Datetime widget. 
Predefined set of characters (both global and field specific) are ignored as 
field separators.




Can some one, please review and check-in the code in SVN Elementary. 



Thanks,
Sumanth


------------------------------------

-Regards, Hermet-
Index: src/lib/elm_datetime.c
===================================================================
--- src/lib/elm_datetime.c	(revision 70144)
+++ src/lib/elm_datetime.c	(working copy)
@@ -74,19 +74,21 @@ struct _Format_Map
    char *fmt_char;
    int def_min;
    int def_max;
+   char *ignore_sep;
 };
 
 // default limits for individual fields
 static Format_Map mapping[DATETIME_TYPE_COUNT] = {
-   [ELM_DATETIME_YEAR]   =  { "Yy",  -1,  -1  },
-   [ELM_DATETIME_MONTH]  =  { "mbBh", 0,  11  },
-   [ELM_DATETIME_DATE]   =  { "de",   1,  31  },
-   [ELM_DATETIME_HOUR]   =  { "IHkl", 0,  23  },
-   [ELM_DATETIME_MINUTE] =  { "M",    0,  59  },
-   [ELM_DATETIME_AMPM]   =  { "pP",   0,  1   }
+   [ELM_DATETIME_YEAR]   =  { "Yy",  -1,  -1, "" },
+   [ELM_DATETIME_MONTH]  =  { "mbBh", 0,  11, "" },
+   [ELM_DATETIME_DATE]   =  { "de",   1,  31, "" },
+   [ELM_DATETIME_HOUR]   =  { "IHkl", 0,  23, "" },
+   [ELM_DATETIME_MINUTE] =  { "M",    0,  59, ":" },
+   [ELM_DATETIME_AMPM]   =  { "pP",   0,   1, "" }
 };
 
 static const char *multifield_formats = "cxXrRTDF";
+static const char *ignore_separators = "()";
 
 static Datetime_Mod_Api *dt_mod = NULL;
 static const char *widtype = NULL;
@@ -678,9 +680,11 @@ _parse_format(Evas_Object *obj, char *fmt_ptr)
              separator[len] = 0;
              if (field) eina_stringshare_replace(&field->separator, separator);
           }
+
+        // ignore the set of chars (global, field specific) as field separators.
         if (sep_parsing && (len < MAX_SEPARATOR_LEN - 1) &&
-            (field->type != ELM_DATETIME_AMPM) &&
-            (!((field->type == ELM_DATETIME_MINUTE) && (cur ==':'))))
+            (field->type != ELM_DATETIME_AMPM) && (!strchr(ignore_separators, cur)) &&
+            (!strchr(mapping[idx].ignore_sep, cur)))
            separator[len++] = cur;
         if (sep_lookup) sep_parsing = EINA_TRUE;
         sep_lookup = EINA_FALSE;
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to