return false;
}
+ public int count (string table) {
+ string sql = "SELECT count(*) FROM %s".printf (table);
+ Statement stmt;
+ int rc;
+ int count = 0;
+
+ rc = db.prepare_v2 (sql, -1, out stmt);
+ if (rc != Sqlite.OK) {
+ stderr.printf ("SQL error: %d, %s\n", rc, db.errmsg ());
+ db.progress_handler (0, null);
+ return 0;
+ }
+
+ do {
+ rc = stmt.step ();
+ if (rc == Sqlite.ROW) {
+ count = stmt.column_int (0);
+ }
+ } while (rc == Sqlite.ROW);
+
+ return count;
+ }
+
+ public bool has_plots () {
+ return (count ("Plots") > 0);
+ }
+
public int clear () {
int rc;