From d6f8bbb45b267065a6907e71ff9c98bb6d161241 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:56:07 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- languages/bash/bashsupport_part.cpp | 128 ++++++++++++++++++------------------ languages/bash/bashsupport_part.h | 24 +++---- 2 files changed, 76 insertions(+), 76 deletions(-) (limited to 'languages/bash') diff --git a/languages/bash/bashsupport_part.cpp b/languages/bash/bashsupport_part.cpp index 389c0a70..1420356d 100644 --- a/languages/bash/bashsupport_part.cpp +++ b/languages/bash/bashsupport_part.cpp @@ -3,14 +3,14 @@ */ #include "bashsupport_part.h" -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include #include @@ -36,26 +36,26 @@ typedef KDevGenericFactory BashSupportFactory; static const KDevPluginInfo data("kdevbashsupport"); K_EXPORT_COMPONENT_FACTORY( libkdevbashsupport, BashSupportFactory( data ) ) -BashSupportPart::BashSupportPart(QObject *parent, const char *name, const QStringList& ) +BashSupportPart::BashSupportPart(TQObject *parent, const char *name, const TQStringList& ) : KDevLanguageSupport (&data, parent, name ? name : "BashSupportPart" ) { setInstance(BashSupportFactory::instance()); setXMLFile("kdevbashsupport.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("Run

Starts an application.")); kdDebug() << "Creating BashSupportPart" << 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( partController(), SIGNAL(savedFile(const KURL&)), this, SLOT(savedFile(const KURL&)) ); - connect(partController(), SIGNAL(activePartChanged(KParts::Part*)), - this, SLOT(slotActivePartChanged(KParts::Part *))); + 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( partController(), TQT_SIGNAL(savedFile(const KURL&)), this, TQT_SLOT(savedFile(const KURL&)) ); + connect(partController(), TQT_SIGNAL(activePartChanged(KParts::Part*)), + this, TQT_SLOT(slotActivePartChanged(KParts::Part *))); m_cc = new BashCodeCompletion(); } @@ -71,23 +71,23 @@ BashSupportPart::~BashSupportPart() void BashSupportPart::projectConfigWidget(KDialogBase *dlg) { Q_UNUSED( dlg ); -// QVBox *vbox = dlg->addVBoxPage(i18n("Bash")); -// RubyConfigWidget *w = new RubyConfigWidget(*projectDom(), (QWidget *)vbox, "Bash config widget"); -// connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) ); +// TQVBox *vbox = dlg->addVBoxPage(i18n("Bash")); +// RubyConfigWidget *w = new RubyConfigWidget(*projectDom(), (TQWidget *)vbox, "Bash config widget"); +// connect( dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(accept()) ); } void BashSupportPart::projectOpened() { kdDebug(9014) << "projectOpened()" << endl; - 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 &)) ); // 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())); } @@ -98,18 +98,18 @@ void BashSupportPart::projectClosed() void BashSupportPart::slotRun () { - QString file; + TQString file; KParts::ReadOnlyPart *ro_part = dynamic_cast(partController()->activePart()); if(ro_part) file = ro_part->url().path(); - QString cmd = interpreter() + " " + file; + TQString cmd = interpreter() + " " + file; startApplication(cmd); } -QString BashSupportPart::interpreter() +TQString BashSupportPart::interpreter() { - QString prog = DomUtil::readEntry(*projectDom(), "/kdevrbashsupport/run/interpreter"); + TQString prog = DomUtil::readEntry(*projectDom(), "/kdevrbashsupport/run/interpreter"); if (prog.isEmpty()) prog = "bash"; return prog; @@ -122,8 +122,8 @@ void BashSupportPart::parse() if (project()) { kapp->setOverrideCursor(waitCursor); - QStringList files = project()->allFiles(); - for (QStringList::Iterator it = files.begin(); it != files.end() ;++it) + TQStringList files = project()->allFiles(); + for (TQStringList::Iterator it = files.begin(); it != files.end() ;++it) { kdDebug(9014) << "maybe parse " << project()->projectDirectory() + "/" + (*it) << endl; parse(project()->projectDirectory() + "/" + *it); @@ -135,11 +135,11 @@ void BashSupportPart::parse() } } -void BashSupportPart::addedFilesToProject(const QStringList &fileList) +void BashSupportPart::addedFilesToProject(const TQStringList &fileList) { kdDebug(9014) << "addedFilesToProject()" << endl; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for ( it = fileList.begin(); it != fileList.end(); ++it ) { @@ -150,15 +150,15 @@ kdDebug(9014) << "addedFilesToProject()" << endl; } -void BashSupportPart::removedFilesFromProject(const QStringList &fileList) +void BashSupportPart::removedFilesFromProject(const TQStringList &fileList) { kdDebug(9014) << "removedFilesFromProject()" << endl; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for ( it = fileList.begin(); it != fileList.end(); ++it ) { - QString fileName = project()->projectDirectory() + "/" + ( *it ); + TQString fileName = project()->projectDirectory() + "/" + ( *it ); if( codeModel()->hasFile(fileName) ){ emit aboutToRemoveSourceInfo( fileName ); codeModel()->removeFile( codeModel()->fileByName(fileName) ); @@ -179,11 +179,11 @@ void BashSupportPart::savedFile(const KURL &fileName) } } -void BashSupportPart::startApplication(const QString &program) +void BashSupportPart::startApplication(const TQString &program) { kdDebug() << "starting application" << program << endl; if (KDevAppFrontend *appFrontend = extension("KDevelop/AppFrontend")) - appFrontend->startAppCommand(QString::QString(), program, TRUE); + appFrontend->startAppCommand(TQString::TQString(), program, TRUE); } @@ -192,9 +192,9 @@ KDevLanguageSupport::Features BashSupportPart::features() return Features(Variables | Functions); } -void BashSupportPart::parse(const QString &fileName) +void BashSupportPart::parse(const TQString &fileName) { - QFileInfo fi(fileName); + TQFileInfo fi(fileName); m_vars.clear(); if (fi.extension() == "sh") { @@ -207,19 +207,19 @@ void BashSupportPart::parse(const QString &fileName) m_file->setName( fileName ); m_vars.clear(); - QFile f(QFile::encodeName(fileName)); + TQFile f(TQFile::encodeName(fileName)); if (!f.open(IO_ReadOnly)) return; - QString rawline; - QString line; + TQString rawline; + TQString line; uint lineNo = 0; //KRegExp methodre("\\b([\\d\\w]+[\\s]*)\\([\\s]*\\)"); - QRegExp methodre("^\\s*(\\w+)\\s*\\(\\s*\\)"); - QRegExp varre( "^\\s*(\\w+)[=]" ); - QRegExp expvarre( "^export\\s*(\\w+)[=]" ); - QRegExp forvarre("\\bfor[\\s]+([\\d\\w]+)[\\s]+in[\\s]+"); + TQRegExp methodre("^\\s*(\\w+)\\s*\\(\\s*\\)"); + TQRegExp varre( "^\\s*(\\w+)[=]" ); + TQRegExp expvarre( "^export\\s*(\\w+)[=]" ); + TQRegExp forvarre("\\bfor[\\s]+([\\d\\w]+)[\\s]+in[\\s]+"); - QTextStream stream(&f); + TQTextStream stream(&f); while (!stream.atEnd()) { rawline = stream.readLine(); @@ -274,7 +274,7 @@ void BashSupportPart::slotActivePartChanged(KParts::Part *part) m_cc->setActiveEditorPart(part); } -void BashSupportPart::addAttribute(const QString &name, FileDom file, uint lineNo) +void BashSupportPart::addAttribute(const TQString &name, FileDom file, uint lineNo) { VariableDom var = codeModel()->create(); var->setName(name); @@ -332,26 +332,26 @@ void BashCodeCompletion::setActiveEditorPart(KParts::Part *part) } disconnect(part->widget(), 0, this, 0 ); // to make sure that it is't connected twice - connect(part->widget(), SIGNAL(cursorPositionChanged()), - this, SLOT(cursorPositionChanged())); - connect(part->widget(), SIGNAL(argHintHidden()), this, SLOT(argHintHidden())); - connect(part->widget(), SIGNAL(completionAborted()), this, SLOT(completionBoxAbort())); - connect(part->widget(), SIGNAL(completionDone()), this, SLOT(completionBoxHidden())); + connect(part->widget(), TQT_SIGNAL(cursorPositionChanged()), + this, TQT_SLOT(cursorPositionChanged())); + connect(part->widget(), TQT_SIGNAL(argHintHidden()), this, TQT_SLOT(argHintHidden())); + connect(part->widget(), TQT_SIGNAL(completionAborted()), this, TQT_SLOT(completionBoxAbort())); + connect(part->widget(), TQT_SIGNAL(completionDone()), this, TQT_SLOT(completionBoxHidden())); } -void BashCodeCompletion::setVars(QStringList lst) +void BashCodeCompletion::setVars(TQStringList lst) { m_vars = lst; } -QValueList BashCodeCompletion::getVars(const QString &startText) +TQValueList BashCodeCompletion::getVars(const TQString &startText) { kdDebug() << "getVars for " << startText << endl; - QValueList varList; - QValueList::ConstIterator it; + TQValueList varList; + TQValueList::ConstIterator it; for (it = m_vars.begin(); it != m_vars.end(); ++it) { - QString var = "$" + (*it); + TQString var = "$" + (*it); kdDebug() << "Compair " << var << endl; if( var.startsWith( startText )) { @@ -373,15 +373,15 @@ void BashCodeCompletion::cursorPositionChanged() m_cursorInterface->cursorPositionReal(&line, &col); kdDebug() << "BashCodeCompletion::cursorPositionChanged:" << line << ":" << col << endl; - QString lineStr = m_editInterface->textLine(line); + TQString lineStr = m_editInterface->textLine(line); if(lineStr.isNull() || lineStr.isEmpty()){ kdDebug() << "No Text..." << endl; return; // nothing to do } // if(m_config->getCodeCompletion()) // { - QString restLine = lineStr.mid(col); - QString prevText = lineStr.mid(0,col); + TQString restLine = lineStr.mid(col); + TQString prevText = lineStr.mid(0,col); if(restLine.left(1) != " " && restLine.left(1) != "\t" && !restLine.isNull()) { @@ -389,13 +389,13 @@ void BashCodeCompletion::cursorPositionChanged() return; } - QRegExp prevReg("[$][\\d\\w]*\\b$"); + TQRegExp prevReg("[$][\\d\\w]*\\b$"); int pos = prevReg.search( prevText ); if (pos > -1 ) { // We are in completion mode - QString startMatch = prevReg.cap(0); + TQString startMatch = prevReg.cap(0); kdDebug() << "Matching: " << startMatch << endl; m_completionBoxShow=true; m_codeInterface->showCompletionBox(getVars(startMatch),2); @@ -416,9 +416,9 @@ void BashCodeCompletion::completionBoxHidden() m_completionBoxShow=false; /* uint line, col, start; m_cursorInterface->cursorPositionReal(&line, &col); - QString lineStr = m_editInterface->textLine(line); + TQString lineStr = m_editInterface->textLine(line); - start = lineStr.findRev(QRegExp("[$][\\d\\w]*\\b$")); + start = lineStr.findRev(TQRegExp("[$][\\d\\w]*\\b$")); m_editInterface->removeText ( start, col, line, col ); */ } diff --git a/languages/bash/bashsupport_part.h b/languages/bash/bashsupport_part.h index 20c11c4e..4b3219fa 100644 --- a/languages/bash/bashsupport_part.h +++ b/languages/bash/bashsupport_part.h @@ -7,7 +7,7 @@ #define __KDEVPART_BASHSUPPORT_H__ -#include +#include #include #include @@ -29,8 +29,8 @@ class BashCodeCompletion : QObject BashCodeCompletion(); ~BashCodeCompletion(); void setActiveEditorPart(KParts::Part*); - void setVars(QStringList); - QValueList getVars(const QString& textHint); + void setVars(TQStringList); + TQValueList getVars(const TQString& textHint); public slots: void cursorPositionChanged(); @@ -38,7 +38,7 @@ class BashCodeCompletion : QObject void completionBoxAbort(); private: - QStringList m_vars; + TQStringList m_vars; bool m_argWidgetShow; bool m_completionBoxShow; KTextEditor::EditInterface *m_editInterface; @@ -50,7 +50,7 @@ class BashSupportPart : public KDevLanguageSupport { Q_OBJECT public: - BashSupportPart(QObject *parent, const char *name, const QStringList &); + BashSupportPart(TQObject *parent, const char *name, const TQStringList &); virtual ~BashSupportPart(); protected: @@ -63,18 +63,18 @@ class BashSupportPart : public KDevLanguageSupport 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 slotActivePartChanged(KParts::Part *part); private: - void startApplication(const QString &program); - QString interpreter(); - void parse(const QString &fileName); - void addAttribute(const QString &name, FileDom file, uint line); + void startApplication(const TQString &program); + TQString interpreter(); + void parse(const TQString &fileName); + void addAttribute(const TQString &name, FileDom file, uint line); BashCodeCompletion *m_cc; - QStringList m_vars; + TQStringList m_vars; }; -- cgit v1.2.1