static int
osm_progress(void *ud)
{
+g_debug("SQL: Running gtk mainloop");
+#if 1
+while (gtk_events_pending())
+ gtk_main_iteration();
+#else
gtk_main_iteration_do(FALSE);
+#endif
return 0;
}
return;
gtk_progress_bar_set_text(dbpw, "");
gtk_progress_bar_set_fraction(dbpw, 0.0);
-sqlite3_progress_handler(db, OSM_DB_PROGRESS_NUM, NULL, NULL);
}
static void
gtk_progress_bar_set_text(dbpw, _("Searching..."));
gtk_progress_bar_pulse(dbpw);
gtk_main_iteration_do(FALSE);
-sqlite3_progress_handler(db, OSM_DB_PROGRESS_NUM, osm_progress, NULL);
}
void
osmdb=*db;
memset(&sql, 0, sizeof(sql));
if (osm_db_prepare(osmdb)==FALSE) {
- g_printerr("Failed to prepare OSM SQL statements:");
- g_printf("SQLITE: %s\n", sqlite3_errmsg(osmdb));
+ g_printerr("Failed to prepare OSM SQL statements: %s", sqlite3_errmsg(osmdb));
return FALSE;
}
osm_db_ok=TRUE;
return TRUE;
}
+void
+osm_db_enable_mainloop(sqlite3 *db, gboolean eml)
+{
+if (eml==FALSE)
+ sqlite3_progress_handler(db, OSM_DB_PROGRESS_NUM, NULL, NULL);
+else
+ sqlite3_progress_handler(db, OSM_DB_PROGRESS_NUM, osm_progress, NULL);
+}
+
/*****************************************************************************/
osm_way_node *
gboolean osm_way_search(gdouble lat, gdouble lon, gchar *text, GtkListStore **store);
+void osm_db_enable_mainloop(sqlite3 *db, gboolean eml);
void osm_progress_set_widget(sqlite3 *db, GtkProgressBar *w);
gboolean osm_db_prepare(sqlite3 *db);