summaryrefslogtreecommitdiffstats
path: root/languages/bash
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
commitd6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch)
treed109539636691d7b03036ca1c0ed29dbae6577cf /languages/bash
parent3331a47a9cad24795c7440ee8107143ce444ef34 (diff)
downloadtdevelop-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/bash')
-rw-r--r--languages/bash/bashsupport_part.cpp128
-rw-r--r--languages/bash/bashsupport_part.h24
2 files changed, 76 insertions, 76 deletions
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 <qwhatsthis.h>
+#include <tqwhatsthis.h>
-#include <qfileinfo.h>
-#include <qstringlist.h>
-#include <qtextstream.h>
-#include <qtimer.h>
+#include <tqfileinfo.h>
+#include <tqstringlist.h>
+#include <tqtextstream.h>
+#include <tqtimer.h>
#include <kapplication.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <kiconloader.h>
#include <klocale.h>
@@ -36,26 +36,26 @@ typedef KDevGenericFactory<BashSupportPart> 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("<b>Run</b><p>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<KParts::ReadOnlyPart*>(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<KDevAppFrontend>("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<VariableModel>();
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<KTextEditor::CompletionEntry> BashCodeCompletion::getVars(const QString &startText)
+TQValueList<KTextEditor::CompletionEntry> BashCodeCompletion::getVars(const TQString &startText)
{
kdDebug() << "getVars for " << startText << endl;
- QValueList<KTextEditor::CompletionEntry> varList;
- QValueList<QString>::ConstIterator it;
+ TQValueList<KTextEditor::CompletionEntry> varList;
+ TQValueList<TQString>::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 <qguardedptr.h>
+#include <tqguardedptr.h>
#include <kprocess.h>
#include <kdialogbase.h>
@@ -29,8 +29,8 @@ class BashCodeCompletion : QObject
BashCodeCompletion();
~BashCodeCompletion();
void setActiveEditorPart(KParts::Part*);
- void setVars(QStringList);
- QValueList<KTextEditor::CompletionEntry> getVars(const QString& textHint);
+ void setVars(TQStringList);
+ TQValueList<KTextEditor::CompletionEntry> 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;
};