diff options
Diffstat (limited to 'languages/php/phpnewclassdlg.cpp')
-rw-r--r-- | languages/php/phpnewclassdlg.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/languages/php/phpnewclassdlg.cpp b/languages/php/phpnewclassdlg.cpp index f17034db..282e6c01 100644 --- a/languages/php/phpnewclassdlg.cpp +++ b/languages/php/phpnewclassdlg.cpp @@ -19,10 +19,10 @@ #include <klineedit.h> #include <kcompletion.h> #include <kfiledialog.h> -#include <qtoolbutton.h> +#include <tqtoolbutton.h> #include <iostream> -#include <qregexp.h> -#include <qtextedit.h> +#include <tqregexp.h> +#include <tqtextedit.h> #include <kglobal.h> #include <kstandarddirs.h> #include <kinstance.h> @@ -30,17 +30,17 @@ using namespace std; -PHPNewClassDlg::PHPNewClassDlg(const QStringList& baseClassNames,const QString& directory,QWidget *parent, const char *name) : PHPNewClassDlgBase(parent,name,true) { +PHPNewClassDlg::PHPNewClassDlg(const TQStringList& baseClassNames,const TQString& directory,TQWidget *parent, const char *name) : PHPNewClassDlgBase(parent,name,true) { m_filenameModified = false; KCompletion *comp = new KCompletion(); comp->setItems(baseClassNames); m_dirEdit->setText(directory); // load the class template if available - QString templateFile = KGlobal::instance()->dirs()->findResource("data","kdevphpsupport/newclasstemplate.txt"); + TQString templateFile = KGlobal::instance()->dirs()->findResource("data","kdevphpsupport/newclasstemplate.txt"); if(!templateFile.isNull()){ - QFile file(templateFile); - QTextStream stream(&file); + TQFile file(templateFile); + TQTextStream stream(&file); if(file.open(IO_ReadOnly)){ m_classTemplate->setText(stream.read()); file.close(); @@ -49,30 +49,30 @@ PHPNewClassDlg::PHPNewClassDlg(const QStringList& baseClassNames,const QString& m_baseClassEdit->setCompletionObject( comp ); /// @todo change it to KLineEdit - connect(m_baseClassEdit,SIGNAL(returnPressed(const QString&)),comp,SLOT(addItem(const QString&))); - connect(m_classNameEdit,SIGNAL(textChanged(const QString&)), - this,SLOT(classNameTextChanged(const QString&))); - connect(m_fileNameEdit,SIGNAL(textChanged(const QString&)), - this,SLOT(fileNameTextChanged(const QString&))); - connect(m_dirButton,SIGNAL(clicked()), - this,SLOT(slotDirButtonClicked())); + connect(m_baseClassEdit,TQT_SIGNAL(returnPressed(const TQString&)),comp,TQT_SLOT(addItem(const TQString&))); + connect(m_classNameEdit,TQT_SIGNAL(textChanged(const TQString&)), + this,TQT_SLOT(classNameTextChanged(const TQString&))); + connect(m_fileNameEdit,TQT_SIGNAL(textChanged(const TQString&)), + this,TQT_SLOT(fileNameTextChanged(const TQString&))); + connect(m_dirButton,TQT_SIGNAL(clicked()), + this,TQT_SLOT(slotDirButtonClicked())); } PHPNewClassDlg::~PHPNewClassDlg(){ } void PHPNewClassDlg::slotDirButtonClicked(){ - QString dir = KFileDialog::getExistingDirectory(m_dirEdit->text(),this); + TQString dir = KFileDialog::getExistingDirectory(m_dirEdit->text(),this); if(!dir.isEmpty()){ m_dirEdit->setText(dir); } } -void PHPNewClassDlg::classNameTextChanged(const QString& str){ +void PHPNewClassDlg::classNameTextChanged(const TQString& str){ if(!m_filenameModified){ m_fileNameEdit->setText(str.lower() + ".inc"); } } -void PHPNewClassDlg::fileNameTextChanged(const QString&){ +void PHPNewClassDlg::fileNameTextChanged(const TQString&){ if(m_fileNameEdit->hasFocus()){ m_filenameModified = true; } @@ -80,22 +80,22 @@ void PHPNewClassDlg::fileNameTextChanged(const QString&){ void PHPNewClassDlg::accept(){ PHPNewClassDlgBase::accept(); // hide the dialog - QString text = m_classTemplate->text(); - QString classDir = m_dirEdit->text(); + TQString text = m_classTemplate->text(); + TQString classDir = m_dirEdit->text(); if(!classDir.endsWith("/")) classDir += "/"; // append / - QString absFileName = classDir + m_fileNameEdit->text(); + TQString absFileName = classDir + m_fileNameEdit->text(); // save the template for the next time - QString templateDir = KGlobal::instance()->dirs()->saveLocation("data") + "/kdevphpsupport/"; - QString templateFile = templateDir + "newclasstemplate.txt"; - QDir dir(templateDir); + TQString templateDir = KGlobal::instance()->dirs()->saveLocation("data") + "/kdevphpsupport/"; + TQString templateFile = templateDir + "newclasstemplate.txt"; + TQDir dir(templateDir); if(!dir.exists()){ if(!dir.mkdir(templateDir)){ kdWarning() << "Error on creating directory for the classtemplate" << templateDir << endl; } } - QFile file(templateFile); - QTextStream stream(&file); + TQFile file(templateFile); + TQTextStream stream(&file); if(file.open(IO_WriteOnly)){ stream << text; // write @@ -104,14 +104,14 @@ void PHPNewClassDlg::accept(){ // generate the sourcecode for the class if(m_baseClassEdit->text().isEmpty()){ - text = text.replace(QRegExp("extends BASECLASS"),""); - text = text.replace(QRegExp("BASECLASS\\:\\:BASECLASS\\(\\);"),""); + text = text.replace(TQRegExp("extends BASECLASS"),""); + text = text.replace(TQRegExp("BASECLASS\\:\\:BASECLASS\\(\\);"),""); }else{ - text = text.replace(QRegExp("BASECLASS"),m_baseClassEdit->text()); + text = text.replace(TQRegExp("BASECLASS"),m_baseClassEdit->text()); } - text = text.replace(QRegExp("CLASSNAME"),m_classNameEdit->text()); - text = text.replace(QRegExp("FILENAME"),m_fileNameEdit->text().upper()); - text = text.replace(QRegExp("AUTHOR"),"not implemented"); + text = text.replace(TQRegExp("CLASSNAME"),m_classNameEdit->text()); + text = text.replace(TQRegExp("FILENAME"),m_fileNameEdit->text().upper()); + text = text.replace(TQRegExp("AUTHOR"),"not implemented"); file.setName(absFileName); if(file.open(IO_WriteOnly)){ |