diff options
Diffstat (limited to 'languages/kjssupport')
-rw-r--r-- | languages/kjssupport/jscodecompletion.cpp | 44 | ||||
-rw-r--r-- | languages/kjssupport/jscodecompletion.h | 6 | ||||
-rw-r--r-- | languages/kjssupport/kjsproblems.cpp | 16 | ||||
-rw-r--r-- | languages/kjssupport/kjsproblems.h | 4 | ||||
-rw-r--r-- | languages/kjssupport/kjssupport_part.cpp | 114 | ||||
-rw-r--r-- | languages/kjssupport/kjssupport_part.h | 30 | ||||
-rw-r--r-- | languages/kjssupport/subclassingdlg.cpp | 120 | ||||
-rw-r--r-- | languages/kjssupport/subclassingdlg.h | 60 |
8 files changed, 197 insertions, 197 deletions
diff --git a/languages/kjssupport/jscodecompletion.cpp b/languages/kjssupport/jscodecompletion.cpp index 8fd59f57..5717858a 100644 --- a/languages/kjssupport/jscodecompletion.cpp +++ b/languages/kjssupport/jscodecompletion.cpp @@ -10,14 +10,14 @@ // // #include "jscodecompletion.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> @@ -37,8 +37,8 @@ #include <kdevelop/domutil.h> #include <kdevelop/codemodel.h> -JSCodeCompletion::JSCodeCompletion(QObject *parent, const char *name) - : QObject(parent, name) +JSCodeCompletion::JSCodeCompletion(TQObject *parent, const char *name) + : TQObject(parent, name) { m_argWidgetShow = false; m_completionBoxShow=false; @@ -82,22 +82,22 @@ void JSCodeCompletion::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())); } -QValueList< KTextEditor::CompletionEntry > JSCodeCompletion::getVars( const QString & startText ) +TQValueList< KTextEditor::CompletionEntry > JSCodeCompletion::getVars( const TQString & startText ) { kdDebug() << "getVars for " << startText << endl; - QValueList<KTextEditor::CompletionEntry> varList; + TQValueList<KTextEditor::CompletionEntry> varList; /* - QValueList<QString>::ConstIterator it; + 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 )) { @@ -119,7 +119,7 @@ void JSCodeCompletion::cursorPositionChanged( ) m_cursorInterface->cursorPositionReal(&line, &col); kdDebug() << "JSCodeCompletion::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; @@ -127,8 +127,8 @@ void JSCodeCompletion::cursorPositionChanged( ) } // 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()) { @@ -136,12 +136,12 @@ void JSCodeCompletion::cursorPositionChanged( ) return; } - QRegExp prevReg("([\\d\\w]*)[.]$"); + TQRegExp prevReg("([\\d\\w]*)[.]$"); if (prevReg.search( prevText ) != -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); diff --git a/languages/kjssupport/jscodecompletion.h b/languages/kjssupport/jscodecompletion.h index 0cceb1e0..03247917 100644 --- a/languages/kjssupport/jscodecompletion.h +++ b/languages/kjssupport/jscodecompletion.h @@ -12,7 +12,7 @@ #ifndef JSCODECOMPLETION_H #define JSCODECOMPLETION_H -#include <qobject.h> +#include <tqobject.h> #include <kdevelop/codemodel.h> #include <kdevelop/kdevplugin.h> #include <kdevelop/kdevlanguagesupport.h> @@ -30,11 +30,11 @@ class JSCodeCompletion : public QObject { Q_OBJECT public: - JSCodeCompletion(QObject *parent = 0, const char *name = 0); + JSCodeCompletion(TQObject *parent = 0, const char *name = 0); ~JSCodeCompletion(); void setActiveEditorPart(KParts::Part* editorPart); - QValueList<KTextEditor::CompletionEntry> getVars(const QString& textHint); + TQValueList<KTextEditor::CompletionEntry> getVars(const TQString& textHint); public slots: void cursorPositionChanged(); diff --git a/languages/kjssupport/kjsproblems.cpp b/languages/kjssupport/kjsproblems.cpp index 20951af4..31882e7c 100644 --- a/languages/kjssupport/kjsproblems.cpp +++ b/languages/kjssupport/kjsproblems.cpp @@ -23,17 +23,17 @@ class KJSProblemItem: public KListViewItem { public: - KJSProblemItem( QListView* parent, const QString& level, const QString& problem, - const QString& file, const QString& line, const QString& column ) + KJSProblemItem( TQListView* parent, const TQString& level, const TQString& problem, + const TQString& file, const TQString& line, const TQString& column ) : KListViewItem( parent, level, problem, file, line, column ) {} - KJSProblemItem( QListViewItem* parent, const QString& level, const QString& problem, - const QString& file, const QString& line, const QString& column ) + KJSProblemItem( TQListViewItem* parent, const TQString& level, const TQString& problem, + const TQString& file, const TQString& line, const TQString& column ) : KListViewItem( parent, level, problem, file, line, column ) {} - int compare( QListViewItem* item, int column, bool ascending ) const + int compare( TQListViewItem* item, int column, bool ascending ) const { if( column == 2 || column == 3 ) { @@ -48,7 +48,7 @@ class KJSProblemItem: public KListViewItem }; -KJSProblems::KJSProblems(kjsSupportPart *part, QWidget *parent, const char *name) : KListView(parent,name), m_part(part) +KJSProblems::KJSProblems(kjsSupportPart *part, TQWidget *parent, const char *name) : KListView(parent,name), m_part(part) { addColumn ("File"); addColumn ("Line #"); @@ -68,9 +68,9 @@ void KJSProblems::clearItems() setIcon( SmallIcon("info") ); } -void KJSProblems::addLine(const QString &file, int lineNo, const QString &message) +void KJSProblems::addLine(const TQString &file, int lineNo, const TQString &message) { - new QListViewItem( this, file, QString::number( lineNo ), message); + new TQListViewItem( this, file, TQString::number( lineNo ), message); setIcon( SmallIcon("error") ); } diff --git a/languages/kjssupport/kjsproblems.h b/languages/kjssupport/kjsproblems.h index d5647b16..7ca0d3ee 100644 --- a/languages/kjssupport/kjsproblems.h +++ b/languages/kjssupport/kjsproblems.h @@ -30,11 +30,11 @@ class KJSProblems : public KListView Q_OBJECT public: - KJSProblems(kjsSupportPart *part, QWidget *parent = 0L, const char *name = 0L); + KJSProblems(kjsSupportPart *part, TQWidget *parent = 0L, const char *name = 0L); ~KJSProblems(); void clearItems(); - void addLine(const QString &file, int lineNo, const QString &message); + void addLine(const TQString &file, int lineNo, const TQString &message); private: kjsSupportPart *m_part; 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); diff --git a/languages/kjssupport/kjssupport_part.h b/languages/kjssupport/kjssupport_part.h index ceb85db2..47561c1e 100644 --- a/languages/kjssupport/kjssupport_part.h +++ b/languages/kjssupport/kjssupport_part.h @@ -25,8 +25,8 @@ #include <kdevelop/codemodel.h> #include <kdevelop/kdevlanguagesupport.h> #include <kdialogbase.h> -#include <qstringlist.h> -#include <qdict.h> +#include <tqstringlist.h> +#include <tqdict.h> namespace KJSEmbed { @@ -47,7 +47,7 @@ class kjsSupportPart : public KDevLanguageSupport { Q_OBJECT public: - kjsSupportPart(QObject *parent, const char *name, const QStringList &); + kjsSupportPart(TQObject *parent, const char *name, const TQStringList &); ~kjsSupportPart(); protected: virtual Features features(); @@ -58,27 +58,27 @@ class kjsSupportPart : public KDevLanguageSupport void projectConfigWidget(KDialogBase *dlg); void projectOpened(); void projectClosed(); - void savedFile(const QString &fileName); - void addedFilesToProject(const QStringList &fileList); - void removedFilesFromProject(const QStringList &fileList); + void savedFile(const TQString &fileName); + void addedFilesToProject(const TQStringList &fileList); + void removedFilesFromProject(const TQStringList &fileList); void parse(); void slotActivePartChanged(KParts::Part *part); - void contextMenu(QPopupMenu *popupMenu, const Context *context); + void contextMenu(TQPopupMenu *popupMenu, const Context *context); void implementSlots(); private: - void parse(const QString &fileName); - void addAttribute(const QString &name, ClassDom clazz, uint lineNo); - void addMethod(const QString &name, ClassDom clazz, uint lineNo); - void addAttribute(const QString &name, FileDom file, uint lineNo); - void addMethod(const QString &name, FileDom file, uint lineNo); - ClassDom addClass(const QString &name, FileDom file, uint lineNo); + void parse(const TQString &fileName); + void addAttribute(const TQString &name, ClassDom clazz, uint lineNo); + void addMethod(const TQString &name, ClassDom clazz, uint lineNo); + void addAttribute(const TQString &name, FileDom file, uint lineNo); + void addMethod(const TQString &name, FileDom file, uint lineNo); + ClassDom addClass(const TQString &name, FileDom file, uint lineNo); KAction *m_build; KJSEmbed::KJSEmbedPart *m_js; KJSProblems *m_problemReporter; - QDict<typeProperty> m_typeMap; + TQDict<typeProperty> m_typeMap; JSCodeCompletion *m_cc; - QString m_selectedUI; + TQString m_selectedUI; }; diff --git a/languages/kjssupport/subclassingdlg.cpp b/languages/kjssupport/subclassingdlg.cpp index be1ad83e..284d0471 100644 --- a/languages/kjssupport/subclassingdlg.cpp +++ b/languages/kjssupport/subclassingdlg.cpp @@ -21,20 +21,20 @@ #include <kdevelop/filetemplate.h> #include <kdevelop/codemodel.h> -#include <qradiobutton.h> -#include <qstringlist.h> -#include <qcheckbox.h> -#include <qmessagebox.h> +#include <tqradiobutton.h> +#include <tqstringlist.h> +#include <tqcheckbox.h> +#include <tqmessagebox.h> #include <kfiledialog.h> #include <klineedit.h> -#include <qpushbutton.h> +#include <tqpushbutton.h> #include <domutil.h> -#include <qdom.h> +#include <tqdom.h> #include <kstandarddirs.h> #include <kdebug.h> #include <klocale.h> -#include <qfile.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqregexp.h> #include <kconfig.h> @@ -53,17 +53,17 @@ #define SLOT_HELP SlotItem(m_slotView,"help()","virtual","protected","void",false,true) -SlotItem::SlotItem(QListView *parent,const QString &methodName, - const QString &specifier, - const QString &access, const QString &returnType, +SlotItem::SlotItem(TQListView *parent,const TQString &methodName, + const TQString &specifier, + const TQString &access, const TQString &returnType, bool isFunc,bool callBaseClass) -: QCheckListItem(parent,methodName,QCheckListItem::CheckBox) +: TQCheckListItem(parent,methodName,TQCheckListItem::CheckBox) { setOn(true); m_methodName = methodName; - m_access = access.isEmpty() ? (const QString) "public" : access; - m_specifier = specifier.isEmpty() ? (const QString) "virtual" : specifier; - m_returnType = returnType.isEmpty() ? (const QString) "void" : returnType; + m_access = access.isEmpty() ? (const TQString) "public" : access; + m_specifier = specifier.isEmpty() ? (const TQString) "virtual" : specifier; + m_returnType = returnType.isEmpty() ? (const TQString) "void" : returnType; m_isFunc = isFunc; m_callBaseClass = callBaseClass; setText(0,m_methodName); @@ -93,8 +93,8 @@ void SlotItem::setAllreadyInSubclass() } -SubclassingDlg::SubclassingDlg(kjsSupportPart* kjsSupport, const QString &formFile,QStringList &newFileNames, - QWidget* parent, const char* name,bool modal, WFlags fl) +SubclassingDlg::SubclassingDlg(kjsSupportPart* kjsSupport, const TQString &formFile,TQStringList &newFileNames, + TQWidget* parent, const char* name,bool modal, WFlags fl) : SubclassingDlgBase(parent,name,modal,fl), m_newFileNames(newFileNames), m_kjsSupport( kjsSupport ) //================================================= @@ -115,8 +115,8 @@ m_newFileNames(newFileNames), m_kjsSupport( kjsSupport ) } -/*SubclassingDlg::SubclassingDlg(kjsSupportPart* kjsSupport, const QString &formFile,const QString &filename,QStringList &dummy, - QWidget* parent, const char* name,bool modal, WFlags fl) +/*SubclassingDlg::SubclassingDlg(kjsSupportPart* kjsSupport, const TQString &formFile,const TQString &filename,TQStringList &dummy, + TQWidget* parent, const char* name,bool modal, WFlags fl) : SubclassingDlgBase(parent,name,modal,fl), m_newFileNames(dummy), m_kjsSupport( kjsSupport ) //================================================= @@ -134,12 +134,12 @@ m_newFileNames(dummy), m_kjsSupport( kjsSupport ) reformat_box->setChecked(true); } - QStringList pathsplit(QStringList::split('/',filename)); + TQStringList pathsplit(TQStringList::split('/',filename)); - QString baseClass = readBaseClassName(); - if (!kjsSupport->codeModel()->hasFile(filename+QString(".h"))) + TQString baseClass = readBaseClassName(); + if (!kjsSupport->codeModel()->hasFile(filename+TQString(".h"))) return; - ClassList myClasses = kjsSupport->codeModel()->fileByName(filename+QString(".h"))->classList(); + ClassList myClasses = kjsSupport->codeModel()->fileByName(filename+TQString(".h"))->classList(); for (ClassList::const_iterator classIt = myClasses.begin(); classIt != myClasses.end(); ++classIt) { kdDebug() << "base class " << baseClass << " class " << (*classIt)->name() @@ -162,7 +162,7 @@ m_newFileNames(dummy), m_kjsSupport( kjsSupport ) m_btnOk->setEnabled(true); } */ -bool SubclassingDlg::alreadyInSubclass(const QString &method) +bool SubclassingDlg::alreadyInSubclass(const TQString &method) { for (uint i=0;i<m_parsedMethods.count();i++) if (method.find(m_parsedMethods[i])==0) @@ -172,13 +172,13 @@ bool SubclassingDlg::alreadyInSubclass(const QString &method) void SubclassingDlg::readUiFile() { - QStringList splitPath = QStringList::split('/',m_formFile); - m_formName = QStringList::split('.',splitPath[splitPath.count()-1])[0]; // "somedlg.ui" = "somedlg" + TQStringList splitPath = TQStringList::split('/',m_formFile); + m_formName = TQStringList::split('.',splitPath[splitPath.count()-1])[0]; // "somedlg.ui" = "somedlg" splitPath.pop_back(); m_formPath = "/" + splitPath.join("/"); // join path to ui-file m_btnOk->setEnabled(false); - QDomDocument doc; + TQDomDocument doc; DomUtil::openDOMFile(doc,m_formFile); m_baseClassName = DomUtil::elementByPathExt(doc,WIDGET_CLASS_NAME).text(); @@ -188,13 +188,13 @@ void SubclassingDlg::readUiFile() // Special widget specific slots SlotItem *newSlot; - m_qtBaseClassName = DomUtil::elementByPathExt(doc,"widget").attribute("class","QDialog"); + m_qtBaseClassName = DomUtil::elementByPathExt(doc,"widget").attribute("class","TQDialog"); - if ( (m_qtBaseClassName=="QMainWindow") || (m_qtBaseClassName=="QWidget") ) + if ( (m_qtBaseClassName=="TQMainWindow") || (m_qtBaseClassName=="TQWidget") ) m_canBeModal = false; else m_canBeModal = true; - if (m_qtBaseClassName != "QWidget") + if (m_qtBaseClassName != "TQWidget") { newSlot = new SLOT_ACCEPT; newSlot->setOn(false); @@ -211,7 +211,7 @@ void SubclassingDlg::readUiFile() m_slots << newSlot; } - if (m_qtBaseClassName == "QWizard") + if (m_qtBaseClassName == "TQWizard") { newSlot = new SLOT_NEXT; m_slotView->insertItem(newSlot); @@ -231,12 +231,12 @@ void SubclassingDlg::readUiFile() m_slots << newSlot; } - QDomElement slotsElem = DomUtil::elementByPathExt(doc,WIDGET_SLOTS); - QDomNodeList slotnodes = slotsElem.childNodes(); + TQDomElement slotsElem = DomUtil::elementByPathExt(doc,WIDGET_SLOTS); + TQDomNodeList slotnodes = slotsElem.childNodes(); for (unsigned int i=0; i<slotnodes.count();i++) { - QDomElement slotelem = slotnodes.item(i).toElement(); + TQDomElement slotelem = slotnodes.item(i).toElement(); newSlot = new SlotItem(m_slotView,slotelem.text(), slotelem.attributeNode("specifier").value(), slotelem.attributeNode("access").value(), @@ -247,12 +247,12 @@ void SubclassingDlg::readUiFile() m_slots << newSlot; } - QDomElement funcsElem = DomUtil::elementByPathExt(doc,WIDGET_FUNCTIONS); - QDomNodeList funcnodes = funcsElem.childNodes(); + TQDomElement funcsElem = DomUtil::elementByPathExt(doc,WIDGET_FUNCTIONS); + TQDomNodeList funcnodes = funcsElem.childNodes(); SlotItem *newFunc; for (unsigned int i=0; i<funcnodes.count();i++) { - QDomElement funcelem = funcnodes.item(i).toElement(); + TQDomElement funcelem = funcnodes.item(i).toElement(); newFunc = new SlotItem(m_slotView,funcelem.text(), funcelem.attributeNode("specifier").value(), funcelem.attributeNode("access").value(), @@ -263,11 +263,11 @@ void SubclassingDlg::readUiFile() m_slots << newFunc; } - QDomElement connElem = DomUtil::elementByPathExt(doc,"connections"); - QDomNodeList connnodes = connElem.childNodes(); + TQDomElement connElem = DomUtil::elementByPathExt(doc,"connections"); + TQDomNodeList connnodes = connElem.childNodes(); for (unsigned int i=0; i<connnodes.count();i++) { - QDomElement connelem = connnodes.item(i).toElement(); + TQDomElement connelem = connnodes.item(i).toElement(); connections += "$NEWCLASS$.connect("; if (connelem.namedItem("sender").toElement().text() == m_baseClassName) connections += "this"; @@ -293,7 +293,7 @@ void SubclassingDlg::updateDlg() { } -void SubclassingDlg::replace(QString &string, const QString& search, const QString& replace) +void SubclassingDlg::replace(TQString &string, const TQString& search, const TQString& replace) //========================================================================================== { int nextPos = string.find(search); @@ -305,11 +305,11 @@ void SubclassingDlg::replace(QString &string, const QString& search, const QStri } } -bool SubclassingDlg::loadBuffer(QString &buffer, const QString& filename) +bool SubclassingDlg::loadBuffer(TQString &buffer, const TQString& filename) //====================================================================== { // open file and buffer it - QFile dataFile(filename); + TQFile dataFile(filename); if (!dataFile.open(IO_ReadOnly)) return false; char *temp = new char[dataFile.size()+1]; @@ -321,7 +321,7 @@ bool SubclassingDlg::loadBuffer(QString &buffer, const QString& filename) return true; } -bool SubclassingDlg::replaceKeywords(QString &buffer,bool canBeModal) +bool SubclassingDlg::replaceKeywords(TQString &buffer,bool canBeModal) //=================================================================== { replace(buffer,"$NEWFILENAMEUC$",m_edFileName->text().upper()); @@ -346,12 +346,12 @@ bool SubclassingDlg::replaceKeywords(QString &buffer,bool canBeModal) return true; } -bool SubclassingDlg::saveBuffer(QString &buffer, const QString& filename) +bool SubclassingDlg::saveBuffer(TQString &buffer, const TQString& filename) //======================================================================= { // save buffer - QFile dataFile(filename); + TQFile dataFile(filename); if (!dataFile.open(IO_WriteOnly | IO_Truncate)) return false; dataFile.writeBlock((buffer+"\n").ascii(),(buffer+"\n").length()); @@ -374,19 +374,19 @@ void SubclassingDlg::accept() // h - file - QString public_slot = + TQString public_slot = "/*$PUBLIC_SLOTS$*/\n "; - QString protected_slot = + TQString protected_slot = "/*$PROTECTED_SLOTS$*/\n "; - QString public_func = + TQString public_func = "/*$PUBLIC_FUNCTIONS$*/\n "; - QString protected_func = + TQString protected_func = "/*$PROTECTED_FUNCTIONS$*/\n "; - QString buffer; + TQString buffer; if (m_creatingNewSubclass) { loadBuffer(buffer,::locate("data", "kdevkjssupport/subclassing/subclass_template.js")); @@ -394,18 +394,18 @@ void SubclassingDlg::accept() buffer = "var $NEWCLASS$ = Factory.loadui(\"$BASEFILENAME$.ui\", this);\n\n" + buffer; buffer = FileTemplate::read(m_kjsSupport, "js") + buffer + connections; kdDebug() << "buffer: " << buffer << endl; - QFileInfo fi(m_filename + ".js"); - QString module = fi.baseName(); - QString basefilename = fi.baseName(true); - buffer.replace(QRegExp("\\$MODULE\\$"),module); - buffer.replace(QRegExp("\\$FILENAME\\$"),basefilename); + TQFileInfo fi(m_filename + ".js"); + TQString module = fi.baseName(); + TQString basefilename = fi.baseName(true); + buffer.replace(TQRegExp("\\$MODULE\\$"),module); + buffer.replace(TQRegExp("\\$FILENAME\\$"),basefilename); } else loadBuffer(buffer,m_filename+".js"); // js - file - QString implementation = + TQString implementation = "/*$SPECIALIZATION$*/\n" "function $METHOD$\n" "{\n" @@ -418,7 +418,7 @@ void SubclassingDlg::accept() if (!slitem->isOn() || slitem->m_alreadyInSubclass) continue; - QString impl = implementation; + TQString impl = implementation; replace(impl,"$RETURNTYPE$",slitem->m_returnType); replace(impl,"$NEWCLASS$",m_edClassName->text()); replace(impl,"$METHOD$", slitem->m_methodName); @@ -453,9 +453,9 @@ void SubclassingDlg::onChangedClassName() m_btnOk->setEnabled(true); } -QString SubclassingDlg::readBaseClassName( ) +TQString SubclassingDlg::readBaseClassName( ) { - QDomDocument doc; + TQDomDocument doc; DomUtil::openDOMFile(doc,m_formFile); return DomUtil::elementByPathExt(doc,WIDGET_CLASS_NAME).text(); } diff --git a/languages/kjssupport/subclassingdlg.h b/languages/kjssupport/subclassingdlg.h index c727b648..8cf9ad32 100644 --- a/languages/kjssupport/subclassingdlg.h +++ b/languages/kjssupport/subclassingdlg.h @@ -12,7 +12,7 @@ #ifndef SUBCLASSINGDLG_H #define SUBCLASSINGDLG_H -#include <qlistview.h> +#include <tqlistview.h> #include "subclassingdlgbase.h" @@ -23,15 +23,15 @@ class kjsSupportPart; class SlotItem : public QCheckListItem { public: - SlotItem(QListView *parent,const QString &text, - const QString &specifier, const QString &Access, - const QString &returnType,bool isFunc, + SlotItem(TQListView *parent,const TQString &text, + const TQString &specifier, const TQString &Access, + const TQString &returnType,bool isFunc, bool callBaseClass=false); void setAllreadyInSubclass(); - QString m_access; - QString m_methodName; - QString m_returnType; - QString m_specifier; + TQString m_access; + TQString m_methodName; + TQString m_returnType; + TQString m_specifier; bool m_isFunc; bool m_callBaseClass; bool m_alreadyInSubclass; @@ -41,23 +41,23 @@ class SlotItem : public QCheckListItem class SubclassingDlg : public SubclassingDlgBase { public: - SubclassingDlg(kjsSupportPart* kjsSupport, const QString &formFile,QStringList &newFileNames, - QWidget* parent = 0, const char* name = 0, + SubclassingDlg(kjsSupportPart* kjsSupport, const TQString &formFile,TQStringList &newFileNames, + TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); -/* SubclassingDlg(CppSupportPart* kjsSupport, const QString &formFile,const QString &filename,QStringList &dummy, - QWidget* parent = 0, const char* name = 0, +/* SubclassingDlg(CppSupportPart* kjsSupport, const TQString &formFile,const TQString &filename,TQStringList &dummy, + TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );*/ ~SubclassingDlg(); private: void readUiFile(); - QString readBaseClassName(); + TQString readBaseClassName(); void updateDlg(); - bool replaceKeywords(QString &buffer, bool canBeModal=true); - void replace(QString &string, const QString& search, const QString& replace); - bool saveBuffer(QString &buffer, const QString& filename); - bool loadBuffer(QString &buffer, const QString& filename); - bool alreadyInSubclass(const QString &method); + bool replaceKeywords(TQString &buffer, bool canBeModal=true); + void replace(TQString &string, const TQString& search, const TQString& replace); + bool saveBuffer(TQString &buffer, const TQString& filename); + bool loadBuffer(TQString &buffer, const TQString& filename); + bool alreadyInSubclass(const TQString &method); bool m_creatingNewSubclass; public slots: @@ -65,20 +65,20 @@ public slots: virtual void onChangedClassName(); protected: - QStringList &m_newFileNames; - QString m_filename; - QString m_formFile; - QString m_baseClassName; - QString m_qtBaseClassName; - QString m_baseCaption; - QString m_formName; - QString m_formPath; - QStringList m_parsedMethods; + TQStringList &m_newFileNames; + TQString m_filename; + TQString m_formFile; + TQString m_baseClassName; + TQString m_qtBaseClassName; + TQString m_baseCaption; + TQString m_formName; + TQString m_formPath; + TQStringList m_parsedMethods; bool m_canBeModal; - QValueList<SlotItem*> m_slots; - QValueList<SlotItem*> m_functions; + TQValueList<SlotItem*> m_slots; + TQValueList<SlotItem*> m_functions; kjsSupportPart* m_kjsSupport; - QString connections; + TQString connections; }; #endif |