gint i;
g_printf("Checking default categories\n");
-sqlite3_prepare_v2(db,"insert into category (cat_id, label, desc, enabled)"
- " values (?, ?, ?, 1)",
+sqlite3_prepare_v2(db,"insert or replace into category (cat_id, label, desc, enabled, priority)"
+ " values (?, ?, ?, 1, ?)",
-1, &sql_cat, NULL);
for (i=0; default_poi_categories[i].name; i++) {
sqlite3_bind_int(sql_cat, 1, default_poi_categories[i].type);
sqlite3_bind_text(sql_cat, 2, default_poi_categories[i].name , -1, SQLITE_TRANSIENT);
sqlite3_bind_text(sql_cat, 3, default_poi_categories[i].desc , -1, SQLITE_TRANSIENT);
+ sqlite3_bind_int(sql_cat, 4, default_poi_categories[i].type/100);
sqlite3_step(sql_cat);
sqlite3_reset(sql_cat);
sqlite3_clear_bindings(sql_cat);
"desc text, "
"icon text, "
"color char(7), "
+ "priority integer default 2, "
"enabled integer);");
if (SQLITE_OK != sqlite3_exec(db, create_sql, NULL, NULL, NULL)
" from category c"
" left outer join poi p on c.cat_id = p.cat_id"
" group by c.cat_id, c.label, c.desc, c.enabled "
- " order by c.label", -1, &_stmt_selall_cat, NULL);
+ " order by c.priority,c.label", -1, &_stmt_selall_cat, NULL);
return TRUE;
}