]> saetta.ns0.it Git - solipa/territorio/commitdiff
Nell'import vie da civilia, convertito il nome della master
authorAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Fri, 27 Jan 2012 12:40:58 +0000 (13:40 +0100)
committerAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Fri, 27 Jan 2012 12:40:58 +0000 (13:40 +0100)
via in modo che le parole abbiano in maiuscolo solo l'iniziale.
Aggiustamenti vari.

src/importaviecivilia.c
src/provincia.c
src/regione.c

index e1522bb24fd2f86f97e3ddbe8843a0463f0c2f83..4853bde0bed383178384fc86e593bdd23909464f 100644 (file)
@@ -92,6 +92,8 @@ TerritorioImportaVieCivilia
 
        const GdaDsnInfo *dsn;
 
+       GString *tmp;
+
        guint id_vie;
        gchar *nome;
        gchar *m1_comu_cod;
@@ -203,14 +205,17 @@ TerritorioImportaVieCivilia
                                                                                }
                                                                        id_vie++;
 
+                                                                       tmp = g_string_new (nome);
+                                                                       solipa_gstring_initial_capital (tmp);
                                                                        sql = g_strdup_printf ("INSERT INTO vie (id, nome, id_comuni, cap)"
                                                                                               " VALUES (%d, '%s',"
                                                                                               " (SELECT c.id FROM comuni AS c INNER JOIN province AS p ON c.id_province = p.id WHERE p.cod_istat || c.cod_istat = '%s'),"
                                                                                               " '%s')",
                                                                                               id_vie,
-                                                                                              nome,
+                                                                                              tmp->str,
                                                                                               m1_comu_cod,
                                                                                               m1_via_cap);
+                                                                       g_string_free (tmp, TRUE);
                                                                        if (gdaex_execute (priv->commons->gdaex, sql) == -1)
                                                                                {
                                                                                        g_free (sql);
@@ -228,16 +233,20 @@ TerritorioImportaVieCivilia
                                                                {
                                                                        id_vie = gdaex_data_model_get_value_integer_at (dm_territorio, 0, 0);
 
+                                                                       tmp = g_string_new (nome);
+                                                                       solipa_gstring_initial_capital (tmp);
+
                                                                        /* aggiorno la via */
                                                                        sql = g_strdup_printf ("UPDATE vie"
                                                                                               " SET nome = '%s',"
                                                                                               " id_comuni = (SELECT c.id FROM comuni AS c INNER JOIN province AS p ON c.id_province = p.id WHERE p.cod_istat || c.cod_istat = '%s'),"
                                                                                               " cap = '%s'"
                                                                                               " WHERE id = %d",
-                                                                                              nome,
+                                                                                              tmp->str,
                                                                                               m1_comu_cod,
                                                                                               m1_via_cap,
                                                                                               id_vie);
+                                                                       g_string_free (tmp, TRUE);
                                                                        if (gdaex_execute (priv->commons->gdaex, sql) == -1)
                                                                                {
                                                                                        g_free (sql);
index 82b85351ef250b39ff68a243257d3348569e5ff0..6c0fb5a8fc719cb0ccd558b916a4a4ab4bdf5c5c 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2010-2011 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2012 Andrea Zagli <azagli@libero.it>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -362,8 +362,6 @@ territorio_provincia_get_property (GObject *object, guint property_id, GValue *v
 static gboolean
 territorio_provincia_conferma_chiusura (TerritorioProvincia *territorio_provincia)
 {
-       GtkWidget *dialog;
-
        gboolean ret;
 
        TerritorioProvinciaPrivate *priv = TERRITORIO_PROVINCIA_GET_PRIVATE (territorio_provincia);
index f23226765200ffe33914de030d5936ea831ccf40..d6d06258795b513cec32b29fc6eb35197705b20f 100644 (file)
@@ -303,8 +303,6 @@ territorio_regione_get_property (GObject *object, guint property_id, GValue *val
 static gboolean
 territorio_regione_conferma_chiusura (TerritorioRegione *territorio_regione)
 {
-       GtkWidget *dialog;
-
        gboolean ret;
 
        TerritorioRegionePrivate *priv = TERRITORIO_REGIONE_GET_PRIVATE (territorio_regione);