From d6f8bbb45b267065a6907e71ff9c98bb6d161241 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:56:07 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- languages/cpp/subclassingdlg.cpp | 132 +++++++++++++++++++-------------------- 1 file changed, 66 insertions(+), 66 deletions(-) (limited to 'languages/cpp/subclassingdlg.cpp') diff --git a/languages/cpp/subclassingdlg.cpp b/languages/cpp/subclassingdlg.cpp index fa5aece9..562cd010 100644 --- a/languages/cpp/subclassingdlg.cpp +++ b/languages/cpp/subclassingdlg.cpp @@ -22,20 +22,20 @@ #include "filetemplate.h" #include "codemodel.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include -#include +#include #include -#include +#include #include #include #include -#include -#include +#include +#include #include @@ -54,17 +54,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(CppSupportPart* cppSupport, const QString &formFile, - QStringList &newFileNames, QWidget* parent, +SubclassingDlg::SubclassingDlg(CppSupportPart* cppSupport, const TQString &formFile, + TQStringList &newFileNames, TQWidget* parent, const char* name,bool modal, WFlags fl) : SubclassingDlgBase(parent,name,modal,fl), m_newFileNames(newFileNames), m_cppSupport( cppSupport ) @@ -115,9 +115,9 @@ m_newFileNames(newFileNames), m_cppSupport( cppSupport ) } -SubclassingDlg::SubclassingDlg(CppSupportPart* cppSupport, const QString &formFile, - const QString &filename, QStringList &dummy, - QWidget* parent, const char* name, bool modal, WFlags fl) +SubclassingDlg::SubclassingDlg(CppSupportPart* cppSupport, 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_cppSupport( cppSupport ) @@ -135,12 +135,12 @@ m_newFileNames(dummy), m_cppSupport( cppSupport ) reformat_box->setChecked(true); } - QStringList pathsplit(QStringList::split('/',filename)); + TQStringList pathsplit(TQStringList::split('/',filename)); - QString baseClass = readBaseClassName(); - if (!cppSupport->codeModel()->hasFile(filename+QString(".h"))) + TQString baseClass = readBaseClassName(); + if (!cppSupport->codeModel()->hasFile(filename+TQString(".h"))) return; - ClassList myClasses = cppSupport->codeModel()->fileByName(filename+QString(".h"))->classList(); + ClassList myClasses = cppSupport->codeModel()->fileByName(filename+TQString(".h"))->classList(); for (ClassList::const_iterator classIt = myClasses.begin(); classIt != myClasses.end(); ++classIt) { kdDebug() << "base class " << baseClass << " class " << (*classIt)->name() @@ -163,7 +163,7 @@ m_newFileNames(dummy), m_cppSupport( cppSupport ) m_btnOk->setEnabled(true); } -bool SubclassingDlg::alreadyInSubclass(const QString &method) +bool SubclassingDlg::alreadyInSubclass(const TQString &method) { for (uint i=0;isetEnabled(false); - QDomDocument doc; + TQDomDocument doc; DomUtil::openDOMFile(doc,m_formFile); m_baseClassName = DomUtil::elementByPathExt(doc,WIDGET_CLASS_NAME).text(); @@ -191,13 +191,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); @@ -214,7 +214,7 @@ void SubclassingDlg::readUiFile() m_slots << newSlot; } - if (m_qtBaseClassName == "QWizard") + if (m_qtBaseClassName == "TQWizard") { newSlot = new SLOT_NEXT; m_slotView->insertItem(newSlot); @@ -234,12 +234,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; itext().upper()); replace(buffer,"$BASEFILENAMELC$",m_formName.lower()); @@ -327,11 +327,11 @@ 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()); @@ -353,19 +353,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; int qtVersion = DomUtil::readIntEntry( *m_cppSupport->project()->projectDom(), "/kdevcppsupport/qt/version", 3 ); if (m_creatingNewSubclass) { @@ -375,11 +375,11 @@ void SubclassingDlg::accept() loadBuffer(buffer,::locate("data", "kdevcppsupport/subclassing/subclass_qt4_template.h")); buffer = FileTemplate::read(m_cppSupport, "h") + buffer; - QFileInfo fi(m_filename + ".h"); - QString module = fi.baseName(); - QString basefilename = fi.baseName(true); - buffer.replace(QRegExp("\\$MODULE\\$"),module); - buffer.replace(QRegExp("\\$FILENAME\\$"),basefilename); + TQFileInfo fi(m_filename + ".h"); + TQString module = fi.baseName(); + TQString basefilename = fi.baseName(true); + buffer.replace(TQRegExp("\\$MODULE\\$"),module); + buffer.replace(TQRegExp("\\$FILENAME\\$"),basefilename); } else loadBuffer(buffer,m_filename+".h"); @@ -391,7 +391,7 @@ void SubclassingDlg::accept() if (!slitem->isOn() || slitem->m_alreadyInSubclass) continue; - QString declBuild; + TQString declBuild; if (slitem->m_access=="public") if (!slitem->m_isFunc) declBuild = public_slot; @@ -405,7 +405,7 @@ void SubclassingDlg::accept() if (!(slitem->m_specifier=="non virtual")) declBuild += "virtual "; declBuild += slitem->m_returnType + " "; - QString spacer; + TQString spacer; if (slitem->m_access=="public") { if (!slitem->m_isFunc) @@ -448,13 +448,13 @@ void SubclassingDlg::accept() // cpp - file - QString implementation = + TQString implementation = "/*$SPECIALIZATION$*/\n" "$RETURNTYPE$ $NEWCLASS$::$METHOD$\n" "{\n" "}\n"; - QString implementation_callbase = + TQString implementation_callbase = "/*$SPECIALIZATION$*/\n" "$RETURNTYPE$ $NEWCLASS$::$METHOD$\n" "{\n" @@ -470,11 +470,11 @@ void SubclassingDlg::accept() loadBuffer(buffer,::locate("data", "kdevcppsupport/subclassing/subclass_qt4_template.cpp")); buffer = FileTemplate::read(m_cppSupport, "cpp") + buffer; - QFileInfo fi(m_filename + ".cpp"); - QString module = fi.baseName(); - QString basefilename = fi.baseName(true); - buffer.replace(QRegExp("\\$MODULE\\$"),module); - buffer.replace(QRegExp("\\$FILENAME\\$"),basefilename); + TQFileInfo fi(m_filename + ".cpp"); + TQString module = fi.baseName(); + TQString basefilename = fi.baseName(true); + buffer.replace(TQRegExp("\\$MODULE\\$"),module); + buffer.replace(TQRegExp("\\$FILENAME\\$"),basefilename); if ( (m_cppSupport->project()) && (m_cppSupport->project()->options() & KDevProject::UsesAutotoolsBuildSystem)) buffer += "\n#include \"$NEWFILENAMELC$.moc\"\n"; } @@ -488,7 +488,7 @@ void SubclassingDlg::accept() if (!slitem->isOn() || slitem->m_alreadyInSubclass) continue; - QString impl = slitem->m_callBaseClass ? implementation_callbase : implementation; + TQString impl = slitem->m_callBaseClass ? implementation_callbase : implementation; replace(impl,"$RETURNTYPE$",slitem->m_returnType); replace(impl,"$NEWCLASS$",m_edClassName->text()); replace(impl,"$METHOD$", slitem->m_methodName); @@ -526,9 +526,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(); } -- cgit v1.2.3