diff options
Diffstat (limited to 'buildtools/qmake/trollprojectpart.cpp')
-rw-r--r-- | buildtools/qmake/trollprojectpart.cpp | 304 |
1 files changed, 152 insertions, 152 deletions
diff --git a/buildtools/qmake/trollprojectpart.cpp b/buildtools/qmake/trollprojectpart.cpp index 6d2f5b3a..d59c5b4b 100644 --- a/buildtools/qmake/trollprojectpart.cpp +++ b/buildtools/qmake/trollprojectpart.cpp @@ -15,9 +15,9 @@ #include "trollprojectpart.h" -#include <qdir.h> -#include <qfileinfo.h> -#include <qwhatsthis.h> +#include <tqdir.h> +#include <tqfileinfo.h> +#include <tqwhatsthis.h> #include <kdeversion.h> #include <kdebug.h> #include <kdialogbase.h> @@ -26,7 +26,7 @@ #include <kmessagebox.h> #include <kdirwatch.h> #include <kstatusbar.h> -#include <qmessagebox.h> +#include <tqmessagebox.h> #include <kdevgenericfactory.h> #include <kaction.h> #include <kparts/part.h> @@ -60,7 +60,7 @@ typedef KDevGenericFactory<TrollProjectPart> TrollProjectFactory; static const KDevPluginInfo data("kdevtrollproject"); K_EXPORT_COMPONENT_FACTORY( libkdevtrollproject, TrollProjectFactory( data ) ) -TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStringList& args ) +TrollProjectPart::TrollProjectPart(TQObject *parent, const char *name, const TQStringList& args ) : KDevBuildTool(&data, parent, name ? name : "TrollProjectPart") { setInstance(TrollProjectFactory::instance()); @@ -80,7 +80,7 @@ TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStr m_widget = new TrollProjectWidget(this); m_widget->setIcon(SmallIcon("qmakerun")); m_widget->setCaption(i18n("QMake Manager")); - QWhatsThis::add(m_widget, i18n("<b>QMake manager</b><p>" + TQWhatsThis::add(m_widget, i18n("<b>QMake manager</b><p>" "The QMake manager project tree consists of two parts. The 'overview' " "in the upper half shows the subprojects, each one having a " ".pro file. The 'details' view in the lower half shows the " @@ -90,9 +90,9 @@ TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStr KAction *action; - const QIconSet icon(SmallIcon("compfile")); + const TQIconSet icon(SmallIcon("compfile")); action = new KAction( i18n("Compile &File"), "compfile", 0, - m_widget, SLOT(slotBuildOpenFile()), + m_widget, TQT_SLOT(slotBuildOpenFile()), actionCollection(),"build_compilefile" ); action->setToolTip(i18n("Compile file")); action->setWhatsThis(i18n("<b>Compile file</b><p>Runs <b>make filename.o</b> command from the directory where 'filename' is the name of currently opened file.<br>" @@ -101,7 +101,7 @@ TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStr action = new KAction( i18n("&Build Project"), "make_kdevelop", Key_F8, - m_widget, SLOT(slotBuildProject()), + m_widget, TQT_SLOT(slotBuildProject()), actionCollection(), "build_build_project" ); action->setToolTip(i18n("Build project")); action->setWhatsThis(i18n("<b>Build project</b><p>Runs <b>make</b> from the project directory.<br>" @@ -109,7 +109,7 @@ TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStr "in the project settings dialog, <b>Make Options</b> tab.")); action = new KAction( i18n("&Rebuild Project"),"rebuild" , 0, - m_widget, SLOT(slotRebuildProject()), + m_widget, TQT_SLOT(slotRebuildProject()), actionCollection(),"build_rebuild_project" ); action->setToolTip(i18n("Rebuild project")); action->setWhatsThis(i18n("<b>Rebuild project</b><p>Runs <b>make clean</b> and then <b>make</b> from the project directory.<br>" @@ -117,7 +117,7 @@ TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStr "in the project settings dialog, <b>Make Options</b> tab.")); action = new KAction( i18n("&Install Project"),"install" , 0, - m_widget, SLOT(slotInstallProject()), + m_widget, TQT_SLOT(slotInstallProject()), actionCollection(),"build_install_project" ); action->setToolTip(i18n("Install project")); action->setWhatsThis(i18n("<b>Install project</b><p>Runs <b>make install</b> from the project directory.<br>" @@ -125,7 +125,7 @@ TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStr "in the project settings dialog, <b>Make Options</b> tab.")); action = new KAction( i18n("&Clean Project"), 0, - m_widget, SLOT(slotCleanProject()), + m_widget, TQT_SLOT(slotCleanProject()), actionCollection(), "build_clean_project" ); action->setToolTip(i18n("Clean project")); action->setWhatsThis(i18n("<b>Clean project</b><p>Runs <b>make clean</b> command from the project directory.<br>" @@ -133,7 +133,7 @@ TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStr "in the project settings dialog, <b>Make Options</b> tab.")); action = new KAction( i18n("&Dist-Clean Project"), 0, - m_widget, SLOT(slotDistCleanProject()), + m_widget, TQT_SLOT(slotDistCleanProject()), actionCollection(), "build_distclean_project" ); action->setToolTip(i18n("Dist-Clean project")); action->setWhatsThis(i18n("<b>Dist-Clean project</b><p>Runs <b>make distclean</b> command from the " @@ -141,13 +141,13 @@ TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStr "in the project settings dialog, <b>Make Options</b> tab.")); action = new KAction( i18n("Execute Main Program"), "exec", SHIFT+Key_F9, - this, SLOT(slotBuildAndExecuteProject()), + this, TQT_SLOT(slotBuildAndExecuteProject()), actionCollection(), "build_execute_project" ); action->setToolTip(i18n("Execute main program")); action->setWhatsThis(i18n("<b>Execute program</b><p>Executes the currently selected subproject if it is an application or the program specified in project settings, <b>Run Options</b> tab.")); action = new KAction( i18n("&Build Subproject"), "make_kdevelop", Key_F7, - m_widget, SLOT(slotBuildTarget()), + m_widget, TQT_SLOT(slotBuildTarget()), actionCollection(), "build_build_target" ); action->setToolTip(i18n("Build subproject")); action->setWhatsThis(i18n("<b>Build subproject</b><p>Runs <b>make</b> from the current subproject directory. " @@ -156,7 +156,7 @@ TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStr "in the project settings dialog, <b>Make Options</b> tab.")); action = new KAction( i18n("&Rebuild Subproject"), "rebuild", 0, - m_widget, SLOT(slotRebuildTarget()), + m_widget, TQT_SLOT(slotRebuildTarget()), actionCollection(),"build_rebuild_target" ); action->setToolTip(i18n("Rebuild subproject")); action->setWhatsThis(i18n("<b>Rebuild subproject</b><p>Runs <b>make clean</b> and then <b>make</b> from the current subproject directory. " @@ -165,7 +165,7 @@ TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStr "in the project settings dialog, <b>Make Options</b> tab.")); action = new KAction( i18n("&Install Subproject"), "install", 0, - m_widget, SLOT(slotInstallTarget()), + m_widget, TQT_SLOT(slotInstallTarget()), actionCollection(),"build_install_target" ); action->setToolTip(i18n("Install subproject")); action->setWhatsThis(i18n("<b>Install subproject</b><p>Runs <b>make install</b> from the current subproject directory. " @@ -174,7 +174,7 @@ TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStr "in the project settings dialog, <b>Make Options</b> tab.")); action = new KAction( i18n("&Clean Subproject"), 0, - m_widget, SLOT(slotCleanTarget()), + m_widget, TQT_SLOT(slotCleanTarget()), actionCollection(), "build_clean_target" ); action->setToolTip(i18n("Clean subproject")); action->setWhatsThis(i18n("<b>Clean subproject</b><p>Runs <b>make clean</b> from the current subproject directory. " @@ -183,7 +183,7 @@ TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStr "in the project settings dialog, <b>Make Options</b> tab.")); action = new KAction( i18n("&Dist-Clean Subproject"), 0, - m_widget, SLOT(slotDistCleanTarget()), + m_widget, TQT_SLOT(slotDistCleanTarget()), actionCollection(), "build_distclean_target" ); action->setToolTip(i18n("Dist-Clean subproject")); action->setWhatsThis(i18n("<b>Dist-Clean subproject</b><p>Runs <b>make distclean</b> from the current" @@ -192,22 +192,22 @@ TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStr "in the project settings dialog, <b>Make Options</b> tab.")); action = new KAction( i18n("Execute Subproject"), "exec", 0, - this, SLOT(slotBuildAndExecuteTarget()), + this, TQT_SLOT(slotBuildAndExecuteTarget()), actionCollection(), "build_execute_target" ); action->setToolTip(i18n("Execute subproject")); action->setWhatsThis(i18n("<b>Execute subproject</b><p>Executes the target program for the currently selected subproject. " "This action is allowed only if a type of the subproject is 'application'. The type of the subproject can be " "defined in <b>Subproject Settings</b> dialog (open it from the subproject context menu).")); - connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)), - this, SLOT(projectConfigWidget(KDialogBase*)) ); + connect( core(), TQT_SIGNAL(projectConfigWidget(KDialogBase*)), + this, TQT_SLOT(projectConfigWidget(KDialogBase*)) ); - connect( makeFrontend(), SIGNAL(commandFinished(const QString&)), - this, SLOT(slotCommandFinished(const QString&)) ); + connect( makeFrontend(), TQT_SIGNAL(commandFinished(const TQString&)), + this, TQT_SLOT(slotCommandFinished(const TQString&)) ); - QString m_defaultQtDir = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/root", ""); - QString m_qmakePath = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/qmake", ""); - QString qtversion = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/version", "3"); + TQString m_defaultQtDir = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/root", ""); + TQString m_qmakePath = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/qmake", ""); + TQString qtversion = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/version", "3"); if( m_defaultQtDir.isEmpty() || !isValidQtDir( m_defaultQtDir ) ) { @@ -233,7 +233,7 @@ TrollProjectPart::~TrollProjectPart() delete m_widget; } -QString TrollProjectPart::makeEnvironment() +TQString TrollProjectPart::makeEnvironment() { // Get the make environment variables pairs into the environstr string // in the form of: "ENV_VARIABLE=ENV_VALUE" @@ -242,7 +242,7 @@ QString TrollProjectPart::makeEnvironment() DomUtil::PairList envvars = DomUtil::readPairListEntry(*projectDom(), "/kdevtrollproject/make/envvars", "envvar", "name", "value"); - QString environstr; + TQString environstr; DomUtil::PairList::ConstIterator it; bool hasQtDir = false; for (it = envvars.begin(); it != envvars.end(); ++it) { @@ -257,7 +257,7 @@ QString TrollProjectPart::makeEnvironment() if( !hasQtDir && !isQt4Project() && !DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/root", "").isEmpty() ) { - environstr += QString( "QTDIR=" ) + EnvVarTools::quote( DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/root", "") ) + QString( " PATH=$QTDIR/bin:$PATH " ); + environstr += TQString( "QTDIR=" ) + EnvVarTools::quote( DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/root", "") ) + TQString( " PATH=$QTDIR/bin:$PATH " ); } KConfigGroup grp( kapp->config(), "MakeOutputView" ); @@ -269,7 +269,7 @@ QString TrollProjectPart::makeEnvironment() void TrollProjectPart::projectConfigWidget(KDialogBase *dlg) { - QVBox *vbox; + TQVBox *vbox; vbox = dlg->addVBoxPage(i18n("Run Options"), i18n("Run Options"), BarIcon( "make", KIcon::SizeMedium )); RunOptionsWidget *optdlg = new RunOptionsWidget(*projectDom(), "/kdevtrollproject", buildDirectory(), vbox); @@ -280,32 +280,32 @@ void TrollProjectPart::projectConfigWidget(KDialogBase *dlg) QMakeOptionsWidget *qm = new QMakeOptionsWidget( projectDirectory(), *projectDom(), "/kdevtrollproject", vbox); - connect( dlg, SIGNAL(okClicked()), w4, SLOT(accept()) ); - connect( dlg, SIGNAL(okClicked()), qm, SLOT(accept()) ); - connect( dlg, SIGNAL(okClicked()), optdlg, SLOT(accept()) ); + connect( dlg, TQT_SIGNAL(okClicked()), w4, TQT_SLOT(accept()) ); + connect( dlg, TQT_SIGNAL(okClicked()), qm, TQT_SLOT(accept()) ); + connect( dlg, TQT_SIGNAL(okClicked()), optdlg, TQT_SLOT(accept()) ); } -void TrollProjectPart::openProject(const QString &dirName, const QString &projectName) +void TrollProjectPart::openProject(const TQString &dirName, const TQString &projectName) { mainWindow()->statusBar()->message( i18n("Loading Project...") ); - QString defaultQtDir = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/root", ""); + TQString defaultQtDir = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/root", ""); if( !isQt4Project() && ( defaultQtDir.isEmpty() || !isValidQtDir( defaultQtDir ) ) ) { bool doask = true; while( doask ) { KURLRequesterDlg dlg( i18n("Choose Qt3 directory"), - i18n("Choose the Qt3 directory to use. This directory needs to have an include directory containing qt.h.") + i18n("Choose the Qt3 directory to use. This directory needs to have an include directory containing tqt.h.") , m_widget, 0); dlg.urlRequester() ->setMode( KFile::Directory | KFile::LocalOnly ); - dlg.urlRequester() ->setURL( QString::null ); + dlg.urlRequester() ->setURL( TQString::null ); dlg.urlRequester() ->completionObject() ->setDir( "/" ); - if ( dlg.exec() == QDialog::Accepted && !dlg.urlRequester() ->url().isEmpty() ) + if ( dlg.exec() == TQDialog::Accepted && !dlg.urlRequester() ->url().isEmpty() ) { - QString qtdir = dlg.urlRequester()->url(); + TQString qtdir = dlg.urlRequester()->url(); if( !isValidQtDir( qtdir ) ) { if( KMessageBox::warningYesNo( m_widget, @@ -313,7 +313,7 @@ void TrollProjectPart::openProject(const QString &dirName, const QString &projec "project might not work properly without one.\nPlease make " "sure you give a directory that contains a bin with the " "qmake binary in it and for Qt3 project also contains an " - "include directory with qt.h in it.\nDo you want to try " + "include directory with tqt.h in it.\nDo you want to try " "setting a Qt directory again?"), i18n("Wrong Qt directory given")) == KMessageBox::Yes @@ -342,7 +342,7 @@ void TrollProjectPart::openProject(const QString &dirName, const QString &projec } } } - QString qmakePath = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/qmake", ""); + TQString qmakePath = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/qmake", ""); if( qmakePath.isEmpty() || !isExecutable( qmakePath ) ) { bool doask = true; @@ -351,12 +351,12 @@ void TrollProjectPart::openProject(const QString &dirName, const QString &projec KURLRequesterDlg dlg( i18n("Choose QMake executable"), i18n("Choose the QMake binary to use. QMake is used to generate Makefiles from the project files."), m_widget, 0); dlg.urlRequester() ->setMode( KFile::Directory | KFile::LocalOnly ); - dlg.urlRequester() ->setURL( QString::null ); + dlg.urlRequester() ->setURL( TQString::null ); dlg.urlRequester() ->completionObject() ->setDir( "/" ); - if ( dlg.exec() == QDialog::Accepted && !dlg.urlRequester() ->url().isEmpty() ) + if ( dlg.exec() == TQDialog::Accepted && !dlg.urlRequester() ->url().isEmpty() ) { - QString qmake = dlg.urlRequester()->url(); + TQString qmake = dlg.urlRequester()->url(); if( !isExecutable( qmake ) ) { if( KMessageBox::warningYesNo( m_widget, @@ -399,7 +399,7 @@ void TrollProjectPart::openProject(const QString &dirName, const QString &projec m_widget->openProject(dirName); - QDomDocument &dom = *projectDom(); + TQDomDocument &dom = *projectDom(); // Set the default directory radio to "executable" if (DomUtil::readEntry(dom, "/kdevtrollproject/run/directoryradio") == "" ) { DomUtil::writeEntry(dom, "/kdevtrollproject/run/directoryradio", "executable"); @@ -415,18 +415,18 @@ void TrollProjectPart::closeProject() } -QString TrollProjectPart::projectDirectory() const +TQString TrollProjectPart::projectDirectory() const { return m_widget->projectDirectory(); } -QString TrollProjectPart::buildDirectory() const +TQString TrollProjectPart::buildDirectory() const { return m_widget->projectDirectory(); } -QString TrollProjectPart::projectName() const +TQString TrollProjectPart::projectName() const { return m_projectName; } @@ -468,27 +468,27 @@ void TrollProjectPart::slotBuildAndExecuteTarget() * if run/directoryradio == custom * The custom directory absolute path */ -QString TrollProjectPart::runDirectory() const +TQString TrollProjectPart::runDirectory() const { - QDomDocument &dom = *projectDom(); + TQDomDocument &dom = *projectDom(); - QString cwd; + TQString cwd; if( DomUtil::readBoolEntry(dom, "/kdevtrollproject/run/useglobalprogram", true) ) { cwd = defaultRunDirectory("kdevtrollproject"); }else { - QString name = m_widget->getCurrentOutputFilename(); + TQString name = m_widget->getCurrentOutputFilename(); if( name.findRev("/") != -1 ) name = name.right( name.length()-name.findRev("/")-1 ); cwd = DomUtil::readEntry( dom, "/kdevtrollproject/run/cwd/" + name ); } if( cwd.isEmpty() ) { - QString destpath = m_widget->getCurrentTarget(); - if( QDir::isRelativePath( destpath ) ) + TQString destpath = m_widget->getCurrentTarget(); + if( TQDir::isRelativePath( destpath ) ) { - destpath = m_widget->subprojectDirectory() + QString( QChar( QDir::separator() ) ) + destpath; + destpath = m_widget->subprojectDirectory() + TQString( TQChar( TQDir::separator() ) ) + destpath; } destpath = destpath.left( destpath.findRev("/") ); cwd = destpath; @@ -509,16 +509,16 @@ QString TrollProjectPart::runDirectory() const */ -QString TrollProjectPart::mainProgram() const +TQString TrollProjectPart::mainProgram() const { - QDomDocument &dom = *projectDom(); + TQDomDocument &dom = *projectDom(); if( DomUtil::readBoolEntry(dom, "/kdevtrollproject/run/useglobalprogram", false) ) { - QString DomMainProgram = DomUtil::readEntry(dom, "/kdevtrollproject/run/mainprogram"); + TQString DomMainProgram = DomUtil::readEntry(dom, "/kdevtrollproject/run/mainprogram"); - if ( DomMainProgram.isEmpty() ) return QString(); + if ( DomMainProgram.isEmpty() ) return TQString(); if ( DomMainProgram.startsWith("/") ) // assume absolute path { @@ -535,7 +535,7 @@ QString TrollProjectPart::mainProgram() const KMessageBox::error( m_widget, "There's no selected subproject!\n" "Unable to determine the main program", "No selected subproject found" ); kdDebug ( 9020 ) << k_funcinfo << "Error! : There's no active target! -> Unable to determine the main program in TrollProjectPart::mainProgram()" << endl; - return QString::null; + return TQString::null; } if ( m_widget->currentSubproject()->scope->variableValues("TEMPLATE").findIndex("app") == -1 ) @@ -545,19 +545,19 @@ QString TrollProjectPart::mainProgram() const "to be the selected subproject, set a main program under\n" "Project -> Project Options -> Run Options", "Selected subproject is not a library" ); kdDebug ( 9020 ) << k_funcinfo << "Error! : Active target isn't binary (" << m_widget->currentSubproject()->scope->variableValues("TEMPLATE").join(" ") << ") ! -> Unable to determine the main program in TrollProjectPart::mainProgram()" << endl; - return QString::null; + return TQString::null; } - QString destpath = m_widget->getCurrentTarget(); - if( QDir::isRelativePath( destpath ) ) + TQString destpath = m_widget->getCurrentTarget(); + if( TQDir::isRelativePath( destpath ) ) { - destpath = m_widget->subprojectDirectory() + QString( QChar( QDir::separator() ) ) + destpath; + destpath = m_widget->subprojectDirectory() + TQString( TQChar( TQDir::separator() ) ) + destpath; } return destpath; } } -QString TrollProjectPart::debugArguments() const +TQString TrollProjectPart::debugArguments() const { if( DomUtil::readBoolEntry(*projectDom(), "/kdevtrollproject/run/useglobalprogram", true ) ) { @@ -568,8 +568,8 @@ QString TrollProjectPart::debugArguments() const } } -/** Retuns a QString with the run command line arguments */ -QString TrollProjectPart::runArguments() const +/** Retuns a TQString with the run command line arguments */ +TQString TrollProjectPart::runArguments() const { if( DomUtil::readBoolEntry(*projectDom(), "/kdevtrollproject/run/useglobalprogram", true) ) { @@ -581,34 +581,34 @@ QString TrollProjectPart::runArguments() const } -QString TrollProjectPart::activeDirectory() const +TQString TrollProjectPart::activeDirectory() const { - QDomDocument &dom = *projectDom(); + TQDomDocument &dom = *projectDom(); return DomUtil::readEntry(dom, "/kdevtrollproject/general/activedir"); } -QStringList TrollProjectPart::allFiles() const +TQStringList TrollProjectPart::allFiles() const { return m_widget->allFiles(); } -void TrollProjectPart::addFile(const QString &fileName) +void TrollProjectPart::addFile(const TQString &fileName) { - QStringList fileList; + TQStringList fileList; fileList.append ( fileName ); - this->addFiles ( QStringList( fileName ) ); + this->addFiles ( TQStringList( fileName ) ); } -void TrollProjectPart::addFiles ( const QStringList &fileList ) +void TrollProjectPart::addFiles ( const TQStringList &fileList ) { - QStringList files = fileList; - for (QStringList::iterator it = files.begin(); it != files.end(); ++it) + TQStringList files = fileList; + for (TQStringList::iterator it = files.begin(); it != files.end(); ++it) { - if( !QFileInfo( *it ).isRelative() ) + if( !TQFileInfo( *it ).isRelative() ) { *it = URLUtil::relativePathToFile( projectDirectory(), *it ); } @@ -617,19 +617,19 @@ void TrollProjectPart::addFiles ( const QStringList &fileList ) } -void TrollProjectPart::removeFile(const QString & /* fileName */) +void TrollProjectPart::removeFile(const TQString & /* fileName */) { /// \FIXME -/* QStringList fileList; +/* TQStringList fileList; fileList.append ( fileName ); this->removeFiles ( fileList );*/ } -void TrollProjectPart::removeFiles ( const QStringList& fileList ) +void TrollProjectPart::removeFiles ( const TQStringList& fileList ) { /// \FIXME missing remove files functionality -// QStringList::ConstIterator it; +// TQStringList::ConstIterator it; // // it = fileList.begin(); // @@ -641,33 +641,33 @@ void TrollProjectPart::removeFiles ( const QStringList& fileList ) emit removedFilesFromProject ( fileList ); } /* -void TrollProjectPart::startMakeCommand(const QString &dir, const QString &target) +void TrollProjectPart::startMakeCommand(const TQString &dir, const TQString &target) { partController()->saveAllFiles(); - QFileInfo fi(dir + "/Makefile"); + TQFileInfo fi(dir + "/Makefile"); if (!fi.exists()) { - int r = KMessageBox::questionYesNo(m_widget, i18n("There is no Makefile in this directory. Run qmake first?"), QString::null, i18n("Run qmake"), i18n("Do Not Run")); + int r = KMessageBox::questionYesNo(m_widget, i18n("There is no Makefile in this directory. Run qmake first?"), TQString::null, i18n("Run qmake"), i18n("Do Not Run")); if (r == KMessageBox::No) return; startQMakeCommand(dir); } - QDomDocument &dom = *projectDom(); + TQDomDocument &dom = *projectDom(); if (target=="clean") { - QString cmdline = DomUtil::readEntry(dom, "/kdevtrollproject/make/makebin"); + TQString cmdline = DomUtil::readEntry(dom, "/kdevtrollproject/make/makebin"); if (cmdline.isEmpty()) cmdline = MAKE_COMMAND; cmdline += " clean"; - QString dircmd = "cd "; + TQString dircmd = "cd "; dircmd += dir; dircmd += " && "; cmdline.prepend(makeEnvironment()); makeFrontend()->queueCommand(dir, dircmd + cmdline); } - QString cmdline = DomUtil::readEntry(dom, "/kdevtrollproject/make/makebin"); + TQString cmdline = DomUtil::readEntry(dom, "/kdevtrollproject/make/makebin"); if (cmdline.isEmpty()) cmdline = MAKE_COMMAND; if (!DomUtil::readBoolEntry(dom, "/kdevtrollproject/make/abortonerror")) @@ -675,7 +675,7 @@ void TrollProjectPart::startMakeCommand(const QString &dir, const QString &targe int jobs = DomUtil::readIntEntry(dom, "/kdevtrollproject/make/numberofjobs"); if (jobs != 0) { cmdline += " -j"; - cmdline += QString::number(jobs); + cmdline += TQString::number(jobs); } if (DomUtil::readBoolEntry(dom, "/kdevtrollproject/make/dontact")) cmdline += " -n"; @@ -683,7 +683,7 @@ void TrollProjectPart::startMakeCommand(const QString &dir, const QString &targe cmdline += " "; cmdline += target; - QString dircmd = "cd "; + TQString dircmd = "cd "; dircmd += dir; dircmd += " && "; @@ -692,10 +692,10 @@ void TrollProjectPart::startMakeCommand(const QString &dir, const QString &targe } */ -void TrollProjectPart::startQMakeCommand(const QString &dir, bool recursive) +void TrollProjectPart::startQMakeCommand(const TQString &dir, bool recursive) { - QFileInfo fi(dir); - QString cmdline; + TQFileInfo fi(dir); + TQString cmdline; if ( isTMakeProject() ) { @@ -710,10 +710,10 @@ void TrollProjectPart::startQMakeCommand(const QString &dir, bool recursive) cmdline += " -recursive "; } - //QString cmdline = QString::fromLatin1( isTMakeProject() ? "tmake " : "qmake " ); + //TQString cmdline = TQString::fromLatin1( isTMakeProject() ? "tmake " : "qmake " ); // cmdline += fi.baseName() + ".pro"; - QDir d(dir); - QStringList l = d.entryList("*.pro"); + TQDir d(dir); + TQStringList l = d.entryList("*.pro"); if( l.isEmpty() || ( l.count() && l.findIndex( projectName() + ".pro" ) != -1 ) ) cmdline += projectName()+".pro"; @@ -722,9 +722,9 @@ void TrollProjectPart::startQMakeCommand(const QString &dir, bool recursive) else cmdline += l[0]; -// cmdline += QString::fromLatin1( " -o Makefile" ); +// cmdline += TQString::fromLatin1( " -o Makefile" ); - QString dircmd = "cd "; + TQString dircmd = "cd "; dircmd += KProcess::quote(dir); dircmd += " && "; @@ -732,28 +732,28 @@ void TrollProjectPart::startQMakeCommand(const QString &dir, bool recursive) makeFrontend()->queueCommand(dir, dircmd + cmdline); } -void TrollProjectPart::queueCmd(const QString &dir, const QString &cmd) +void TrollProjectPart::queueCmd(const TQString &dir, const TQString &cmd) { makeFrontend()->queueCommand(dir, cmd); } -void TrollProjectPart::slotCommandFinished( const QString& command ) +void TrollProjectPart::slotCommandFinished( const TQString& command ) { Q_UNUSED( command ); // if( m_buildCommand != command ) // return; // -// m_buildCommand = QString::null; +// m_buildCommand = TQString::null; m_timestamp.clear(); - QStringList fileList = allFiles(); - QStringList::Iterator it = fileList.begin(); + TQStringList fileList = allFiles(); + TQStringList::Iterator it = fileList.begin(); while( it != fileList.end() ){ - QString fileName = *it; + TQString fileName = *it; ++it; - m_timestamp[ fileName ] = QFileInfo( projectDirectory(), fileName ).lastModified(); + m_timestamp[ fileName ] = TQFileInfo( projectDirectory(), fileName ).lastModified(); } emit projectCompiled(); @@ -772,14 +772,14 @@ void TrollProjectPart::slotCommandFinished( const QString& command ) bool TrollProjectPart::isDirty() { - QStringList fileList = allFiles(); - QStringList::Iterator it = fileList.begin(); + TQStringList fileList = allFiles(); + TQStringList::Iterator it = fileList.begin(); while( it != fileList.end() ){ - QString fileName = *it; + TQString fileName = *it; ++it; - QMap<QString, QDateTime>::Iterator it = m_timestamp.find( fileName ); - QDateTime t = QFileInfo( projectDirectory(), fileName ).lastModified(); + TQMap<TQString, TQDateTime>::Iterator it = m_timestamp.find( fileName ); + TQDateTime t = TQFileInfo( projectDirectory(), fileName ).lastModified(); if( it == m_timestamp.end() || *it != t ){ return true; } @@ -793,46 +793,46 @@ KDevProject::Options TrollProjectPart::options( ) const return UsesQMakeBuildSystem; } -bool TrollProjectPart::isValidQtDir( const QString& path ) const +bool TrollProjectPart::isValidQtDir( const TQString& path ) const { - QFileInfo inc( path + QString( QChar( QDir::separator() ) )+ - "include"+QString( QChar( QDir::separator() ) )+ - "qt.h" ); + TQFileInfo inc( path + TQString( TQChar( TQDir::separator() ) )+ + "include"+TQString( TQChar( TQDir::separator() ) )+ + "tqt.h" ); return ( isQt4Project() || ( !isQt4Project() && inc.exists() ) ); } -void TrollProjectPart::buildBinDirs( QStringList & dirs ) const +void TrollProjectPart::buildBinDirs( TQStringList & dirs ) const { if( !isQt4Project() ) { - QString m_defaultQtDir = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/root", ""); + TQString m_defaultQtDir = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/root", ""); if( !m_defaultQtDir.isEmpty() ) - dirs << (m_defaultQtDir + QString( QChar( QDir::separator() ) ) + "bin" ); - dirs << ( ::getenv("QTDIR") + QString( QChar( QDir::separator() ) ) + "bin" ); + dirs << (m_defaultQtDir + TQString( TQChar( TQDir::separator() ) ) + "bin" ); + dirs << ( ::getenv("QTDIR") + TQString( TQChar( TQDir::separator() ) ) + "bin" ); } - QStringList paths = QStringList::split(":",::getenv("PATH")); + TQStringList paths = TQStringList::split(":",::getenv("PATH")); dirs += paths; - QString binpath = QDir::rootDirPath() + "bin"; + TQString binpath = TQDir::rootDirPath() + "bin"; if( dirs.findIndex( binpath ) != -1 ) dirs << binpath; - binpath = QDir::rootDirPath() + "usr" + QString( QChar( QDir::separator() ) ) + "bin"; + binpath = TQDir::rootDirPath() + "usr" + TQString( TQChar( TQDir::separator() ) ) + "bin"; if( dirs.findIndex( binpath ) != -1 ) dirs << binpath; - binpath = QDir::rootDirPath() + "usr" + QString( QChar( QDir::separator() ) ) + "local" + QString( QChar( QDir::separator() ) ) + "bin"; + binpath = TQDir::rootDirPath() + "usr" + TQString( TQChar( TQDir::separator() ) ) + "local" + TQString( TQChar( TQDir::separator() ) ) + "bin"; if( dirs.findIndex( binpath ) != -1 ) dirs << binpath; } -QString TrollProjectPart::findExecutable( const QString& execname ) const +TQString TrollProjectPart::findExecutable( const TQString& execname ) const { - QStringList dirs; + TQStringList dirs; buildBinDirs( dirs ); - for( QStringList::Iterator it=dirs.begin(); it!=dirs.end(); ++it ) + for( TQStringList::Iterator it=dirs.begin(); it!=dirs.end(); ++it ) { - QString designer = *it + QString( QChar( QDir::separator() ) ) + execname; + TQString designer = *it + TQString( TQChar( TQDir::separator() ) ) + execname; if( !designer.isEmpty() && isExecutable( designer ) ) { return designer; @@ -841,26 +841,26 @@ QString TrollProjectPart::findExecutable( const QString& execname ) const return ""; } -bool TrollProjectPart::isExecutable( const QString& path ) const +bool TrollProjectPart::isExecutable( const TQString& path ) const { - QFileInfo fi(path); + TQFileInfo fi(path); return( fi.exists() && fi.isExecutable() ); } -QString TrollProjectPart::findQtDir() +TQString TrollProjectPart::findQtDir() { - QStringList qtdirs; + TQStringList qtdirs; if( !isQt4Project() ) qtdirs.push_back( ::getenv("QTDIR") ); - qtdirs.push_back( QDir::rootDirPath()+"usr"+QString( QChar( QDir::separator() ) )+"lib"+QString( QChar( QDir::separator() ) )+"qt"+QString("%1").arg( DomUtil::readEntry( *projectDom(), "/kdevcppsupport/qt/version", "3") ) ); - qtdirs.push_back( QDir::rootDirPath()+"usr"+QString( QChar( QDir::separator() ) )+"lib"+QString( QChar( QDir::separator() ) )+"qt"+QString( QChar( QDir::separator() ) )+QString("%1").arg( DomUtil::readEntry( *projectDom(), "/kdevcppsupport/qt/version", "3") ) ); - qtdirs.push_back( QDir::rootDirPath()+"usr"+QString( QChar( QDir::separator() ) )+"share"+QString( QChar( QDir::separator() ) )+"qt"+QString("%1").arg( DomUtil::readEntry( *projectDom(), "/kdevcppsupport/qt/version", "3") ) ); - qtdirs.push_back( QDir::rootDirPath()+"usr" ); - qtdirs.push_back( QDir::rootDirPath()+"usr"+QString( QChar( QDir::separator() ) )+"lib"+QString( QChar( QDir::separator() ) )+"qt" ); + qtdirs.push_back( TQDir::rootDirPath()+"usr"+TQString( TQChar( TQDir::separator() ) )+"lib"+TQString( TQChar( TQDir::separator() ) )+"qt"+TQString("%1").arg( DomUtil::readEntry( *projectDom(), "/kdevcppsupport/qt/version", "3") ) ); + qtdirs.push_back( TQDir::rootDirPath()+"usr"+TQString( TQChar( TQDir::separator() ) )+"lib"+TQString( TQChar( TQDir::separator() ) )+"qt"+TQString( TQChar( TQDir::separator() ) )+TQString("%1").arg( DomUtil::readEntry( *projectDom(), "/kdevcppsupport/qt/version", "3") ) ); + qtdirs.push_back( TQDir::rootDirPath()+"usr"+TQString( TQChar( TQDir::separator() ) )+"share"+TQString( TQChar( TQDir::separator() ) )+"qt"+TQString("%1").arg( DomUtil::readEntry( *projectDom(), "/kdevcppsupport/qt/version", "3") ) ); + qtdirs.push_back( TQDir::rootDirPath()+"usr" ); + qtdirs.push_back( TQDir::rootDirPath()+"usr"+TQString( TQChar( TQDir::separator() ) )+"lib"+TQString( TQChar( TQDir::separator() ) )+"qt" ); - for( QStringList::Iterator it=qtdirs.begin(); it!=qtdirs.end(); ++it ) + for( TQStringList::Iterator it=qtdirs.begin(); it!=qtdirs.end(); ++it ) { - QString qtdir = *it; + TQString qtdir = *it; if( !qtdir.isEmpty() && isValidQtDir(qtdir) ) { return qtdir; @@ -870,25 +870,25 @@ QString TrollProjectPart::findQtDir() } -QStringList recursiveProFind( const QString &currDir, const QString &baseDir ) +TQStringList recursiveProFind( const TQString &currDir, const TQString &baseDir ) { - QStringList fileList; + TQStringList fileList; - if( !currDir.contains( QString( QChar ( QDir::separator() ) ) +".." ) - && !currDir.contains( QString( QChar( QDir::separator() ) )+".") ) + if( !currDir.contains( TQString( TQChar ( TQDir::separator() ) ) +".." ) + && !currDir.contains( TQString( TQChar( TQDir::separator() ) )+".") ) { - QDir dir(currDir); - QStringList dirList = dir.entryList(QDir::Dirs ); - QStringList::Iterator idx = dirList.begin(); + TQDir dir(currDir); + TQStringList dirList = dir.entryList(TQDir::Dirs ); + TQStringList::Iterator idx = dirList.begin(); for( ; idx != dirList.end(); ++idx ) { - fileList += recursiveProFind( currDir + QString( QChar( QDir::separator() ) ) + (*idx),baseDir ); + fileList += recursiveProFind( currDir + TQString( TQChar( TQDir::separator() ) ) + (*idx),baseDir ); } - QStringList newFiles = dir.entryList("*.pro *.PRO"); + TQStringList newFiles = dir.entryList("*.pro *.PRO"); idx = newFiles.begin(); for( ; idx != newFiles.end(); ++idx ) { - QString file = currDir + QString( QChar( QDir::separator() ) ) + (*idx); + TQString file = currDir + TQString( TQChar( TQDir::separator() ) ) + (*idx); fileList.append( file.remove( baseDir ) ); } } @@ -900,12 +900,12 @@ QStringList recursiveProFind( const QString &currDir, const QString &baseDir ) /*! \fn TrollProjectPart::distFiles() const */ -QStringList TrollProjectPart::distFiles() const +TQStringList TrollProjectPart::distFiles() const { - QStringList sourceList = allFiles(); + TQStringList sourceList = allFiles(); // Scan current source directory for any .pro files. - QString projectDir = projectDirectory(); - QStringList files = recursiveProFind( projectDir, projectDir + QString( QChar( QDir::separator() ) ) ); + TQString projectDir = projectDirectory(); + TQStringList files = recursiveProFind( projectDir, projectDir + TQString( TQChar( TQDir::separator() ) ) ); return sourceList + files; } |