diff options
Diffstat (limited to 'languages/kjssupport/kjssupport_part.cpp')
-rw-r--r-- | languages/kjssupport/kjssupport_part.cpp | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/languages/kjssupport/kjssupport_part.cpp b/languages/kjssupport/kjssupport_part.cpp index c3fa2954..dcb8c1e3 100644 --- a/languages/kjssupport/kjssupport_part.cpp +++ b/languages/kjssupport/kjssupport_part.cpp @@ -16,12 +16,12 @@ Boston, MA 02110-1301, USA. */ -#include <qwhatsthis.h> -#include <qtimer.h> -#include <qfileinfo.h> -#include <qtextstream.h> -#include <qregexp.h> -#include <qpopupmenu.h> +#include <tqwhatsthis.h> +#include <tqtimer.h> +#include <tqfileinfo.h> +#include <tqtextstream.h> +#include <tqregexp.h> +#include <tqpopupmenu.h> #include <kiconloader.h> #include <klocale.h> @@ -57,32 +57,32 @@ K_EXPORT_COMPONENT_FACTORY( libkdevkjssupport, kjsSupportFactory( data ) ); class typeProperty { public: - QString type; - QString name; + TQString type; + TQString name; int depth; }; -kjsSupportPart::kjsSupportPart(QObject *parent, const char *name, const QStringList& ) +kjsSupportPart::kjsSupportPart(TQObject *parent, const char *name, const TQStringList& ) : KDevLanguageSupport(&data, parent, name ? name : "kjsSupportPart" ) { setInstance(kjsSupportFactory::instance()); setXMLFile("kdevkjssupport.rc"); - m_build = new KAction( i18n("&Run"), "exec",Key_F9,this, SLOT(slotRun()),actionCollection(), "build_execute" ); + m_build = new KAction( i18n("&Run"), "exec",Key_F9,this, TQT_SLOT(slotRun()),actionCollection(), "build_execute" ); m_build->setStatusText( i18n("Test the active script.") ); kdDebug() << "Creating kjssupport Part" << 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 QString&)), this, SLOT(savedFile(const QString&)) ); - connect(partController(), SIGNAL(activePartChanged(KParts::Part*)), - this, SLOT(slotActivePartChanged(KParts::Part *))); - connect(core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)), - this, SLOT(contextMenu(QPopupMenu *, const Context *))); + 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 TQString&)), this, TQT_SLOT(savedFile(const TQString&)) ); + connect(partController(), TQT_SIGNAL(activePartChanged(KParts::Part*)), + this, TQT_SLOT(slotActivePartChanged(KParts::Part *))); + connect(core(), TQT_SIGNAL(contextMenu(TQPopupMenu *, const Context *)), + this, TQT_SLOT(contextMenu(TQPopupMenu *, const Context *))); // Building kjs interpreter. @@ -140,20 +140,20 @@ void kjsSupportPart::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())); } void kjsSupportPart::projectClosed() { } -void kjsSupportPart::savedFile(const QString &fileName) +void kjsSupportPart::savedFile(const TQString &fileName) { @@ -164,11 +164,11 @@ void kjsSupportPart::savedFile(const QString &fileName) emit addedSourceInfo( fileName ); } } -void kjsSupportPart::addedFilesToProject(const QStringList &fileList) +void kjsSupportPart::addedFilesToProject(const TQStringList &fileList) { kdDebug(9014) << "addedFilesToProject()" << endl; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for ( it = fileList.begin(); it != fileList.end(); ++it ) { @@ -178,15 +178,15 @@ void kjsSupportPart::addedFilesToProject(const QStringList &fileList) emit updatedSourceInfo(); } -void kjsSupportPart::removedFilesFromProject(const QStringList &fileList) +void kjsSupportPart::removedFilesFromProject(const TQStringList &fileList) { - 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) ) { kdDebug(9014) << "removed " << fileName << endl; @@ -203,10 +203,10 @@ void kjsSupportPart::parse() if (project()) { kapp->setOverrideCursor(waitCursor); - QStringList files = project()->allFiles(); + TQStringList files = project()->allFiles(); m_problemReporter->clear(); - for (QStringList::Iterator it = files.begin(); it != files.end() ;++it) + for (TQStringList::Iterator it = files.begin(); it != files.end() ;++it) { kdDebug(9014) << "maybe parse " << project()->projectDirectory() + "/" + (*it) << endl; @@ -226,11 +226,11 @@ void kjsSupportPart::slotActivePartChanged(KParts::Part *part) } /*! - \fn kjsSupportPart::parse(const QString &fileName) + \fn kjsSupportPart::parse(const TQString &fileName) */ -void kjsSupportPart::parse(const QString &fileName) +void kjsSupportPart::parse(const TQString &fileName) { - QFileInfo fi(fileName); + TQFileInfo fi(fileName); if (fi.extension() == "js") { if( codeModel()->hasFile(fileName) ) @@ -243,25 +243,25 @@ void kjsSupportPart::parse(const QString &fileName) m_file->setName( fileName ); m_file->setFileName( fileName ); - 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; - QTextStream stream(&f); + TQTextStream stream(&f); int depth = 0; bool inFunction = false; - QString lastFunction = ""; + TQString lastFunction = ""; int lastLineNo = 0; ClassDom currentClass; - QRegExp varRx("var[\\s]([_a-zA-Z\\d]+)"); - QRegExp classVarRx("this\\.([_a-zA-Z\\d]+)"); - QRegExp classMethRx("this\\.([_a-zA-Z\\d]+)[\\s]*=[\\s]*function(\\([^){}\\n\\r]*\\))"); - QRegExp methRx("function[\\s]+([_a-zA-Z\\d]+[\\s]*\\([^){}\\n\\r]*\\))"); - QRegExp allocRx("([_\\d\\w]+)[\\s]*=[\\s]*new[\\s]*([_\\d\\w]+)"); - QRegExp assnRx("var[\\s]+([_\\d\\w]+)[\\s]+[=][\\s]+([_\\d\\w]+)[;]"); + TQRegExp varRx("var[\\s]([_a-zA-Z\\d]+)"); + TQRegExp classVarRx("this\\.([_a-zA-Z\\d]+)"); + TQRegExp classMethRx("this\\.([_a-zA-Z\\d]+)[\\s]*=[\\s]*function(\\([^){}\\n\\r]*\\))"); + TQRegExp methRx("function[\\s]+([_a-zA-Z\\d]+[\\s]*\\([^){}\\n\\r]*\\))"); + TQRegExp allocRx("([_\\d\\w]+)[\\s]*=[\\s]*new[\\s]*([_\\d\\w]+)"); + TQRegExp assnRx("var[\\s]+([_\\d\\w]+)[\\s]+[=][\\s]+([_\\d\\w]+)[;]"); while (!stream.atEnd()) { @@ -301,8 +301,8 @@ void kjsSupportPart::parse(const QString &fileName) if( allocRx.search(line) != -1 ) { - QString varName = allocRx.cap(1); - QString varType = allocRx.cap(2); + TQString varName = allocRx.cap(1); + TQString varType = allocRx.cap(2); typeProperty *type = new typeProperty(); type->depth = depth; @@ -348,7 +348,7 @@ void kjsSupportPart::parse(const QString &fileName) } } -ClassDom kjsSupportPart::addClass(const QString &name, FileDom file, uint lineNo) +ClassDom kjsSupportPart::addClass(const TQString &name, FileDom file, uint lineNo) { ClassDom clazz = codeModel()->create<ClassModel>(); clazz->setName(name); @@ -362,7 +362,7 @@ ClassDom kjsSupportPart::addClass(const QString &name, FileDom file, uint lineNo return clazz; } -void kjsSupportPart::addMethod(const QString &name, ClassDom clazz, uint lineNo) +void kjsSupportPart::addMethod(const TQString &name, ClassDom clazz, uint lineNo) { FunctionDom method = codeModel()->create<FunctionModel>(); method->setName(name); @@ -375,7 +375,7 @@ void kjsSupportPart::addMethod(const QString &name, ClassDom clazz, uint lineNo) } } -void kjsSupportPart::addAttribute(const QString &name, ClassDom clazz, uint lineNo) +void kjsSupportPart::addAttribute(const TQString &name, ClassDom clazz, uint lineNo) { VariableDom var = codeModel()->create<VariableModel>(); var->setName(name); @@ -389,7 +389,7 @@ void kjsSupportPart::addAttribute(const QString &name, ClassDom clazz, uint line } } -void kjsSupportPart::addMethod(const QString &name, FileDom file, uint lineNo) +void kjsSupportPart::addMethod(const TQString &name, FileDom file, uint lineNo) { FunctionDom method = codeModel()->create<FunctionModel>(); method->setName(name); @@ -402,7 +402,7 @@ void kjsSupportPart::addMethod(const QString &name, FileDom file, uint lineNo) } } -void kjsSupportPart::addAttribute(const QString &name, FileDom file, uint lineNo) +void kjsSupportPart::addAttribute(const TQString &name, FileDom file, uint lineNo) { VariableDom var = codeModel()->create<VariableModel>(); var->setName(name); @@ -416,7 +416,7 @@ void kjsSupportPart::addAttribute(const QString &name, FileDom file, uint lineNo } } -void kjsSupportPart::contextMenu(QPopupMenu * popupMenu, const Context *context) +void kjsSupportPart::contextMenu(TQPopupMenu * popupMenu, const Context *context) { kdDebug() << "1" << endl; if (!context->hasType( Context::FileContext )) @@ -427,9 +427,9 @@ void kjsSupportPart::contextMenu(QPopupMenu * popupMenu, const Context *context) m_selectedUI = fcontext->fileName(); if (m_selectedUI.right(3).lower() == ".ui") int id = popupMenu->insertItem(i18n("Implement Slots"), - this, SLOT(implementSlots())); + this, TQT_SLOT(implementSlots())); else - m_selectedUI = QString::null; + m_selectedUI = TQString::null; } void kjsSupportPart::implementSlots() @@ -437,7 +437,7 @@ void kjsSupportPart::implementSlots() if (m_selectedUI.isEmpty()) return; - QStringList newFiles; + TQStringList newFiles; SubclassingDlg *sub = new SubclassingDlg(this, m_selectedUI, newFiles); if (sub->exec()) project()->addFiles(newFiles); |