|
|
@ -79,6 +79,12 @@ SqlTables::SqlTables( TQObject* parent )
|
|
|
|
drivers.insert( "QSQLITE", new SQLiteDescription() );
|
|
|
|
drivers.insert( "QSQLITE", new SQLiteDescription() );
|
|
|
|
drivers.insert( "QODBC3", new SQLiteDescription() );
|
|
|
|
drivers.insert( "QODBC3", new SQLiteDescription() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drivers.insert( "TQMYSQL3", new MySqlDescription() );
|
|
|
|
|
|
|
|
drivers.insert( "TQPSQL7", new PostgreSQLDescription() );
|
|
|
|
|
|
|
|
/* The same driver plugin is used for TQDBC and SQLite */
|
|
|
|
|
|
|
|
drivers.insert( "TQSQLITE", new SQLiteDescription() );
|
|
|
|
|
|
|
|
drivers.insert( "TQODBC3", new SQLiteDescription() );
|
|
|
|
|
|
|
|
|
|
|
|
db = NULL;
|
|
|
|
db = NULL;
|
|
|
|
connected = false;
|
|
|
|
connected = false;
|
|
|
|
loadConfig();
|
|
|
|
loadConfig();
|
|
|
@ -152,7 +158,7 @@ bool SqlTables::newTables( const TQString & username, const TQString & password,
|
|
|
|
|
|
|
|
|
|
|
|
if(dbase->open()) {
|
|
|
|
if(dbase->open()) {
|
|
|
|
|
|
|
|
|
|
|
|
if (driver != "QSQLITE")
|
|
|
|
if ((driver != "QSQLITE") && (driver != "TQSQLITE"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool found = false;
|
|
|
|
bool found = false;
|
|
|
|
TQSqlQuery existing("SHOW DATABASES LIKE '" + database + "';");
|
|
|
|
TQSqlQuery existing("SHOW DATABASES LIKE '" + database + "';");
|
|
|
@ -349,7 +355,7 @@ void SqlTables::loadConfig()
|
|
|
|
sqldata.password = config->readEntry("password", "" );
|
|
|
|
sqldata.password = config->readEntry("password", "" );
|
|
|
|
sqldata.hostname = config->readEntry("hostname", "localhost" );
|
|
|
|
sqldata.hostname = config->readEntry("hostname", "localhost" );
|
|
|
|
sqldata.database = config->readEntry("database", "kbarcode" );
|
|
|
|
sqldata.database = config->readEntry("database", "kbarcode" );
|
|
|
|
sqldata.driver = config->readEntry("driver", "QMYSQL3" );
|
|
|
|
sqldata.driver = config->readEntry("driver", "TQMYSQL3" );
|
|
|
|
sqldata.autoconnect = config->readBoolEntry("autoconnect", false );
|
|
|
|
sqldata.autoconnect = config->readBoolEntry("autoconnect", false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -376,7 +382,7 @@ void SqlTables::updateTables()
|
|
|
|
* as they have already been created with the most
|
|
|
|
* as they have already been created with the most
|
|
|
|
* recent database structures.
|
|
|
|
* recent database structures.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if( sqldata.driver != "QMYSQL3" )
|
|
|
|
if ((sqldata.driver != "QMYSQL3") && (sqldata.driver != "TQMYSQL3"))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
bool changed = false;
|
|
|
|
bool changed = false;
|
|
|
|