diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /languages/sql | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/sql')
-rw-r--r-- | languages/sql/sqlactions.cpp | 30 | ||||
-rw-r--r-- | languages/sql/sqlactions.h | 8 | ||||
-rw-r--r-- | languages/sql/sqlconfigwidget.ui.h | 82 | ||||
-rw-r--r-- | languages/sql/sqloutputwidget.cpp | 70 | ||||
-rw-r--r-- | languages/sql/sqloutputwidget.h | 16 | ||||
-rw-r--r-- | languages/sql/sqlsupport_part.cpp | 104 | ||||
-rw-r--r-- | languages/sql/sqlsupport_part.h | 16 |
7 files changed, 163 insertions, 163 deletions
diff --git a/languages/sql/sqlactions.cpp b/languages/sql/sqlactions.cpp index 8cfac095..df8ba309 100644 --- a/languages/sql/sqlactions.cpp +++ b/languages/sql/sqlactions.cpp @@ -11,9 +11,9 @@ #include "sqlactions.h" -#include <qpopupmenu.h> -#include <qstringlist.h> -#include <qsqldatabase.h> +#include <tqpopupmenu.h> +#include <tqstringlist.h> +#include <tqsqldatabase.h> #include <kdebug.h> #include <klocale.h> @@ -25,9 +25,9 @@ #include "kdevlanguagesupport.h" #include "sqlsupport_part.h" -SqlListAction::SqlListAction(SQLSupportPart *part, const QString &text, +SqlListAction::SqlListAction(SQLSupportPart *part, const TQString &text, const KShortcut& cut, - const QObject *receiver, const char *slot, + const TQObject *receiver, const char *slot, KActionCollection *parent, const char *name) : KWidgetAction( m_combo = new KComboBox(), text, cut, 0, 0, parent, name), m_part(part) { @@ -39,8 +39,8 @@ SqlListAction::SqlListAction(SQLSupportPart *part, const QString &text, m_combo->setMinimumWidth( 200 ); m_combo->setMaximumWidth( 400 ); - connect( m_combo, SIGNAL(activated(const QString&)), receiver, slot ); - connect( m_combo, SIGNAL(activated(int)), this, SLOT(activated(int)) ); + connect( m_combo, TQT_SIGNAL(activated(const TQString&)), receiver, slot ); + connect( m_combo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(activated(int)) ); setShortcutConfigurable( false ); setAutoSized( true ); @@ -49,7 +49,7 @@ SqlListAction::SqlListAction(SQLSupportPart *part, const QString &text, } -void SqlListAction::setCurrentConnectionName(const QString &name) +void SqlListAction::setCurrentConnectionName(const TQString &name) { int idx = m_part->connections().findIndex( name ); if ( idx < 0 ) @@ -59,10 +59,10 @@ void SqlListAction::setCurrentConnectionName(const QString &name) } -QString SqlListAction::currentConnectionName() const +TQString SqlListAction::currentConnectionName() const { if ( m_combo->currentItem() <= 0 ) - return QString::null; + return TQString::null; return m_part->connections()[ m_combo->currentItem() - 1 ]; } @@ -70,22 +70,22 @@ void SqlListAction::activated(int idx) { if (idx < 1 || (int)m_part->connections().count() <= idx) return; - const QSqlDatabase *db = QSqlDatabase::database(m_part->connections()[idx], true); + const TQSqlDatabase *db = TQSqlDatabase::database(m_part->connections()[idx], true); m_combo->changeItem( db->isOpen() ? SmallIcon( "ok" ) : SmallIcon( "no" ), m_combo->text(idx), idx ); } void SqlListAction::refresh() { - const QStringList& dbc = m_part->connections(); + const TQStringList& dbc = m_part->connections(); m_combo->clear(); m_combo->insertItem( i18n("<no database server>") ); - QString cName; - for ( QStringList::ConstIterator it = dbc.begin(); it != dbc.end(); ++it ) { + TQString cName; + for ( TQStringList::ConstIterator it = dbc.begin(); it != dbc.end(); ++it ) { - QSqlDatabase* db = QSqlDatabase::database( (*it), false ); + TQSqlDatabase* db = TQSqlDatabase::database( (*it), false ); if ( !db ) { kdDebug( 9000 ) << "Could not find database connection " << (*it) << endl; m_combo->insertItem( SmallIcon( "no" ), i18n("<error - no connection %1>").arg( *it ) ); diff --git a/languages/sql/sqlactions.h b/languages/sql/sqlactions.h index e49794e5..8cc7b5df 100644 --- a/languages/sql/sqlactions.h +++ b/languages/sql/sqlactions.h @@ -23,11 +23,11 @@ class SqlListAction : public KWidgetAction { Q_OBJECT public: - SqlListAction( SQLSupportPart *part, const QString &text, const KShortcut& cut, - const QObject *receiver, const char *slot, + SqlListAction( SQLSupportPart *part, const TQString &text, const KShortcut& cut, + const TQObject *receiver, const char *slot, KActionCollection *parent, const char *name ); - void setCurrentConnectionName(const QString &name); - QString currentConnectionName() const; + void setCurrentConnectionName(const TQString &name); + TQString currentConnectionName() const; void refresh(); private slots: diff --git a/languages/sql/sqlconfigwidget.ui.h b/languages/sql/sqlconfigwidget.ui.h index c99d8722..26a9fb0b 100644 --- a/languages/sql/sqlconfigwidget.ui.h +++ b/languages/sql/sqlconfigwidget.ui.h @@ -7,11 +7,11 @@ ** place of a destructor. *****************************************************************************/ -#include <qsqldatabase.h> -#include <qcombobox.h> -#include <qspinbox.h> -#include <qdom.h> -#include <qstringlist.h> +#include <tqsqldatabase.h> +#include <tqcombobox.h> +#include <tqspinbox.h> +#include <tqdom.h> +#include <tqstringlist.h> #include <klocale.h> #include <klineedit.h> @@ -25,23 +25,23 @@ class PluginTableItem: public QTableItem { public: - PluginTableItem( QTable* table, const QString& text = QString::null ): QTableItem( table, QTableItem::OnTyping, text ) {} + PluginTableItem( TQTable* table, const TQString& text = TQString::null ): TQTableItem( table, TQTableItem::OnTyping, text ) {} - virtual QWidget* createEditor() const + virtual TQWidget* createEditor() const { - QComboBox* combo = new QComboBox( true, table() ); - combo->insertStringList( QSqlDatabase::drivers() ); + TQComboBox* combo = new TQComboBox( true, table() ); + combo->insertStringList( TQSqlDatabase::drivers() ); if ( !text().isEmpty() ) combo->setCurrentText( text() ); return combo; } - virtual void setContentFromEditor( QWidget* w ) + virtual void setContentFromEditor( TQWidget* w ) { - if ( w->inherits( "QComboBox" ) ) - setText( ( (QComboBox*)w )->currentText() ); + if ( w->inherits( "TQComboBox" ) ) + setText( ( (TQComboBox*)w )->currentText() ); else - QTableItem::setContentFromEditor( w ); + TQTableItem::setContentFromEditor( w ); } }; @@ -49,23 +49,23 @@ public: class PortTableItem: public QTableItem { public: - PortTableItem( QTable* table, const QString& text = QString::null ): QTableItem( table, QTableItem::OnTyping, text ) {} + PortTableItem( TQTable* table, const TQString& text = TQString::null ): TQTableItem( table, TQTableItem::OnTyping, text ) {} - virtual QWidget* createEditor() const + virtual TQWidget* createEditor() const { - QSpinBox* sb = new QSpinBox( -1, 65535, 1, table() ); + TQSpinBox* sb = new TQSpinBox( -1, 65535, 1, table() ); sb->setSpecialValueText( i18n("Default") ); if ( !text().isEmpty() ) sb->setValue( text().toInt() ); return sb; } - virtual void setContentFromEditor( QWidget* w ) + virtual void setContentFromEditor( TQWidget* w ) { - if ( w->inherits( "QSpinBox" ) ) - setText( ( (QSpinBox*)w )->text() ); + if ( w->inherits( "TQSpinBox" ) ) + setText( ( (TQSpinBox*)w )->text() ); else - QTableItem::setContentFromEditor( w ); + TQTableItem::setContentFromEditor( w ); } }; @@ -73,33 +73,33 @@ public: class PasswordTableItem: public QTableItem { public: - PasswordTableItem( QTable* table, const QString& text = QString::null ): QTableItem( table, QTableItem::OnTyping, text ) {} + PasswordTableItem( TQTable* table, const TQString& text = TQString::null ): TQTableItem( table, TQTableItem::OnTyping, text ) {} - virtual QWidget* createEditor() const + virtual TQWidget* createEditor() const { KLineEdit* le = new KLineEdit( table() ); - le->setEchoMode( QLineEdit::Password ); + le->setEchoMode( TQLineEdit::Password ); return le; } - virtual void setContentFromEditor( QWidget* w ) + virtual void setContentFromEditor( TQWidget* w ) { if ( w->inherits( "KLineEdit" ) ) { password = ( (KLineEdit*)w )->text(); - setText( QString().fill( '*', password.length() ) ); + setText( TQString().fill( '*', password.length() ) ); } else { - QTableItem::setContentFromEditor( w ); + TQTableItem::setContentFromEditor( w ); } } - virtual void setText(const QString& bogus) + virtual void setText(const TQString& bogus) { - QTableItem::setText(QString().fill('*', bogus.length())); + TQTableItem::setText(TQString().fill('*', bogus.length())); } - QString password; + TQString password; }; -static bool isEmptyRow( QTable* tbl, int row ) +static bool isEmptyRow( TQTable* tbl, int row ) { for ( int i = 0; i < tbl->numCols(); i++ ) { if ( !tbl->text( row, i ).isEmpty() ) @@ -119,7 +119,7 @@ void SqlConfigWidget::init() changed = false; } -static void addRow( QTable* dbTable ) +static void addRow( TQTable* dbTable ) { dbTable->insertRows( dbTable->numRows() ); dbTable->setItem( dbTable->numRows() - 1, 0, @@ -163,19 +163,19 @@ void SqlConfigWidget::updateButtons() void SqlConfigWidget::testDb() { - static const QString cName( "SqlConfigWidgetTest" ); + static const TQString cName( "SqlConfigWidgetTest" ); int cr = dbTable->currentRow(); if (cr < 0) return; - QSqlDatabase* db = QSqlDatabase::addDatabase( dbTable->text( cr, 0 ), cName ); + TQSqlDatabase* db = TQSqlDatabase::addDatabase( dbTable->text( cr, 0 ), cName ); db->setDatabaseName( dbTable->text( cr, 1 ) ); db->setHostName( dbTable->text( cr, 2 ) ); bool ok; int port = dbTable->text( cr, 3 ).toInt( &ok ); if (ok && port >= 0) db->setPort( port ); - QString pass = ((PasswordTableItem*)dbTable->item( cr, 5 ))->password; + TQString pass = ((PasswordTableItem*)dbTable->item( cr, 5 ))->password; if ( db->open( dbTable->text( cr, 4 ), pass ) ) { KMessageBox::information( this, i18n("Connection successful") ); @@ -187,7 +187,7 @@ void SqlConfigWidget::testDb() } db = 0; - QSqlDatabase::removeDatabase( cName ); + TQSqlDatabase::removeDatabase( cName ); } @@ -195,18 +195,18 @@ void SqlConfigWidget::accept() { Q_ASSERT( doc ); - QDomElement dbElem = DomUtil::createElementByPath( *doc, "/kdevsqlsupport/servers" ); + TQDomElement dbElem = DomUtil::createElementByPath( *doc, "/kdevsqlsupport/servers" ); DomUtil::makeEmpty( dbElem ); for ( int i = 0; i < dbTable->numRows() - 1; i++ ) { - QStringList db; + TQStringList db; db << dbTable->text( i, 0 ) << dbTable->text( i, 1 ) << dbTable->text( i, 2 ) << dbTable->text( i, 3 ) << dbTable->text( i, 4 ) << SQLSupportPart::cryptStr( ((PasswordTableItem*)dbTable->item( i, 5 ))->password ); DomUtil::writeListEntry( *doc, - "/kdevsqlsupport/servers/server" + QString::number( i ), + "/kdevsqlsupport/servers/server" + TQString::number( i ), "el", db ); } if ( changed ) @@ -214,7 +214,7 @@ void SqlConfigWidget::accept() } -void SqlConfigWidget::setProjectDom( QDomDocument * doc ) +void SqlConfigWidget::setProjectDom( TQDomDocument * doc ) { this->doc = doc; } @@ -224,10 +224,10 @@ void SqlConfigWidget::loadConfig() { Q_ASSERT( doc ); - QStringList db; + TQStringList db; int i = 0; while ( true ) { - QStringList db = DomUtil::readListEntry( *doc, "kdevsqlsupport/servers/server" + QString::number( i ), "el" ); + TQStringList db = DomUtil::readListEntry( *doc, "kdevsqlsupport/servers/server" + TQString::number( i ), "el" ); if ( db.isEmpty() ) return; diff --git a/languages/sql/sqloutputwidget.cpp b/languages/sql/sqloutputwidget.cpp index a0d7368d..f7d84fde 100644 --- a/languages/sql/sqloutputwidget.cpp +++ b/languages/sql/sqloutputwidget.cpp @@ -9,16 +9,16 @@ * * ***************************************************************************/ -#include <qsqldatabase.h> -#include <qsqlerror.h> -#include <qsqlcursor.h> -#include <qsqldriver.h> -#include <qsqlrecord.h> -#include <qwidgetstack.h> -#include <qdatatable.h> -#include <qtextedit.h> -#include <qlayout.h> -#include <qstylesheet.h> +#include <tqsqldatabase.h> +#include <tqsqlerror.h> +#include <tqsqlcursor.h> +#include <tqsqldriver.h> +#include <tqsqlrecord.h> +#include <tqwidgetstack.h> +#include <tqdatatable.h> +#include <tqtextedit.h> +#include <tqlayout.h> +#include <tqstylesheet.h> #include <klocale.h> @@ -27,56 +27,56 @@ class QCustomSqlCursor: public QSqlCursor { public: - QCustomSqlCursor( const QString & query = QString::null, bool autopopulate = TRUE, QSqlDatabase* db = 0 ) : - QSqlCursor( QString::null, autopopulate, db ) + QCustomSqlCursor( const TQString & query = TQString::null, bool autopopulate = TRUE, TQSqlDatabase* db = 0 ) : + TQSqlCursor( TQString::null, autopopulate, db ) { exec( query ); if ( isSelect() && autopopulate ) { - QSqlRecordInfo inf = ((QSqlQuery*)this)->driver()->recordInfo( *(QSqlQuery*)this ); - for ( QSqlRecordInfo::iterator it = inf.begin(); it != inf.end(); ++it ) { + TQSqlRecordInfo inf = ((TQSqlQuery*)this)->driver()->recordInfo( *(TQSqlQuery*)this ); + for ( TQSqlRecordInfo::iterator it = inf.begin(); it != inf.end(); ++it ) { append( *it ); } } - setMode( QSqlCursor::ReadOnly ); + setMode( TQSqlCursor::ReadOnly ); } - QCustomSqlCursor( const QCustomSqlCursor & other ): QSqlCursor( other ) {} - bool select( const QString & /*filter*/, const QSqlIndex & /*sort*/ = QSqlIndex() ) + QCustomSqlCursor( const QCustomSqlCursor & other ): TQSqlCursor( other ) {} + bool select( const TQString & /*filter*/, const TQSqlIndex & /*sort*/ = TQSqlIndex() ) { return exec( lastQuery() ); } - QSqlIndex primaryIndex( bool /*prime*/ = TRUE ) const - { return QSqlIndex(); } + TQSqlIndex primaryIndex( bool /*prime*/ = TRUE ) const + { return TQSqlIndex(); } int insert( bool /*invalidate*/ = TRUE ) { return FALSE; } int update( bool /*invalidate*/ = TRUE ) { return FALSE; } int del( bool /*invalidate*/ = TRUE ) { return FALSE; } - void setName( const QString& /*name*/, bool /*autopopulate*/ = TRUE ) {} + void setName( const TQString& /*name*/, bool /*autopopulate*/ = TRUE ) {} }; -SqlOutputWidget::SqlOutputWidget ( QWidget* parent, const char* name ) : - QWidget( parent, name ) +SqlOutputWidget::SqlOutputWidget ( TQWidget* parent, const char* name ) : + TQWidget( parent, name ) { - m_stack = new QWidgetStack( this ); - m_table = new QDataTable( this ); - m_textEdit = new QTextEdit( this ); + m_stack = new TQWidgetStack( this ); + m_table = new TQDataTable( this ); + m_textEdit = new TQTextEdit( this ); - m_textEdit->setTextFormat( QTextEdit::RichText ); + m_textEdit->setTextFormat( TQTextEdit::RichText ); m_textEdit->setReadOnly( true ); m_stack->addWidget( m_textEdit ); m_stack->addWidget( m_table ); - QVBoxLayout* layout = new QVBoxLayout( this ); + TQVBoxLayout* layout = new TQVBoxLayout( this ); layout->addWidget( m_stack ); } SqlOutputWidget::~SqlOutputWidget() {} -void SqlOutputWidget::showQuery( const QString& connectionName, const QString& query ) +void SqlOutputWidget::showQuery( const TQString& connectionName, const TQString& query ) { - QSqlDatabase* db = QSqlDatabase::database( connectionName, true ); + TQSqlDatabase* db = TQSqlDatabase::database( connectionName, true ); if ( !db ) { showError( i18n("No such connection: %1").arg( connectionName ) ); return; @@ -86,12 +86,12 @@ void SqlOutputWidget::showQuery( const QString& connectionName, const QString& q return; } - QSqlCursor* cur = new QCustomSqlCursor( query, true, db ); + TQSqlCursor* cur = new QCustomSqlCursor( query, true, db ); if ( !cur->isActive() ) { showError( cur->lastError() ); } else if ( cur->isSelect() ) { m_table->setSqlCursor( cur, true, true ); - m_table->refresh( QDataTable::RefreshAll ); + m_table->refresh( TQDataTable::RefreshAll ); m_stack->raiseWidget( m_table ); } else { showSuccess( cur->numRowsAffected() ); @@ -105,21 +105,21 @@ void SqlOutputWidget::showSuccess( int rowsAffected ) m_stack->raiseWidget( m_textEdit ); } -void SqlOutputWidget::showError( const QString& message ) +void SqlOutputWidget::showError( const TQString& message ) { m_textEdit->clear(); m_textEdit->setText( "<p><b>" + i18n("An error occurred:") + "</b></p>\n" + message ); m_stack->raiseWidget( m_textEdit ); } -void SqlOutputWidget::showError( const QSqlError& message ) +void SqlOutputWidget::showError( const TQSqlError& message ) { m_textEdit->clear(); m_textEdit->setText( "<p><b>" + i18n("An error occurred:") + "</b></p>\n<p><i>" + i18n("Driver") + "</i>: " + - QStyleSheet::escape( message.driverText() ) + + TQStyleSheet::escape( message.driverText() ) + "<br><i>" + i18n("Database") + ":</i>: " + - QStyleSheet::escape( message.databaseText() ) ); + TQStyleSheet::escape( message.databaseText() ) ); m_stack->raiseWidget( m_textEdit ); } diff --git a/languages/sql/sqloutputwidget.h b/languages/sql/sqloutputwidget.h index 40c8612a..c7393bb6 100644 --- a/languages/sql/sqloutputwidget.h +++ b/languages/sql/sqloutputwidget.h @@ -12,7 +12,7 @@ #ifndef _SQLOUTPUTWIDGET_H_ #define _SQLOUTPUTWIDGET_H_ -#include <qwidget.h> +#include <tqwidget.h> class QWidgetStack; class QDataTable; @@ -24,20 +24,20 @@ class SqlOutputWidget : public QWidget Q_OBJECT public: - SqlOutputWidget( QWidget* parent = 0, const char* name = 0 ); + SqlOutputWidget( TQWidget* parent = 0, const char* name = 0 ); virtual ~SqlOutputWidget(); public: - void showQuery( const QString& connectionName, const QString& query ); - void showError( const QSqlError& error ); + void showQuery( const TQString& connectionName, const TQString& query ); + void showError( const TQSqlError& error ); private: - void showError( const QString& msg ); + void showError( const TQString& msg ); void showSuccess( int rowsAffected ); - QWidgetStack* m_stack; - QDataTable* m_table; - QTextEdit* m_textEdit; + TQWidgetStack* m_stack; + TQDataTable* m_table; + TQTextEdit* m_textEdit; }; #endif diff --git a/languages/sql/sqlsupport_part.cpp b/languages/sql/sqlsupport_part.cpp index c1e13ac0..78c1c1f2 100644 --- a/languages/sql/sqlsupport_part.cpp +++ b/languages/sql/sqlsupport_part.cpp @@ -1,9 +1,9 @@ #include "sqlsupport_part.h" -#include <qwhatsthis.h> -#include <qstringlist.h> -#include <qtimer.h> -#include <qsqldatabase.h> -#include <qsqlrecord.h> +#include <tqwhatsthis.h> +#include <tqstringlist.h> +#include <tqtimer.h> +#include <tqsqldatabase.h> +#include <tqsqlrecord.h> #include <kapplication.h> #include <kiconloader.h> @@ -33,31 +33,31 @@ typedef KDevGenericFactory<SQLSupportPart> SQLSupportFactory; static const KDevPluginInfo data("kdevsqlsupport"); K_EXPORT_COMPONENT_FACTORY( libkdevsqlsupport, SQLSupportFactory( data ) ) -SQLSupportPart::SQLSupportPart( QObject *parent, const char *name, const QStringList& ) +SQLSupportPart::SQLSupportPart( TQObject *parent, const char *name, const TQStringList& ) : KDevLanguageSupport ( &data, parent, name ? name : "SQLSupportPart" ) { setInstance( SQLSupportFactory::instance() ); setXMLFile( "kdevsqlsupport.rc" ); KAction *action; - action = new KAction( i18n( "&Run" ), "exec", Key_F9, this, SLOT( slotRun() ), actionCollection(), "build_execute" ); + action = new KAction( i18n( "&Run" ), "exec", Key_F9, this, TQT_SLOT( slotRun() ), actionCollection(), "build_execute" ); action->setToolTip(i18n("Run")); action->setWhatsThis(i18n("<b>Run</b><p>Executes a SQL script.")); - dbAction = new SqlListAction( this, i18n( "&Database Connections" ), 0, this, SLOT(activeConnectionChanged()), actionCollection(), "connection_combo" ); + dbAction = new SqlListAction( this, i18n( "&Database Connections" ), 0, this, TQT_SLOT(activeConnectionChanged()), actionCollection(), "connection_combo" ); kdDebug( 9000 ) << "Creating SQLSupportPart" << endl; - connect( core(), SIGNAL( projectConfigWidget( KDialogBase* ) ), - this, SLOT( projectConfigWidget( KDialogBase* ) ) ); - connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) ); - connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) ); - connect( core(), SIGNAL(languageChanged()), this, SLOT(projectOpened()) ); - connect( partController(), SIGNAL( savedFile( const KURL& ) ), this, SLOT( savedFile( const KURL& ) ) ); + connect( core(), TQT_SIGNAL( projectConfigWidget( KDialogBase* ) ), + this, TQT_SLOT( projectConfigWidget( KDialogBase* ) ) ); + connect( core(), TQT_SIGNAL(projectOpened()), this, TQT_SLOT(projectOpened()) ); + connect( core(), TQT_SIGNAL(projectClosed()), this, TQT_SLOT(projectClosed()) ); + connect( core(), TQT_SIGNAL(languageChanged()), this, TQT_SLOT(projectOpened()) ); + connect( partController(), TQT_SIGNAL( savedFile( const KURL& ) ), this, TQT_SLOT( savedFile( const KURL& ) ) ); m_widget = new SqlOutputWidget(); mainWindow()->embedOutputView( m_widget, i18n( "SQL" ), i18n( "Output of SQL commands" ) ); - QWhatsThis::add(m_widget, i18n("<b>Output of SQL commands</b><p>This window shows the output of SQL commands being executed. It can display results of SQL \"select\" commands in a table.")); + TQWhatsThis::add(m_widget, i18n("<b>Output of SQL commands</b><p>This window shows the output of SQL commands being executed. It can display results of SQL \"select\" commands in a table.")); } @@ -67,12 +67,12 @@ SQLSupportPart::~SQLSupportPart() delete m_widget; } -QString SQLSupportPart::cryptStr(const QString& aStr) +TQString SQLSupportPart::cryptStr(const TQString& aStr) { - QString result; + TQString result; for (unsigned int i = 0; i < aStr.length(); i++) result += (aStr[i].unicode() < 0x20) ? aStr[i] : - QChar(0x1001F - aStr[i].unicode()); + TQChar(0x1001F - aStr[i].unicode()); return result; } @@ -83,10 +83,10 @@ void SQLSupportPart::activeConnectionChanged() void SQLSupportPart::clearConfig() { - for ( QStringList::Iterator it = conNames.begin(); it != conNames.end(); ++it ) { - if ( QSqlDatabase::contains( *it ) ) { - QSqlDatabase::database( *it, false )->close(); - QSqlDatabase::removeDatabase( *it ); + for ( TQStringList::Iterator it = conNames.begin(); it != conNames.end(); ++it ) { + if ( TQSqlDatabase::contains( *it ) ) { + TQSqlDatabase::database( *it, false )->close(); + TQSqlDatabase::removeDatabase( *it ); } else { kdDebug( 9000 ) << "Could not find connection named " << (*it) << endl; } @@ -100,20 +100,20 @@ void SQLSupportPart::loadConfig() { clearConfig(); - QDomDocument* doc = projectDom(); + TQDomDocument* doc = projectDom(); - QStringList db; + TQStringList db; int i = 0; - QString conName; + TQString conName; while ( true ) { - QStringList sdb = DomUtil::readListEntry( *doc, "kdevsqlsupport/servers/server" + QString::number( i ), "el" ); + TQStringList sdb = DomUtil::readListEntry( *doc, "kdevsqlsupport/servers/server" + TQString::number( i ), "el" ); if ( (int)sdb.size() < 6 ) break; conName = "KDEVSQLSUPPORT_"; - conName += QString::number( i ); + conName += TQString::number( i ); conNames << conName; - QSqlDatabase* db = QSqlDatabase::addDatabase( sdb[0], QString( "KDEVSQLSUPPORT_%1" ).arg( i ) ); + TQSqlDatabase* db = TQSqlDatabase::addDatabase( sdb[0], TQString( "KDEVSQLSUPPORT_%1" ).arg( i ) ); db->setDatabaseName( sdb[1] ); db->setHostName( sdb[2] ); bool ok; @@ -132,26 +132,26 @@ void SQLSupportPart::loadConfig() void SQLSupportPart::projectConfigWidget( KDialogBase *dlg ) { - QVBox *vbox = dlg->addVBoxPage( QString( "SQL" ), i18n( "Specify Your Database Connections" ), BarIcon("source", KIcon::SizeMedium) ); - SqlConfigWidget *w = new SqlConfigWidget( (QWidget*)vbox, "SQL config widget" ); + TQVBox *vbox = dlg->addVBoxPage( TQString( "SQL" ), i18n( "Specify Your Database Connections" ), BarIcon("source", KIcon::SizeMedium) ); + SqlConfigWidget *w = new SqlConfigWidget( (TQWidget*)vbox, "SQL config widget" ); w->setProjectDom( projectDom() ); w->loadConfig(); - connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) ); - connect( w, SIGNAL(newConfigSaved()), this, SLOT(loadConfig()) ); + connect( dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(accept()) ); + connect( w, TQT_SIGNAL(newConfigSaved()), this, TQT_SLOT(loadConfig()) ); } void SQLSupportPart::projectOpened() { - connect( project(), SIGNAL( addedFilesToProject( const QStringList & ) ), - this, SLOT( addedFilesToProject( const QStringList & ) ) ); - connect( project(), SIGNAL( removedFilesFromProject( const QStringList & ) ), - this, SLOT( removedFilesFromProject( const QStringList & ) ) ); + connect( project(), TQT_SIGNAL( addedFilesToProject( const TQStringList & ) ), + this, TQT_SLOT( addedFilesToProject( const TQStringList & ) ) ); + connect( project(), TQT_SIGNAL( removedFilesFromProject( const TQStringList & ) ), + this, TQT_SLOT( removedFilesFromProject( const TQStringList & ) ) ); loadConfig(); // We want to parse only after all components have been // properly initialized - QTimer::singleShot( 0, this, SLOT( parse() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( parse() ) ); } @@ -162,7 +162,7 @@ void SQLSupportPart::projectClosed() void SQLSupportPart::slotRun () { - QString cName = dbAction->currentConnectionName(); + TQString cName = dbAction->currentConnectionName(); if ( cName.isEmpty() ) { KMessageBox::sorry( 0, i18n("Please select a valid database connection.") ); return; @@ -177,16 +177,16 @@ void SQLSupportPart::slotRun () } #if 0 -static QString dbCaption(const QSqlDatabase* db) +static TQString dbCaption(const TQSqlDatabase* db) { - QString res; + TQString res; if (!db) return res; res = db->driverName(); - res += QString::fromLatin1("@"); + res += TQString::fromLatin1("@"); res += db->hostName(); if (db->port() >= 0) - res += QString::fromLatin1(":") + QString::number(db->port()); + res += TQString::fromLatin1(":") + TQString::number(db->port()); return res; } #endif @@ -203,7 +203,7 @@ void SQLSupportPart::updateCatalog() codeModel()->wipeout(); - QString curConnection = dbAction->currentConnectionName(); + TQString curConnection = dbAction->currentConnectionName(); if (curConnection.isEmpty()) { emit updatedSourceInfo(); return; @@ -211,20 +211,20 @@ void SQLSupportPart::updateCatalog() FileDom dbf = codeModel()->create<FileModel>(); dbf->setName(dbAction->currentConnectionName()); - QSqlDatabase *db = QSqlDatabase::database(dbAction->currentConnectionName(), true); + TQSqlDatabase *db = TQSqlDatabase::database(dbAction->currentConnectionName(), true); // tables are classes and fields are methods if (db->isOpen()) { - QSqlRecord inf; - QStringList tables = db->tables(); - for (QStringList::Iterator it = tables.begin(); it != tables.end(); ++it) { + TQSqlRecord inf; + TQStringList tables = db->tables(); + for (TQStringList::Iterator it = tables.begin(); it != tables.end(); ++it) { ClassDom dbc = codeModel()->create<ClassModel>(); dbc->setName(*it); inf = db->record(*it); for (int i = 0; i < (int)inf.count(); ++i) { FunctionDom dbv = codeModel()->create<FunctionModel>(); dbv->setName(inf.fieldName(i)); - dbv->setResultType(QVariant::typeToName(inf.field(i)->type())); + dbv->setResultType(TQVariant::typeToName(inf.field(i)->type())); dbc->addFunction(dbv); } dbf->addClass(dbc); @@ -236,9 +236,9 @@ void SQLSupportPart::updateCatalog() emit updatedSourceInfo(); } -void SQLSupportPart::addedFilesToProject( const QStringList &fileList ) +void SQLSupportPart::addedFilesToProject( const TQStringList &fileList ) { - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for ( it = fileList.begin(); it != fileList.end(); ++it ) { // parse( project() ->projectDirectory() + "/" + ( *it ) ); @@ -248,9 +248,9 @@ void SQLSupportPart::addedFilesToProject( const QStringList &fileList ) } -void SQLSupportPart::removedFilesFromProject( const QStringList &fileList ) +void SQLSupportPart::removedFilesFromProject( const TQStringList &fileList ) { - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for ( it = fileList.begin(); it != fileList.end(); ++it ) { // classStore() ->removeWithReferences( project() ->projectDirectory() + "/" + ( *it ) ); diff --git a/languages/sql/sqlsupport_part.h b/languages/sql/sqlsupport_part.h index e9ad6dbd..187a4bbd 100644 --- a/languages/sql/sqlsupport_part.h +++ b/languages/sql/sqlsupport_part.h @@ -1,8 +1,8 @@ #ifndef __KDEVPART_SQLSUPPORT_H__ #define __KDEVPART_SQLSUPPORT_H__ -#include <qguardedptr.h> -#include <qstringlist.h> +#include <tqguardedptr.h> +#include <tqstringlist.h> #include <kprocess.h> #include <kdialogbase.h> @@ -20,11 +20,11 @@ class SQLSupportPart : public KDevLanguageSupport public: - SQLSupportPart(QObject *parent, const char *name, const QStringList &); + SQLSupportPart(TQObject *parent, const char *name, const TQStringList &); virtual ~SQLSupportPart(); - static QString cryptStr(const QString& aStr); - const QStringList& connections() const { return conNames; } + static TQString cryptStr(const TQString& aStr); + const TQStringList& connections() const { return conNames; } protected: @@ -37,8 +37,8 @@ private slots: void projectOpened(); void projectClosed(); void savedFile(const KURL &fileName); - void addedFilesToProject(const QStringList &fileList); - void removedFilesFromProject(const QStringList &fileList); + void addedFilesToProject(const TQStringList &fileList); + void removedFilesFromProject(const TQStringList &fileList); void parse(); void loadConfig(); void activeConnectionChanged(); @@ -48,7 +48,7 @@ private: void updateCatalog(); SqlListAction* dbAction; SqlOutputWidget* m_widget; - QStringList conNames; + TQStringList conNames; CodeModel *m_store; }; |