]> saetta.ns0.it Git - solipa/libsolipa/commitdiff
Aggiunte alcune funzioni di conversione da e di GDate (closes #217).
authorAndrea Zagli <azagli@libero.it>
Sat, 26 Nov 2011 09:36:41 +0000 (10:36 +0100)
committerAndrea Zagli <azagli@libero.it>
Sat, 26 Nov 2011 09:36:41 +0000 (10:36 +0100)
.anjuta/default.profile
.anjuta/session/anjuta.session
.anjuta/session/dock-layout.xml
.anjuta_sym_db.db
src/utils.c
src/utils.h

index 6937de0b4e3d565a92cad87c23434c4afd6688a8..fab0d87615611df4d17ffdab2c5b34182fc146f6 100644 (file)
@@ -1,14 +1,14 @@
 <?xml version="1.0"?>
 <anjuta>
-    <plugin name="Tools" mandatory="no">
+    <plugin name="Terminal" mandatory="no">
         <require group="Anjuta Plugin"
                  attribute="Location"
-                 value="anjuta-tools:ATPPlugin"/>
+                 value="anjuta-terminal:TerminalPlugin"/>
     </plugin>
-    <plugin name="Terminal" mandatory="no">
+    <plugin name="Tools" mandatory="no">
         <require group="Anjuta Plugin"
                  attribute="Location"
-                 value="anjuta-terminal:TerminalPlugin"/>
+                 value="anjuta-tools:ATPPlugin"/>
     </plugin>
     <plugin name="Code Snippets" mandatory="no">
         <require group="Anjuta Plugin"
index b447efe77c34578ae4d6920ecfb86844fe3681c9..cfc725eddc13d2bbc9f96035f679c4f15b23c073 100644 (file)
@@ -1,11 +1,14 @@
 
 [Anjuta]
 Maximized=1
-Geometry=1365x746+1+0
+Geometry=1366x745+0+1
 
 [Project Manager]
 Shortcut=libsolipa//libsolipa//src//libsolipa.la%%%libsolipa//libsolipa//src//libsolipaooo.la%%%libsolipa//libsolipa//tests//allegato%%%libsolipa//libsolipa//tests//mail%%%libsolipa//libsolipa//tests//mail_get_addresses_from_string%%%libsolipa//libsolipa//tests//mailui%%%libsolipa//libsolipa//tests//ooo%%%libsolipa//libsolipa//tests//progresswindow%%%libsolipa//libsolipa//tests//utils%%%libsolipa//libsolipa//tests//utils_codfisc_piva%%%libsolipa//libsolipa//tests//utils_format_money%%%libsolipa//libsolipa//tests//utils_gdatetime%%%libsolipa//libsolipa//tests//utils_infobar%%%libsolipa//libsolipa//tests//utils_round
-Expand=libsolipa.la%%%libsolipa
+Expand=libsolipa.la%%%libsolipa%%%libsolipa//libsolipa
+
+[File Loader]
+Files=file:///home/andreaz/files/comune/solipa/libsolipa/src/utils.c#1146%%%file:///home/andreaz/files/comune/solipa/libsolipa/src/utils.h#76
 
 [Document Manager]
 bookmarks=<?xml version="1.0" encoding="UTF-8"?>\n<bookmarks/>\n
index b35c6dbff1b8a460ea6ccdccdb4012320f949ea8..b5b3e4dc02740ec81ea049b36ea1b04b4bccb874 100644 (file)
@@ -1,2 +1,2 @@
 <?xml version="1.0"?>
-<dock-layout><layout name="__default__"><dock name="__dock_1" floating="no" width="-1" height="-1" floatx="0" floaty="0"><paned orientation="horizontal" locked="no" position="1008"><notebook orientation="vertical" locked="no" page="0"><item name="AnjutaDocumentManager" orientation="vertical" locked="no"/><item name="AnjutaDevhelpDisplay" orientation="vertical" locked="no"/><item name="AnjutaTerminal" orientation="vertical" locked="no"/></notebook><paned orientation="vertical" locked="no" position="336"><notebook orientation="vertical" locked="no" page="0"><item name="AnjutaProjectManager" orientation="vertical" locked="no"/><item name="AnjutaFileManager" orientation="vertical" locked="no"/></notebook><notebook orientation="vertical" locked="no" page="1"><item name="AnjutaDevhelpIndex" orientation="vertical" locked="no"/><item name="AnjutaSymbolDB" orientation="vertical" locked="no"/></notebook></paned></paned></dock></layout></dock-layout>
+<dock-layout><layout name="__default__"><dock name="__dock_1" floating="no" width="-1" height="-1" floatx="0" floaty="0"><paned orientation="horizontal" locked="no" position="1008"><notebook orientation="vertical" locked="no" page="0"><item name="AnjutaDocumentManager" orientation="vertical" locked="no"/><item name="AnjutaDevhelpDisplay" orientation="vertical" locked="no"/><item name="AnjutaTerminal" orientation="vertical" locked="no"/></notebook><paned orientation="vertical" locked="no" position="336"><notebook orientation="vertical" locked="no" page="1"><item name="AnjutaProjectManager" orientation="vertical" locked="no"/><item name="AnjutaFileManager" orientation="vertical" locked="no"/></notebook><notebook orientation="vertical" locked="no" page="1"><item name="AnjutaDevhelpIndex" orientation="vertical" locked="no"/><item name="AnjutaSymbolDB" orientation="vertical" locked="no"/></notebook></paned></paned></dock></layout></dock-layout>
index 1dba8fde0d6281cba3fb69748a36d8e200f6b75e..6f5d3cead9ac4ac4af1216b20c0c2d0b267f59c0 100644 (file)
Binary files a/.anjuta_sym_db.db and b/.anjuta_sym_db.db differ
index 16c810716ee6a5d45a6cc1eeb01128588db04679..656cdb9fcbacd0e795b76110a35583cc5a0068a7 100644 (file)
@@ -880,17 +880,62 @@ struct tm
        return ret;
 }
 
+GDateTime
+*solipa_gdate_to_gdatetime (GDate *gdate)
+{
+       GDateTime *ret;
+
+       ret = NULL;
+       if (g_date_valid (gdate))
+               {
+                       ret = g_date_time_new_local (g_date_get_year (gdate),
+                                                    g_date_get_month (gdate),
+                                                    g_date_get_day (gdate),
+                                                    0, 0, 0.0);
+               }
+
+       return ret;
+}
+
+GDate
+*solipa_gdatetime_to_gdate (GDateTime *gdatetime)
+{
+       GDate *ret;
+
+       ret = g_new0 (GDate, 1);
+       g_date_set_year (ret, g_date_time_get_year (gdatetime));
+       g_date_set_month (ret, g_date_time_get_month (gdatetime));
+       g_date_set_day (ret, g_date_time_get_day_of_month (gdatetime));
+
+       return ret;
+}
+
 const gchar
 *solipa_tm_to_sql (struct tm *tm_data, const gchar *format)
 {
        const gchar *ret;
-       gchar *_format;
 
        ret = g_strdup ("NULL");
 
        if (tm_data != NULL)
                {
-                       ret = solipa_gdatetime_to_sql (solipa_tm_to_gdatetime (tm_data), _format);
+                       ret = solipa_gdatetime_to_sql (solipa_tm_to_gdatetime (tm_data), format);
+               }
+
+       return ret;
+}
+
+
+const gchar
+*solipa_gdate_to_sql (GDate *gdate, const gchar *format)
+{
+       const gchar *ret;
+
+       ret = g_strdup ("NULL");
+
+       if (g_date_valid (gdate))
+               {
+                       ret = solipa_gdatetime_to_sql (solipa_gdate_to_gdatetime (gdate), format);
                }
 
        return ret;
@@ -933,6 +978,18 @@ const gchar
        return ret;
 }
 
+GDate
+*solipa_get_gdate_from_string (const gchar *string, const gchar *format)
+{
+       GDate *ret;
+
+       GDateTime *gdatetime;
+
+       gdatetime = solipa_get_gdatetime_from_string (string, format);
+
+       ret = solipa_gdatetime_to_gdate (gdatetime);
+}
+
 GDateTime
 *solipa_get_gdatetime_from_string (const gchar *string, const gchar *format)
 {
@@ -1085,6 +1142,8 @@ GDateTime
                                }
                }
 
+       g_strfreev (format_tokens);
+       g_strfreev (str_tokens);
        g_free (delimiters);
        g_free (new_format);
        g_free (new_str);
@@ -1102,6 +1161,18 @@ GDateTime
        return ret;
 }
 
+gchar
+*solipa_gdate_format (GDate *gdate, const gchar *format)
+{
+       gchar *ret;
+
+       if (g_date_valid (gdate)) return "";
+
+       ret = solipa_gdatetime_format (solipa_gdate_to_gdatetime (gdate), format);
+
+       return ret;
+}
+
 gchar
 *solipa_gdatetime_format (GDateTime *gdatetime, const gchar *format)
 {
index 366985982b94b92140026a428ce6aa456cc659dd..73128405e8655a0ae6749408744e398db3aef0e6 100644 (file)
@@ -64,10 +64,16 @@ GDate *solipa_get_today_gdate (void);
 GDateTime *solipa_tm_to_gdatetime (struct tm *tm_data);
 struct tm *solipa_gdatetime_to_tm (GDateTime *gdatetime);
 
+GDateTime *solipa_gdate_to_gdatetime (GDate *gdate);
+GDate *solipa_gdatetime_to_gdate (GDateTime *gdatetime);
+
 const gchar *solipa_tm_to_sql (struct tm *tm_data, const gchar *format);
+const gchar *solipa_gdate_to_sql (GDate *gdate, const gchar *format);
 const gchar *solipa_gdatetime_to_sql (GDateTime *gdatetime, const gchar *format);
 
+GDate *solipa_get_gdate_from_string (const gchar *string, const gchar *format);
 GDateTime *solipa_get_gdatetime_from_string (const gchar *string, const gchar *format);
+gchar *solipa_gdate_format (GDate *gdate, const gchar *format);
 gchar *solipa_gdatetime_format (GDateTime *gdatetime, const gchar *format);
 
 gdouble solipa_round (gdouble value, guint n_decimals);