]> err.no Git - mapper/commitdiff
Call *_deinit/_init routines when reconnecting to database.
authorKaj-Michael Lang <milang@tal.org>
Wed, 31 Oct 2007 07:12:52 +0000 (09:12 +0200)
committerKaj-Michael Lang <milang@tal.org>
Wed, 31 Oct 2007 07:12:52 +0000 (09:12 +0200)
src/settings-gui.c

index d4c35bc6c2a7598d64adf6b7c12dde684ee815e2..541a9774d3305fdb797e4e645989120eb444e7f3 100644 (file)
@@ -656,15 +656,19 @@ settings_dialog(void)
                speak_set_parameters(_voice_speed, _voice_pitch);
 
                if (_db) {
+                       poi_deinit(_db);
+                       osm_deinit(_db);
                        db_close(&_db);
                        _db = NULL;
                }
                g_free(_mapper_db);
                if (strlen(gtk_entry_get_text(GTK_ENTRY(txt_mapper_db)))) {
-                       _mapper_db = g_strdup(gtk_entry_get_text(GTK_ENTRY(txt_mapper_db)));
+                       _mapper_db=g_strdup(gtk_entry_get_text(GTK_ENTRY(txt_mapper_db)));
                        db_connect(&_db, _mapper_db);
+                       poi_init(&_db);
+                       osm_init(&_db);
                } else {
-                       _mapper_db = NULL;
+                       _mapper_db=NULL;
                }
 
                /* Sensitize menus based on whether we have a database conn. */