From d572a3f536f3cb283303c161095c5e83d4dc27da Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 17 Oct 2024 17:11:53 +0900 Subject: Remove check for obsolete sqlite support. Check only for aqlite3 Signed-off-by: Michele Calgaro --- src/backends/SQLite/literecipedb.cpp | 18 ++++-------------- src/backends/SQLite/literecipedb.h | 2 -- src/backends/recipedb.cpp | 10 +++++----- 3 files changed, 9 insertions(+), 21 deletions(-) (limited to 'src/backends') diff --git a/src/backends/SQLite/literecipedb.cpp b/src/backends/SQLite/literecipedb.cpp index 9531791..fa5577a 100644 --- a/src/backends/SQLite/literecipedb.cpp +++ b/src/backends/SQLite/literecipedb.cpp @@ -27,8 +27,6 @@ #if HAVE_SQLITE3 #include -#elif HAVE_SQLITE -#include #endif //keep these two around for porting old databases @@ -63,9 +61,7 @@ int LiteRecipeDB::lastInsertID() TQStringList LiteRecipeDB::backupCommand() const { - #if HAVE_SQLITE - TQString binary = "sqlite"; - #elif HAVE_SQLITE3 + #if HAVE_SQLITE3 TQString binary = "sqlite3"; #endif @@ -80,9 +76,7 @@ TQStringList LiteRecipeDB::backupCommand() const TQStringList LiteRecipeDB::restoreCommand() const { - #if HAVE_SQLITE - TQString binary = "sqlite"; - #elif HAVE_SQLITE3 + #if HAVE_SQLITE3 TQString binary = "sqlite3"; #endif @@ -1014,15 +1008,11 @@ TQString escape( const TQString &s ) if ( !s_escaped.isEmpty() ) { //###: sqlite_mprintf() seems to fill an empty string with garbage // Escape using SQLite's function -#if HAVE_SQLITE - char * escaped = sqlite_mprintf( "%q", s.latin1() ); // Escape the string(allocates memory) -#elif HAVE_SQLITE3 +#if HAVE_SQLITE3 char * escaped = sqlite3_mprintf( "%q", s.latin1() ); // Escape the string(allocates memory) #endif s_escaped = escaped; -#if HAVE_SQLITE - sqlite_freemem( escaped ); // free allocated memory -#elif HAVE_SQLITE3 +#if HAVE_SQLITE3 sqlite3_free( escaped ); // free allocated memory #endif } diff --git a/src/backends/SQLite/literecipedb.h b/src/backends/SQLite/literecipedb.h index f108599..f7b116d 100644 --- a/src/backends/SQLite/literecipedb.h +++ b/src/backends/SQLite/literecipedb.h @@ -23,8 +23,6 @@ #ifdef HAVE_SQLITE3 #define SQLITE_DRIVER "TQSQLITE3" -#elif HAVE_SQLITE -#define SQLITE_DRIVER "TQSQLITE" #endif class LiteRecipeDB : public TQSqlRecipeDB diff --git a/src/backends/recipedb.cpp b/src/backends/recipedb.cpp index fbc0ff4..ab540b7 100644 --- a/src/backends/recipedb.cpp +++ b/src/backends/recipedb.cpp @@ -46,7 +46,7 @@ #include "MySQL/mysqlrecipedb.h" #endif -#if HAVE_SQLITE || HAVE_SQLITE3 +#if HAVE_SQLITE3 #include "SQLite/literecipedb.h" #endif @@ -119,18 +119,18 @@ RecipeDB* RecipeDB::createDatabase( const TQString &dbType, const TQString &host if ( 0 ) ; //we need some condition here -#if HAVE_SQLITE || HAVE_SQLITE3 +#if HAVE_SQLITE3 else if ( dbType == "SQLite" ) { database = new LiteRecipeDB( file ); } -#endif //HAVE_SQLITE || HAVE_SQLITE3 - #if HAVE_MYSQL +#endif // HAVE_SQLITE3 +#if HAVE_MYSQL else if ( dbType == "MySQL" ) { database = new MySQLRecipeDB( host, user, pass, dbname, port ); } #endif //HAVE_MYSQL - #if HAVE_POSTGRESQL +#if HAVE_POSTGRESQL else if ( dbType == "PostgreSQL" ) { database = new PSqlRecipeDB( host, user, pass, dbname, port ); } -- cgit v1.2.1