diff options
Diffstat (limited to 'languages/sql/sqlsupport_part.cpp')
-rw-r--r-- | languages/sql/sqlsupport_part.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
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 ) ); |