diff options
Diffstat (limited to 'languages/php/phpsupportpart.cpp')
-rw-r--r-- | languages/php/phpsupportpart.cpp | 164 |
1 files changed, 82 insertions, 82 deletions
diff --git a/languages/php/phpsupportpart.cpp b/languages/php/phpsupportpart.cpp index 4c4de794..d31bc933 100644 --- a/languages/php/phpsupportpart.cpp +++ b/languages/php/phpsupportpart.cpp @@ -21,16 +21,16 @@ #include <iostream> -#include <qdir.h> -#include <qfileinfo.h> -#include <qpopupmenu.h> -#include <qprogressbar.h> -#include <qstringlist.h> -#include <qtextstream.h> -#include <qtimer.h> -#include <qvbox.h> -#include <qwhatsthis.h> -#include <qthread.h> +#include <tqdir.h> +#include <tqfileinfo.h> +#include <tqpopupmenu.h> +#include <tqprogressbar.h> +#include <tqstringlist.h> +#include <tqtextstream.h> +#include <tqtimer.h> +#include <tqvbox.h> +#include <tqwhatsthis.h> +#include <tqthread.h> #include <kaction.h> #include <kapplication.h> @@ -69,7 +69,7 @@ using namespace std; static const KDevPluginInfo data("kdevphpsupport"); K_EXPORT_COMPONENT_FACTORY( libkdevphpsupport, PHPSupportFactory( data ) ) -PHPSupportPart::PHPSupportPart(QObject *parent, const char *name, const QStringList &) +PHPSupportPart::PHPSupportPart(TQObject *parent, const char *name, const TQStringList &) : KDevLanguageSupport(&data, parent, name ? name : "PHPSupportPart") { m_htmlView = 0; @@ -79,23 +79,23 @@ PHPSupportPart::PHPSupportPart(QObject *parent, const char *name, const QStringL setXMLFile("kdevphpsupport.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(), 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*)) ); KAction *action; action = new KAction( i18n("&Run"), "exec",Key_F9, - this, SLOT(slotRun()), + this, TQT_SLOT(slotRun()), actionCollection(), "build_execute" ); action->setToolTip(i18n("Run")); action->setWhatsThis(i18n("<b>Run</b><p>Executes script on a terminal or a webserver.")); action = new KAction( i18n("&New Class..."),0, - this, SLOT(slotNewClass()), + this, TQT_SLOT(slotNewClass()), actionCollection(), "project_new_class" ); action->setToolTip(i18n("New class")); action->setWhatsThis(i18n("<b>New class</b><p>Runs New Class wizard.")); @@ -103,33 +103,33 @@ PHPSupportPart::PHPSupportPart(QObject *parent, const char *name, const QStringL m_phpErrorView = new PHPErrorView(this, 0, "phpErrorWidget"); m_phpErrorView->setIcon( SmallIcon("info") ); - QWhatsThis::add(m_phpErrorView, i18n("<b>PHP problems</b><p>This view shows PHP parser warnings, errors, and fatal errors.")); + TQWhatsThis::add(m_phpErrorView, i18n("<b>PHP problems</b><p>This view shows PHP parser warnings, errors, and fatal errors.")); mainWindow()->embedOutputView(m_phpErrorView, i18n("Problems"), i18n("Problems")); phpExeProc = new KShellProcess("/bin/sh"); - connect( phpExeProc, SIGNAL(receivedStdout (KProcess*, char*, int)), - this, SLOT(slotReceivedPHPExeStdout (KProcess*, char*, int))); - connect( phpExeProc, SIGNAL(receivedStderr (KProcess*, char*, int)), - this, SLOT(slotReceivedPHPExeStderr (KProcess*, char*, int))); - connect( phpExeProc, SIGNAL(processExited(KProcess*)), - this, SLOT(slotPHPExeExited(KProcess*))); + connect( phpExeProc, TQT_SIGNAL(receivedStdout (KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedPHPExeStdout (KProcess*, char*, int))); + connect( phpExeProc, TQT_SIGNAL(receivedStderr (KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedPHPExeStderr (KProcess*, char*, int))); + connect( phpExeProc, TQT_SIGNAL(processExited(KProcess*)), + this, TQT_SLOT(slotPHPExeExited(KProcess*))); m_htmlView = new PHPHTMLView(this); mainWindow()->embedOutputView(m_htmlView->view(), i18n("PHP"), i18n("PHP")); - connect( m_htmlView, SIGNAL(started(KIO::Job*)), - this, SLOT(slotWebJobStarted(KIO::Job*))); + connect( m_htmlView, TQT_SIGNAL(started(KIO::Job*)), + this, TQT_SLOT(slotWebJobStarted(KIO::Job*))); configData = new PHPConfigData(projectDom()); - connect( configData, SIGNAL(configStored()), - this, SLOT(slotConfigStored())); + connect( configData, TQT_SIGNAL(configStored()), + this, TQT_SLOT(slotConfigStored())); m_codeCompletion = new PHPCodeCompletion(this, configData); - new KAction(i18n("Complete Text"), CTRL+Key_Space, m_codeCompletion, SLOT(cursorPositionChanged()), actionCollection(), "edit_complete_text"); + new KAction(i18n("Complete Text"), CTRL+Key_Space, m_codeCompletion, TQT_SLOT(cursorPositionChanged()), actionCollection(), "edit_complete_text"); - connect( partController(), SIGNAL(activePartChanged(KParts::Part*)), - this, SLOT(slotActivePartChanged(KParts::Part *))); - connect( this, SIGNAL(fileParsed( PHPFile* )), this, SLOT(slotfileParsed( PHPFile* ))); + connect( partController(), TQT_SIGNAL(activePartChanged(KParts::Part*)), + this, TQT_SLOT(slotActivePartChanged(KParts::Part *))); + connect( this, TQT_SIGNAL(fileParsed( PHPFile* )), this, TQT_SLOT(slotfileParsed( PHPFile* ))); } PHPSupportPart::~PHPSupportPart() @@ -180,7 +180,7 @@ void PHPSupportPart::slotActivePartChanged(KParts::Part *part) { if (m_editInterface) { // connect to the editor disconnect(part, 0, this, 0 ); // to make sure that it is't connected twice if (configData->getRealtimeParsing()) { - connect(part,SIGNAL(textChanged()),this,SLOT(slotTextChanged())); + connect(part,TQT_SIGNAL(textChanged()),this,TQT_SLOT(slotTextChanged())); } m_codeCompletion->setActiveEditorPart(part); } @@ -194,7 +194,7 @@ void PHPSupportPart::slotTextChanged() { if (!ro_part) return; - QString fileName = ro_part->url().directory() + "/" + ro_part->url().fileName(); + TQString fileName = ro_part->url().directory() + "/" + ro_part->url().fileName(); if (m_parser) { if (m_parser->hasFile( fileName )) @@ -208,13 +208,13 @@ void PHPSupportPart::slotConfigStored() { } void PHPSupportPart::projectConfigWidget(KDialogBase *dlg) { - QVBox *vbox = dlg->addVBoxPage(i18n( "PHP Specific" ), i18n("PHP Settings"), BarIcon( "source", KIcon::SizeMedium )); + TQVBox *vbox = dlg->addVBoxPage(i18n( "PHP Specific" ), i18n("PHP Settings"), BarIcon( "source", KIcon::SizeMedium )); PHPConfigWidget* w = new PHPConfigWidget(configData,vbox, "php config widget"); - connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) ); + connect( dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(accept()) ); } void PHPSupportPart::slotNewClass() { - QStringList classNames = sortedNameList( codeModel()->globalNamespace()->classList() ); + TQStringList classNames = sortedNameList( codeModel()->globalNamespace()->classList() ); PHPNewClassDlg dlg(classNames,project()->projectDirectory()); dlg.exec(); } @@ -240,9 +240,9 @@ bool PHPSupportPart::validateConfig() { KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, 0, "php config dialog"); - QVBox *vbox = dlg.addVBoxPage(i18n("PHP Settings")); + TQVBox *vbox = dlg.addVBoxPage(i18n("PHP Settings")); PHPConfigWidget* w = new PHPConfigWidget(configData,vbox, "php config widget"); - connect( &dlg, SIGNAL(okClicked()), w, SLOT(accept()) ); + connect( &dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(accept()) ); dlg.exec(); } if (configData->validateConfig()) { @@ -257,8 +257,8 @@ void PHPSupportPart::executeOnWebserver() { return; //user cancelled // Figure out the name of the remote file - QString weburl = configData->getWebURL(); - QString file = getExecuteFile(); + TQString weburl = configData->getWebURL(); + TQString file = getExecuteFile(); // Force KHTMLPart to reload the page KParts::BrowserExtension* be = m_htmlView->browserExtension(); @@ -274,11 +274,11 @@ void PHPSupportPart::executeOnWebserver() { m_htmlView->show(); } -QString PHPSupportPart::getExecuteFile() { - QString file; +TQString PHPSupportPart::getExecuteFile() { + TQString file; PHPConfigData::StartupFileMode mode = configData->getStartupFileMode(); - QString weburl = configData->getWebURL(); + TQString weburl = configData->getWebURL(); if (mode == PHPConfigData::Current) { KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(partController()->activePart()); if (ro_part) { @@ -295,25 +295,25 @@ QString PHPSupportPart::getExecuteFile() { } void PHPSupportPart::slotWebJobStarted(KIO::Job* job) { - if (job && job->className() == QString("KIO::TransferJob")) { + if (job && job->className() == TQString("KIO::TransferJob")) { kdDebug(9018) << endl << "job started" << job->progressId(); KIO::TransferJob *tjob = static_cast<KIO::TransferJob*>(job); - connect( tjob, SIGNAL(data(KIO::Job*, const QByteArray&)), - this, SLOT(slotWebData(KIO::Job*, const QByteArray&))); - connect( tjob, SIGNAL(result(KIO::Job*)), - this, SLOT(slotWebResult(KIO::Job*))); + connect( tjob, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)), + this, TQT_SLOT(slotWebData(KIO::Job*, const TQByteArray&))); + connect( tjob, TQT_SIGNAL(result(KIO::Job*)), + this, TQT_SLOT(slotWebResult(KIO::Job*))); } } -void PHPSupportPart::slotWebData(KIO::Job* /*job*/,const QByteArray& data) { +void PHPSupportPart::slotWebData(KIO::Job* /*job*/,const TQByteArray& data) { kdDebug(9018) << "slotWebData()" << endl; - QString strData(data); + TQString strData(data); m_phpExeOutput += strData; } void PHPSupportPart::slotWebResult(KIO::Job* /*job*/) { kdDebug(9018) << "slotWebResult()" << endl; - QString file = getExecuteFile(); + TQString file = getExecuteFile(); PHPFile *pfile = new PHPFile(this, file); pfile->ParseStdout(m_phpExeOutput); delete pfile; @@ -326,7 +326,7 @@ void PHPSupportPart::executeInTerminal() { if (partController()->saveAllFiles()==false) return; //user cancelled - QString file = getExecuteFile(); + TQString file = getExecuteFile(); if (m_htmlView == 0) { m_htmlView = new PHPHTMLView(this); @@ -350,9 +350,9 @@ void PHPSupportPart::executeInTerminal() { void PHPSupportPart::slotReceivedPHPExeStdout (KProcess* /*proc*/, char* buffer, int buflen) { kdDebug(9018) << "slotPHPExeStdout()" << endl; - m_phpExeOutput += QString::fromLocal8Bit(buffer,buflen+1); + m_phpExeOutput += TQString::fromLocal8Bit(buffer,buflen+1); - QString buf = buffer; + TQString buf = buffer; if (configData->getInvocationMode() == PHPConfigData::Shell) buf.replace("\n", "<br>"); m_htmlView->write(buf); @@ -360,9 +360,9 @@ void PHPSupportPart::slotReceivedPHPExeStdout (KProcess* /*proc*/, char* buffer, void PHPSupportPart::slotReceivedPHPExeStderr (KProcess* /*proc*/, char* buffer, int buflen) { kdDebug(9018) << "slotPHPExeStderr()" << endl; - m_phpExeOutput += QString::fromLocal8Bit(buffer,buflen+1); + m_phpExeOutput += TQString::fromLocal8Bit(buffer,buflen+1); - QString buf = buffer; + TQString buf = buffer; if (configData->getInvocationMode() == PHPConfigData::Shell) buf.replace("\n", "<br>"); m_htmlView->write(buf); @@ -371,7 +371,7 @@ void PHPSupportPart::slotReceivedPHPExeStderr (KProcess* /*proc*/, char* buffer, void PHPSupportPart::slotPHPExeExited (KProcess* /*proc*/) { kdDebug(9018) << "slotPHPExeExited()" << endl; m_htmlView->end(); - QString file = getExecuteFile(); + TQString file = getExecuteFile(); PHPFile *pfile = new PHPFile(this, file); pfile->ParseStdout(m_phpExeOutput); delete pfile; @@ -381,10 +381,10 @@ void PHPSupportPart::projectOpened() { kdDebug(9018) << "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 &)) ); if (!m_parser) { m_parser = new PHPParser( this ); @@ -393,7 +393,7 @@ void PHPSupportPart::projectOpened() // We want to parse only after all components have been // properly initialized - QTimer::singleShot(500, this, SLOT( initialParse() ) ); + TQTimer::singleShot(500, this, TQT_SLOT( initialParse() ) ); } void PHPSupportPart::initialParse( ) @@ -432,7 +432,7 @@ bool PHPSupportPart::parseProject() _jd->files = project()->allFiles(); - QProgressBar* bar = new QProgressBar( _jd->files.count( ), mainWindow( ) ->statusBar( ) ); + TQProgressBar* bar = new TQProgressBar( _jd->files.count( ), mainWindow( ) ->statusBar( ) ); bar->setMinimumWidth( 120 ); bar->setCenterIndicator( true ); mainWindow()->statusBar()->addWidget( bar ); @@ -442,7 +442,7 @@ bool PHPSupportPart::parseProject() _jd->it = _jd->files.begin(); _jd->dir.setPath( project()->projectDirectory() ); - QTimer::singleShot( 0, this, SLOT( slotParseFiles() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( slotParseFiles() ) ); return TRUE; } @@ -456,11 +456,11 @@ void PHPSupportPart::slotParseFiles() { _jd->progressBar->setProgress( _jd->progressBar->progress() + 1 ); - QFileInfo fileInfo( _jd->dir, *( _jd->it ) ); + TQFileInfo fileInfo( _jd->dir, *( _jd->it ) ); if ( fileInfo.exists() && fileInfo.isFile() && fileInfo.isReadable() ) { - QString absFilePath = URLUtil::canonicalPath( fileInfo.absFilePath() ); + TQString absFilePath = URLUtil::canonicalPath( fileInfo.absFilePath() ); // if ( isValidSource( absFilePath ) ) { @@ -470,7 +470,7 @@ void PHPSupportPart::slotParseFiles() ++( _jd->it ); } - QTimer::singleShot( 0, this, SLOT( slotParseFiles() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( slotParseFiles() ) ); } else // finished or interrupted { @@ -489,15 +489,15 @@ void PHPSupportPart::slotParseFiles() kapp->unlock(); } -void PHPSupportPart::addedFilesToProject(const QStringList &fileList) +void PHPSupportPart::addedFilesToProject(const TQStringList &fileList) { kdDebug(9018) << "addedFilesToProject()" << endl; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for ( it = fileList.begin(); it != fileList.end(); ++it ) { - QFileInfo fileInfo( project()->projectDirectory(), *it ); + TQFileInfo fileInfo( project()->projectDirectory(), *it ); if (m_parser) { m_parser->addFile( fileInfo.absFilePath() ); emit addedSourceInfo( fileInfo.absFilePath() ); @@ -505,16 +505,16 @@ void PHPSupportPart::addedFilesToProject(const QStringList &fileList) } } -void PHPSupportPart::removedFilesFromProject(const QStringList &fileList) +void PHPSupportPart::removedFilesFromProject(const TQStringList &fileList) { kdDebug(9018) << "removedFilesFromProject()" << endl; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for ( it = fileList.begin(); it != fileList.end(); ++it ) { - QFileInfo fileInfo( project()->projectDirectory(), *it ); - QString path = fileInfo.absFilePath(); + TQFileInfo fileInfo( project()->projectDirectory(), *it ); + TQString path = fileInfo.absFilePath(); if ( codeModel()->hasFile(path) ) { emit aboutToRemoveSourceInfo( path ); codeModel()->removeFile( codeModel()->fileByName(path) ); @@ -535,12 +535,12 @@ void PHPSupportPart::savedFile(const KURL &fileName) */ } -QString PHPSupportPart::getIncludePath() +TQString PHPSupportPart::getIncludePath() { return configData->getPHPIncludePath(); } -QString PHPSupportPart::getExePath() +TQString PHPSupportPart::getExePath() { return configData->getPHPExecPath(); } @@ -563,9 +563,9 @@ KMimeType::List PHPSupportPart::mimeTypes( ) return list; } -void PHPSupportPart::customEvent( QCustomEvent* ev ) +void PHPSupportPart::customEvent( TQCustomEvent* ev ) { -// kdDebug(9018) << "phpSupportPart::customEvent(" << ev->type() << ") " << QThread::currentThread() << endl; +// kdDebug(9018) << "phpSupportPart::customEvent(" << ev->type() << ") " << TQThread::currentThread() << endl; if ( ev->type() < Event_AddFile || ev->type() > Event_AddFixme ) return; @@ -663,7 +663,7 @@ void PHPSupportPart::customEvent( QCustomEvent* ev ) else if ( event->name() == "protected" ) LastMethod->setAccess(FunctionModel::Protected); else if ( event->name() == "result" ) { - QString ret = ""; + TQString ret = ""; if (event->arguments().lower() == "$this" && LastClass ) { ret = LastClass->name(); } |