Convert accidental instances of STQL to the proper SQL

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbarcode@1247182 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent e295fa9ed9
commit c0acd81bbf

@ -268,7 +268,7 @@ void KBarcode::importCSV()
new CSVImportDlg( this, "csvimportdlg" ); new CSVImportDlg( this, "csvimportdlg" );
} }
bool KBarcode::isSTQLConnected() const bool KBarcode::isSQLConnected() const
{ {
return SqlTables::isConnected(); return SqlTables::isConnected();
} }

@ -75,7 +75,7 @@ class KBarcode: public DSMainWindow, public KBarcodeIface {
/** allow the DCOP interface /** allow the DCOP interface
* to check for an SQL connection. * to check for an SQL connection.
*/ */
bool isSTQLConnected() const; bool isSQLConnected() const;
/** allow the DCOP interface /** allow the DCOP interface
* to connect to the databases. * to connect to the databases.
*/ */

@ -37,7 +37,7 @@ class KBarcodeIface : virtual public DCOPObject
virtual void importCSV() = 0; virtual void importCSV() = 0;
virtual bool isSTQLConnected() const = 0; virtual bool isSQLConnected() const = 0;
virtual bool connectSQL() = 0; virtual bool connectSQL() = 0;
virtual void showWizard() = 0; virtual void showWizard() = 0;
virtual void showConfigure() = 0; virtual void showConfigure() = 0;

@ -47,7 +47,7 @@ class MySqlDescription : public SqlDescription {
virtual const TQString showColumns( const TQString & table ) const { return "SHOW COLUMNS FROM " + table; } virtual const TQString showColumns( const TQString & table ) const { return "SHOW COLUMNS FROM " + table; }
}; };
class PostgreSTQLDescription : public SqlDescription { class PostgreSQLDescription : public SqlDescription {
public: public:
virtual const TQString initdb( TQString ) const { return "template1"; } virtual const TQString initdb( TQString ) const { return "template1"; }
virtual const TQString autoIncrement() const { return "serial NOT NULL"; } virtual const TQString autoIncrement() const { return "serial NOT NULL"; }
@ -63,7 +63,7 @@ class PostgreSTQLDescription : public SqlDescription {
}; };
/** should work for ODBC, too */ /** should work for ODBC, too */
class STQLiteDescription : public SqlDescription { class SQLiteDescription : public SqlDescription {
public: public:
virtual const TQString initdb( TQString db = TQString() ) const { return db; } virtual const TQString initdb( TQString db = TQString() ) const { return db; }
virtual const TQString autoIncrement() const { return "serial NOT NULL"; } virtual const TQString autoIncrement() const { return "serial NOT NULL"; }
@ -74,10 +74,10 @@ SqlTables::SqlTables( TQObject* parent )
: TQObject( parent, "sqltables" ) : TQObject( parent, "sqltables" )
{ {
drivers.insert( "TQMYSQL3", new MySqlDescription() ); drivers.insert( "TQMYSQL3", new MySqlDescription() );
drivers.insert( "TQPSQL7", new PostgreSTQLDescription() ); drivers.insert( "TQPSQL7", new PostgreSQLDescription() );
/* The same driver plugin is used for TQDBC and STQLite */ /* The same driver plugin is used for TQDBC and SQLite */
drivers.insert( "TQSQLITE", new STQLiteDescription() ); drivers.insert( "TQSQLITE", new SQLiteDescription() );
drivers.insert( "TQODBC3", new STQLiteDescription() ); drivers.insert( "TQODBC3", new SQLiteDescription() );
db = NULL; db = NULL;
connected = false; connected = false;

@ -15,8 +15,8 @@
* * * *
***************************************************************************/ ***************************************************************************/
#ifndef STQLTABLES_H #ifndef SQLTABLES_H
#define STQLTABLES_H #define SQLTABLES_H
#include <tqobject.h> #include <tqobject.h>
#include <tqwidget.h> #include <tqwidget.h>

@ -109,13 +109,13 @@ void TokenDialog::setupStackPage2()
TQVButtonGroup* group = new TQVButtonGroup( i18n("What do you want to insert?"), stackPage2 ); TQVButtonGroup* group = new TQVButtonGroup( i18n("What do you want to insert?"), stackPage2 );
radioVariable = new TQRadioButton( i18n("Insert a custom &variable"), group ); radioVariable = new TQRadioButton( i18n("Insert a custom &variable"), group );
radioSTQLQuery = new TQRadioButton( i18n("Insert a &SQL query"), group ); radioSQLQuery = new TQRadioButton( i18n("Insert a &SQL query"), group );
radioJavaScript = new TQRadioButton( i18n("Insert a &JavaScript function"), group ); radioJavaScript = new TQRadioButton( i18n("Insert a &JavaScript function"), group );
radioVariable->setChecked( true ); radioVariable->setChecked( true );
connect( radioVariable, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) ); connect( radioVariable, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
connect( radioSTQLQuery, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) ); connect( radioSQLQuery, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
connect( radioJavaScript, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) ); connect( radioJavaScript, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
page2->addWidget( stackPage2 ); page2->addWidget( stackPage2 );
@ -265,7 +265,7 @@ void TokenDialog::accept()
else if( radioVariableExisting->isChecked() ) else if( radioVariableExisting->isChecked() )
m_result = listVariable->currentText(); m_result = listVariable->currentText();
} }
else if( radioSTQLQuery->isChecked() ) else if( radioSQLQuery->isChecked() )
m_result = TQString( "sqlquery:%2").tqarg( editQuery->text() ); m_result = TQString( "sqlquery:%2").tqarg( editQuery->text() );
else if( radioJavaScript->isChecked() ) else if( radioJavaScript->isChecked() )
m_result = TQString( "js:%2").tqarg( editJavaScript->text() ); m_result = TQString( "js:%2").tqarg( editJavaScript->text() );
@ -301,7 +301,7 @@ void TokenDialog::showPage( TQWidget* w )
{ {
if( radioVariable->isChecked() ) if( radioVariable->isChecked() )
page3->raiseWidget( stack2Page3 ); page3->raiseWidget( stack2Page3 );
else if( radioSTQLQuery->isChecked() ) else if( radioSQLQuery->isChecked() )
page3->raiseWidget( stack2Page4 ); page3->raiseWidget( stack2Page4 );
else if( radioJavaScript->isChecked() ) else if( radioJavaScript->isChecked() )
{ {
@ -448,8 +448,8 @@ void TokenDialog::enableControls()
listVariable->isEnabled() && listVariable->currentItem() != -1 ) listVariable->isEnabled() && listVariable->currentItem() != -1 )
setFinishEnabled( page3, true ); setFinishEnabled( page3, true );
buttonQuery->setEnabled( radioSTQLQuery->isChecked() && !editQuery->text().isEmpty() && SqlTables::isConnected() ); buttonQuery->setEnabled( radioSQLQuery->isChecked() && !editQuery->text().isEmpty() && SqlTables::isConnected() );
if( radioSTQLQuery->isChecked() && !editQuery->text().isEmpty() ) if( radioSQLQuery->isChecked() && !editQuery->text().isEmpty() )
setFinishEnabled( page3, true ); setFinishEnabled( page3, true );
if( radioJavaScript->isChecked() && !editJavaScript->text().isEmpty() ) if( radioJavaScript->isChecked() && !editJavaScript->text().isEmpty() )

@ -87,7 +87,7 @@ class TokenDialog : public KWizard {
TQRadioButton* radioCustom; TQRadioButton* radioCustom;
TQRadioButton* radioAddress; TQRadioButton* radioAddress;
TQRadioButton* radioSTQLQuery; TQRadioButton* radioSQLQuery;
TQRadioButton* radioVariable; TQRadioButton* radioVariable;
TQRadioButton* radioJavaScript; TQRadioButton* radioJavaScript;

Loading…
Cancel
Save