From 49120f48474fc8fdc2448c75d961bc238213cfac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 1 May 2018 14:34:32 +0200 Subject: New upstream version 0.28.2 --- .../shotwell-data-imports/FSpotDatabaseTable.vala | 54 ---------------------- 1 file changed, 54 deletions(-) delete mode 100644 plugins/shotwell-data-imports/FSpotDatabaseTable.vala (limited to 'plugins/shotwell-data-imports/FSpotDatabaseTable.vala') diff --git a/plugins/shotwell-data-imports/FSpotDatabaseTable.vala b/plugins/shotwell-data-imports/FSpotDatabaseTable.vala deleted file mode 100644 index f2bcdc9..0000000 --- a/plugins/shotwell-data-imports/FSpotDatabaseTable.vala +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2016 Software Freedom Conservancy Inc. - * - * This software is licensed under the GNU LGPL (version 2.1 or later). - * See the COPYING file in this distribution. - */ - -namespace DataImports.FSpot.Db { - -/** - * This class represents a generic F-Spot table. - */ -public abstract class FSpotDatabaseTable : ImportableDatabaseTable { - protected unowned Sqlite.Database fspot_db; - protected FSpotTableBehavior behavior; - - public FSpotDatabaseTable(Sqlite.Database db) { - this.fspot_db = db; - } - - public void set_behavior(FSpotTableBehavior behavior) { - this.behavior = behavior; - set_table_name(behavior.get_table_name()); - } - - public FSpotTableBehavior get_behavior() { - return behavior; - } - - protected string get_joined_column_list(bool with_table = false) { - string[] columns = behavior.list_columns(); - if (with_table) - for (int i = 0; i < columns.length; i++) - columns[i] = "%s.%s".printf(table_name, columns[i]); - return string.joinv(", ", columns); - } - - protected int select_all(out Sqlite.Statement stmt) throws DatabaseError { - string column_list = get_joined_column_list(); - string sql = "SELECT %s FROM %s".printf(column_list, table_name); - - int res = fspot_db.prepare_v2(sql, -1, out stmt); - if (res != Sqlite.OK) - throw_error("Statement failed: %s".printf(sql), res); - - res = stmt.step(); - if (res != Sqlite.ROW && res != Sqlite.DONE) - throw_error("select_all %s %s".printf(table_name, column_list), res); - - return res; - } -} - -} - -- cgit v1.2.3