diff options
Diffstat (limited to 'languages/python/pythonsupportpart.cpp')
-rw-r--r-- | languages/python/pythonsupportpart.cpp | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/languages/python/pythonsupportpart.cpp b/languages/python/pythonsupportpart.cpp index 1b0e76da..9e6b0b0c 100644 --- a/languages/python/pythonsupportpart.cpp +++ b/languages/python/pythonsupportpart.cpp @@ -19,12 +19,12 @@ #include <codemodel.h> #include <domutil.h> -#include <qfileinfo.h> -#include <qpopupmenu.h> -#include <qstringlist.h> -#include <qtextstream.h> -#include <qtimer.h> -#include <qvbox.h> +#include <tqfileinfo.h> +#include <tqpopupmenu.h> +#include <tqstringlist.h> +#include <tqtextstream.h> +#include <tqtimer.h> +#include <tqvbox.h> #include <kaction.h> #include <kapplication.h> #include <kdebug.h> @@ -33,7 +33,7 @@ #include <kdevplugininfo.h> #include <kinputdialog.h> #include <klocale.h> -#include <qregexp.h> +#include <tqregexp.h> #include "qtdesignerpythonintegration.h" #include "pythonimplementationwidget.h" @@ -42,44 +42,44 @@ typedef KDevGenericFactory<PythonSupportPart> PythonSupportFactory; static const KDevPluginInfo data("kdevpythonsupport"); K_EXPORT_COMPONENT_FACTORY( libkdevpythonsupport, PythonSupportFactory( data ) ) -PythonSupportPart::PythonSupportPart(QObject *parent, const char *name, const QStringList &) +PythonSupportPart::PythonSupportPart(TQObject *parent, const char *name, const TQStringList &) : KDevLanguageSupport(&data, parent, name ? name : "PythonSupportPart") { setInstance(PythonSupportFactory::instance()); setXMLFile("kdevpythonsupport.rc"); - 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( core(), SIGNAL(projectConfigWidget(KDialogBase*)), - this, SLOT(projectConfigWidget(KDialogBase*)) ); - connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)), - this, SLOT(contextMenu(QPopupMenu *, const Context *)) ); + 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( core(), TQT_SIGNAL(projectConfigWidget(KDialogBase*)), + this, TQT_SLOT(projectConfigWidget(KDialogBase*)) ); + connect( core(), TQT_SIGNAL(contextMenu(TQPopupMenu *, const Context *)), + this, TQT_SLOT(contextMenu(TQPopupMenu *, const Context *)) ); KAction *action; action = new KAction( i18n("Execute Program"), "exec", 0, - this, SLOT(slotExecute()), + this, TQT_SLOT(slotExecute()), actionCollection(), "build_exec" ); action->setToolTip( i18n("Execute program") ); action->setWhatsThis(i18n("<b>Execute program</b><p>Runs the Python program.")); action = new KAction( i18n("Execute String..."), "exec", 0, - this, SLOT(slotExecuteString()), + this, TQT_SLOT(slotExecuteString()), actionCollection(), "build_execstring" ); action->setToolTip( i18n("Execute string") ); action->setWhatsThis(i18n("<b>Execute String</b><p>Executes a string as Python code.")); action = new KAction( i18n("Start Python Interpreter"), "exec", 0, - this, SLOT(slotStartInterpreter()), + this, TQT_SLOT(slotStartInterpreter()), actionCollection(), "build_runinterpreter" ); action->setToolTip( i18n("Start Python interpreter") ); action->setWhatsThis(i18n("<b>Start python interpreter</b><p>Starts the Python interpreter without a program")); action = new KAction( i18n("Python Documentation..."), 0, - this, SLOT(slotPydoc()), + this, TQT_SLOT(slotPydoc()), actionCollection(), "help_pydoc" ); action->setToolTip( i18n("Python documentation") ); action->setWhatsThis(i18n("<b>Python documentation</b><p>Shows a Python documentation page.")); @@ -90,7 +90,7 @@ PythonSupportPart::~PythonSupportPart() {} -void PythonSupportPart::contextMenu(QPopupMenu *popup, const Context *context) +void PythonSupportPart::contextMenu(TQPopupMenu *popup, const Context *context) { if (context->hasType(Context::FileContext)){ const FileContext *fc = static_cast<const FileContext*>(context); @@ -99,7 +99,7 @@ void PythonSupportPart::contextMenu(QPopupMenu *popup, const Context *context) if (url.fileName().endsWith(".ui")) { m_contextFileName = url.fileName(); - int id = popup->insertItem(i18n("Create or Select Implementation..."), this, SLOT(slotCreateSubclass())); + int id = popup->insertItem(i18n("Create or Select Implementation..."), this, TQT_SLOT(slotCreateSubclass())); popup->setWhatsThis(id, i18n("<b>Create or select implementation</b><p>Creates or selects a subclass of selected form for use with integrated KDevDesigner.")); } } @@ -108,9 +108,9 @@ void PythonSupportPart::contextMenu(QPopupMenu *popup, const Context *context) void PythonSupportPart::projectConfigWidget(KDialogBase *dlg) { - QVBox *vbox = dlg->addVBoxPage(i18n("Python")); + TQVBox *vbox = dlg->addVBoxPage(i18n("Python")); PythonConfigWidget *w = new PythonConfigWidget(*projectDom(), vbox, "python config widget"); - connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) ); + connect( dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(accept()) ); } @@ -118,14 +118,14 @@ void PythonSupportPart::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(initialParse())); + TQTimer::singleShot(0, this, TQT_SLOT(initialParse())); } @@ -134,9 +134,9 @@ void PythonSupportPart::projectClosed() } -void PythonSupportPart::maybeParse(const QString fileName) +void PythonSupportPart::maybeParse(const TQString fileName) { - QFileInfo fi(fileName); + TQFileInfo fi(fileName); if (fi.extension() == "py") { if( codeModel()->hasFile(fileName) ){ @@ -155,8 +155,8 @@ void PythonSupportPart::initialParse() 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; maybeParse(project()->projectDirectory() + "/" + *it); } @@ -169,15 +169,15 @@ void PythonSupportPart::initialParse() } -void PythonSupportPart::addedFilesToProject(const QStringList &fileList) +void PythonSupportPart::addedFilesToProject(const TQStringList &fileList) { kdDebug(9014) << "addedFilesToProject()" << 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 ); maybeParse( fileName ); emit addedSourceInfo( fileName ); } @@ -186,15 +186,15 @@ void PythonSupportPart::addedFilesToProject(const QStringList &fileList) } -void PythonSupportPart::removedFilesFromProject(const QStringList &fileList) +void PythonSupportPart::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 ); @@ -237,22 +237,22 @@ KMimeType::List PythonSupportPart::mimeTypes( ) return list; } -void PythonSupportPart::parse(const QString &fileName) +void PythonSupportPart::parse(const TQString &fileName) { - QFile f(QFile::encodeName(fileName)); + TQFile f(TQFile::encodeName(fileName)); if (!f.open(IO_ReadOnly)) return; - QTextStream stream(&f); + TQTextStream stream(&f); - QRegExp classre("^[ \t]*class[ \t]+([A-Za-z0-9_]+)[ \t]*(\\(([A-Za-z0-9_, \t]+)\\))?.*$"); - QRegExp methodre("^[ \t]*def[ \t]+([A-Za-z0-9_]+).*$"); + TQRegExp classre("^[ \t]*class[ \t]+([A-Za-z0-9_]+)[ \t]*(\\(([A-Za-z0-9_, \t]+)\\))?.*$"); + TQRegExp methodre("^[ \t]*def[ \t]+([A-Za-z0-9_]+).*$"); FileDom m_file = codeModel()->create<FileModel>(); m_file->setName( fileName ); ClassDom lastClass; - QString rawline; - QCString line; + TQString rawline; + TQCString line; int lineNo = 0; while (!stream.atEnd()) { rawline = stream.readLine(); @@ -264,10 +264,10 @@ void PythonSupportPart::parse(const QString &fileName) lastClass->setFileName( fileName ); lastClass->setStartPosition( lineNo, 0 ); - QStringList parentList = QStringList::split(",", classre.cap(3)); - QStringList::ConstIterator it; + TQStringList parentList = TQStringList::split(",", classre.cap(3)); + TQStringList::ConstIterator it; for (it = parentList.begin(); it != parentList.end(); ++it) { - QString baseName = (*it).stripWhiteSpace(); + TQString baseName = (*it).stripWhiteSpace(); kdDebug(9014) << "Add parent" << baseName << endl; lastClass->addBaseClass( baseName ); } @@ -296,7 +296,7 @@ void PythonSupportPart::parse(const QString &fileName) if (lastClass && rawline.left(3) != "def") { if( !lastClass->hasFunction(method->name()) ) lastClass->addFunction( method ); - QStringList scope; + TQStringList scope; scope << lastClass->name(); method->setScope( scope ); @@ -314,9 +314,9 @@ void PythonSupportPart::parse(const QString &fileName) } -QString PythonSupportPart::interpreter() +TQString PythonSupportPart::interpreter() { - QString prog = DomUtil::readEntry(*projectDom(), "/kdevpythonsupport/run/interpreter"); + TQString prog = DomUtil::readEntry(*projectDom(), "/kdevpythonsupport/run/interpreter"); if (prog.isEmpty()) prog = "python"; @@ -324,18 +324,18 @@ QString PythonSupportPart::interpreter() } -void PythonSupportPart::startApplication(const QString &program) +void PythonSupportPart::startApplication(const TQString &program) { bool inTerminal = DomUtil::readBoolEntry(*projectDom(), "/kdevpythonsupport/run/terminal"); if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend")) - appFrontend->startAppCommand(QString::QString(), program, inTerminal); + appFrontend->startAppCommand(TQString::TQString(), program, inTerminal); } void PythonSupportPart::slotExecute() { - QString program = project()->mainProgram(); - QString cmd = interpreter() + " " + program; + TQString program = project()->mainProgram(); + TQString cmd = interpreter() + " " + program; startApplication(cmd); } @@ -349,7 +349,7 @@ void PythonSupportPart::slotStartInterpreter() void PythonSupportPart::slotExecuteString() { bool ok; - QString cmd = KInputDialog::getText(i18n("String to Execute"), i18n("String to execute:"), QString::null, &ok, 0); + TQString cmd = KInputDialog::getText(i18n("String to Execute"), i18n("String to execute:"), TQString::null, &ok, 0); if (ok) { cmd.prepend("'"); cmd.append("'"); @@ -361,9 +361,9 @@ void PythonSupportPart::slotExecuteString() void PythonSupportPart::slotPydoc() { bool ok; - QString key = KInputDialog::getText(i18n("Show Python Documentation"), i18n("Show Python documentation on keyword:"), "", &ok, 0); + TQString key = KInputDialog::getText(i18n("Show Python Documentation"), i18n("Show Python documentation on keyword:"), "", &ok, 0); if (ok && !key.isEmpty()) { - QString url = "pydoc:"; + TQString url = "pydoc:"; url += key; partController()->showDocument(KURL(url)); } @@ -394,7 +394,7 @@ KDevDesignerIntegration *PythonSupportPart::designer(KInterfaceDesigner::Designe void PythonSupportPart::slotCreateSubclass() { - QFileInfo fi(m_contextFileName); + TQFileInfo fi(m_contextFileName); kdDebug(9014) << k_funcinfo << " file: " << m_contextFileName << " ext: " << fi.extension(false) << endl; if (fi.extension(false) != "ui") return; |