diff options
Diffstat (limited to 'buildtools/ada/adaproject_part.cpp')
-rw-r--r-- | buildtools/ada/adaproject_part.cpp | 180 |
1 files changed, 90 insertions, 90 deletions
diff --git a/buildtools/ada/adaproject_part.cpp b/buildtools/ada/adaproject_part.cpp index 33ba166b..f226809d 100644 --- a/buildtools/ada/adaproject_part.cpp +++ b/buildtools/ada/adaproject_part.cpp @@ -8,12 +8,12 @@ */ #include "adaproject_part.h" -#include <qdom.h> -#include <qfileinfo.h> -#include <qdir.h> -#include <qvaluestack.h> -#include <qregexp.h> -#include <qvbox.h> +#include <tqdom.h> +#include <tqfileinfo.h> +#include <tqdir.h> +#include <tqvaluestack.h> +#include <tqregexp.h> +#include <tqvbox.h> #include <kiconloader.h> #include <klocale.h> @@ -46,7 +46,7 @@ typedef KDevGenericFactory<AdaProjectPart> AdaProjectFactory; static const KDevPluginInfo data("kdevadaproject"); K_EXPORT_COMPONENT_FACTORY( libkdevadaproject, AdaProjectFactory( data ) ) -AdaProjectPart::AdaProjectPart(QObject *parent, const char *name, const QStringList& ) +AdaProjectPart::AdaProjectPart(TQObject *parent, const char *name, const TQStringList& ) :KDevBuildTool(&data, parent, name ? name : "AdaProjectPart" ) { setInstance(AdaProjectFactory::instance()); @@ -54,21 +54,21 @@ AdaProjectPart::AdaProjectPart(QObject *parent, const char *name, const QStringL KAction *action; action = new KAction( i18n("&Build Project"), "make_kdevelop", Key_F8, - this, SLOT(slotBuild()), + this, TQT_SLOT(slotBuild()), actionCollection(), "build_build" ); action = new KAction( i18n("Execute Program"), "exec", 0, - this, SLOT(slotExecute()), + this, TQT_SLOT(slotExecute()), actionCollection(), "build_execute" ); - connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)), - this, SLOT(projectConfigWidget(KDialogBase*)) ); + connect( core(), TQT_SIGNAL(projectConfigWidget(KDialogBase*)), + this, TQT_SLOT(projectConfigWidget(KDialogBase*)) ); - connect( core(), SIGNAL(configWidget(KDialogBase*)), - this, SLOT(configWidget(KDialogBase*)) ); + connect( core(), TQT_SIGNAL(configWidget(KDialogBase*)), + this, TQT_SLOT(configWidget(KDialogBase*)) ); // m_widget = new AdaProjectWidget(this); -// QWhatsThis::add(m_widget, i18n("WHAT DOES THIS PART DO?")); +// TQWhatsThis::add(m_widget, i18n("WHAT DOES THIS PART DO?")); // now you decide what should happen to the widget. Take a look at kdevcore.h // or at other plugins how to embed it. @@ -89,11 +89,11 @@ AdaProjectPart::~AdaProjectPart() * This should really be merged with FileTreeWidget::matchesHidePattern() * and put in its own class. Currently this is repeated in scriptprojectpart.cpp, pascalproject_part.cpp, adaproject_part.cpp */ -static bool matchesPattern(const QString &fileName, const QStringList &patternList) +static bool matchesPattern(const TQString &fileName, const TQStringList &patternList) { - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = patternList.begin(); it != patternList.end(); ++it) { - QRegExp re(*it, true, true); + TQRegExp re(*it, true, true); if (re.search(fileName) == 0 && re.matchedLength() == (int)fileName.length()) return true; } @@ -101,13 +101,13 @@ static bool matchesPattern(const QString &fileName, const QStringList &patternLi return false; } -void AdaProjectPart::openProject(const QString &dirName, const QString &projectName) +void AdaProjectPart::openProject(const TQString &dirName, const TQString &projectName) { m_buildDir = dirName; m_projectDir = dirName; m_projectName = projectName; - QDomDocument &dom = *projectDom(); + TQDomDocument &dom = *projectDom(); // Set the default directory radio to "executable" if (DomUtil::readEntry(dom, "/kdevadaproject/run/directoryradio") == "" ) { DomUtil::writeEntry(dom, "/kdevadaproject/run/directoryradio", "executable"); @@ -116,11 +116,11 @@ void AdaProjectPart::openProject(const QString &dirName, const QString &projectN loadProjectConfig(); // Put all files from all subdirectories into file list - QValueStack<QString> s; + TQValueStack<TQString> s; int prefixlen = m_projectDir.length()+1; s.push(m_projectDir); - QStringList includepatternList; + TQStringList includepatternList; if ( languageSupport() ) { @@ -132,10 +132,10 @@ void AdaProjectPart::openProject(const QString &dirName, const QString &projectN } } - QString excludepatterns = "*~"; - QStringList excludepatternList = QStringList::split(",", excludepatterns); + TQString excludepatterns = "*~"; + TQStringList excludepatternList = TQStringList::split(",", excludepatterns); - QDir dir; + TQDir dir; do { dir.setPath(s.pop()); kdDebug() << "AdaProjectPart::openProject examining: " << dir.path() << endl; @@ -143,12 +143,12 @@ void AdaProjectPart::openProject(const QString &dirName, const QString &projectN if( !dirEntries ) break; - QPtrListIterator<QFileInfo> it(*dirEntries); + TQPtrListIterator<TQFileInfo> it(*dirEntries); for (; it.current(); ++it) { - QString fileName = it.current()->fileName(); + TQString fileName = it.current()->fileName(); if (fileName == "." || fileName == "..") continue; - QString path = it.current()->absFilePath(); + TQString path = it.current()->absFilePath(); if (it.current()->isDir()) { kdDebug() << "AdaProjectPart::openProject pushing: " << path << endl; s.push(path); @@ -188,9 +188,9 @@ DomUtil::PairList AdaProjectPart::runEnvironmentVars() const * if run/directoryradio == custom * The custom directory absolute path */ -QString AdaProjectPart::runDirectory() const +TQString AdaProjectPart::runDirectory() const { - QString cwd = defaultRunDirectory("kdevadaproject"); + TQString cwd = defaultRunDirectory("kdevadaproject"); if (cwd.isEmpty()) cwd = buildDirectory(); return cwd; @@ -206,15 +206,15 @@ QString AdaProjectPart::runDirectory() const * if run/directoryradio == custom or relative == false * The absolute path to executable */ -QString AdaProjectPart::mainProgram() const +TQString AdaProjectPart::mainProgram() const { - QDomDocument * dom = projectDom(); + TQDomDocument * dom = projectDom(); - if ( !dom ) return QString(); + if ( !dom ) return TQString(); - QString DomMainProgram = DomUtil::readEntry( *dom, "/kdevadaproject/run/mainprogram"); + TQString DomMainProgram = DomUtil::readEntry( *dom, "/kdevadaproject/run/mainprogram"); - if ( DomMainProgram.isEmpty() ) return QString(); + if ( DomMainProgram.isEmpty() ) return TQString(); if ( DomMainProgram.startsWith("/") ) // assume absolute path { @@ -225,68 +225,68 @@ QString AdaProjectPart::mainProgram() const return projectDirectory() + "/" + DomMainProgram; } - return QString(); + return TQString(); } -/** Retuns a QString with the run command line arguments */ -QString AdaProjectPart::debugArguments() const +/** Retuns a TQString with the run command line arguments */ +TQString AdaProjectPart::debugArguments() const { return DomUtil::readEntry(*projectDom(), "/kdevadaproject/run/globaldebugarguments"); } -/** Retuns a QString with the run command line arguments */ -QString AdaProjectPart::runArguments() const +/** Retuns a TQString with the run command line arguments */ +TQString AdaProjectPart::runArguments() const { return DomUtil::readEntry(*projectDom(), "/kdevadaproject/run/programargs"); } -QString AdaProjectPart::mainSource() const +TQString AdaProjectPart::mainSource() const { return projectDirectory() + "/" + m_mainSource; } -void AdaProjectPart::setMainSource(QString fullPath) +void AdaProjectPart::setMainSource(TQString fullPath) { - QString olddir = activeDirectory(); - m_mainSource = fullPath.replace(QRegExp(QString(projectDirectory() + QString("/"))),""); + TQString olddir = activeDirectory(); + m_mainSource = fullPath.replace(TQRegExp(TQString(projectDirectory() + TQString("/"))),""); emit activeDirectoryChanged( olddir, activeDirectory() ); } -QString AdaProjectPart::projectDirectory() const +TQString AdaProjectPart::projectDirectory() const { return m_projectDir; } -QString AdaProjectPart::projectName() const +TQString AdaProjectPart::projectName() const { return m_projectName; } -QString AdaProjectPart::activeDirectory() const +TQString AdaProjectPart::activeDirectory() const { - QFileInfo fi(mainSource()); - return fi.dirPath(true).replace(QRegExp(projectDirectory()),""); + TQFileInfo fi(mainSource()); + return fi.dirPath(true).replace(TQRegExp(projectDirectory()),""); } -QString AdaProjectPart::buildDirectory() const +TQString AdaProjectPart::buildDirectory() const { - QFileInfo fi(mainSource()); + TQFileInfo fi(mainSource()); return fi.dirPath(true); } -void AdaProjectPart::listOfFiles(QStringList &result, QString path) const +void AdaProjectPart::listOfFiles(TQStringList &result, TQString path) const { - QDir d(path); + TQDir d(path); if (!d.exists()) return; - const QFileInfoList *entries = d.entryInfoList(QDir::Dirs | QDir::Files | QDir::Hidden); + const QFileInfoList *entries = d.entryInfoList(TQDir::Dirs | TQDir::Files | TQDir::Hidden); if( !entries ) return; QFileInfoListIterator it( *entries ); - while( const QFileInfo* fileInfo = it.current() ) + while( const TQFileInfo* fileInfo = it.current() ) { ++it; @@ -303,9 +303,9 @@ void AdaProjectPart::listOfFiles(QStringList &result, QString path) const } } -QStringList AdaProjectPart::allFiles() const +TQStringList AdaProjectPart::allFiles() const { -// QStringList files; +// TQStringList files; // listOfFiles(files, projectDirectory()); @@ -313,19 +313,19 @@ QStringList AdaProjectPart::allFiles() const return m_sourceFiles; } -void AdaProjectPart::addFile(const QString& /*fileName*/) +void AdaProjectPart::addFile(const TQString& /*fileName*/) { } -void AdaProjectPart::addFiles(const QStringList& /*fileList*/) +void AdaProjectPart::addFiles(const TQStringList& /*fileList*/) { } -void AdaProjectPart::removeFile(const QString& /*fileName*/) +void AdaProjectPart::removeFile(const TQString& /*fileName*/) { } -void AdaProjectPart::removeFiles(const QStringList& /*fileList*/) +void AdaProjectPart::removeFiles(const TQStringList& /*fileList*/) { } @@ -334,7 +334,7 @@ void AdaProjectPart::slotBuild() if (partController()->saveAllFiles()==false) return; //user cancelled - QString cmdline = m_compilerExec + " " + m_compilerOpts + " "; + TQString cmdline = m_compilerExec + " " + m_compilerOpts + " "; if (cmdline.isEmpty()) { @@ -342,10 +342,10 @@ void AdaProjectPart::slotBuild() return; } - QFileInfo fi(mainSource()); + TQFileInfo fi(mainSource()); cmdline += fi.fileName(); - QString dircmd = "cd "; + TQString dircmd = "cd "; dircmd += KProcess::quote(buildDirectory()); dircmd += " && "; @@ -355,42 +355,42 @@ void AdaProjectPart::slotBuild() void AdaProjectPart::slotExecute() { partController()->saveAllFiles(); - QString program = "./"; + TQString program = "./"; appFrontend()->startAppCommand(buildDirectory(), mainProgram(), true); } -void AdaProjectPart::changedFiles( const QStringList & fileList ) +void AdaProjectPart::changedFiles( const TQStringList & fileList ) { KDevProject::changedFiles(fileList); } -void AdaProjectPart::changedFile( const QString & fileName ) +void AdaProjectPart::changedFile( const TQString & fileName ) { KDevProject::changedFile(fileName); } void AdaProjectPart::projectConfigWidget( KDialogBase * dlg ) { - QVBox *vbox; + TQVBox *vbox; vbox = dlg->addVBoxPage(i18n("Ada Compiler")); AdaProjectOptionsDlg *w = new AdaProjectOptionsDlg(this, vbox); - connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) ); - connect( dlg, SIGNAL(okClicked()), this, SLOT(loadProjectConfig()) ); + connect( dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(accept()) ); + connect( dlg, TQT_SIGNAL(okClicked()), this, TQT_SLOT(loadProjectConfig()) ); } void AdaProjectPart::loadProjectConfig( ) { - QDomDocument &dom = *(projectDom()); + TQDomDocument &dom = *(projectDom()); - QString config = DomUtil::readEntry(dom, "/kdevadaproject/general/useconfiguration", "default"); - m_mainSource = DomUtil::readEntry(dom, QString("/kdevadaproject/configurations/") + config + QString("/mainsource") ); - m_compilerOpts = DomUtil::readEntry(dom, QString("/kdevadaproject/configurations/") + config + QString("/compileroptions")); - m_compilerExec = DomUtil::readEntry(dom, QString("/kdevadaproject/configurations/") + config + QString("/compilerexec")); + TQString config = DomUtil::readEntry(dom, "/kdevadaproject/general/useconfiguration", "default"); + m_mainSource = DomUtil::readEntry(dom, TQString("/kdevadaproject/configurations/") + config + TQString("/mainsource") ); + m_compilerOpts = DomUtil::readEntry(dom, TQString("/kdevadaproject/configurations/") + config + TQString("/compileroptions")); + m_compilerExec = DomUtil::readEntry(dom, TQString("/kdevadaproject/configurations/") + config + TQString("/compilerexec")); if (m_compilerExec.isEmpty()) { KTrader::OfferList offers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'Ada'"); - QValueList<KService::Ptr>::ConstIterator it; + TQValueList<KService::Ptr>::ConstIterator it; for (it = offers.begin(); it != offers.end(); ++it) { if ((*it)->property("X-KDevelop-Default").toBool()) { m_compilerExec = (*it)->exec(); @@ -402,13 +402,13 @@ void AdaProjectPart::loadProjectConfig( ) void AdaProjectPart::configWidget( KDialogBase * dlg ) { - QVBox *vbox; + TQVBox *vbox; vbox = dlg->addVBoxPage(i18n("Ada Compiler")); AdaGlobalOptionsDlg *w = new AdaGlobalOptionsDlg(this, vbox); - connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) ); + connect( dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(accept()) ); } -KDevCompilerOptions *AdaProjectPart::createCompilerOptions(const QString &name) +KDevCompilerOptions *AdaProjectPart::createCompilerOptions(const TQString &name) { KService::Ptr service = KService::serviceByDesktopName(name); if (!service) { @@ -416,20 +416,20 @@ KDevCompilerOptions *AdaProjectPart::createCompilerOptions(const QString &name) return 0; } - KLibFactory *factory = KLibLoader::self()->factory(QFile::encodeName(service->library())); + KLibFactory *factory = KLibLoader::self()->factory(TQFile::encodeName(service->library())); if (!factory) { - QString errorMessage = KLibLoader::self()->lastErrorMessage(); + TQString errorMessage = KLibLoader::self()->lastErrorMessage(); KMessageBox::error(0, i18n("There was an error loading the module %1.\n" "The diagnostics are:\n%2").arg(service->name()).arg(errorMessage)); exit(1); } - QStringList args; - QVariant prop = service->property("X-KDevelop-Args"); + TQStringList args; + TQVariant prop = service->property("X-KDevelop-Args"); if (prop.isValid()) - args = QStringList::split(" ", prop.toString()); + args = TQStringList::split(" ", prop.toString()); - QObject *obj = factory->create(this, service->name().latin1(), + TQObject *obj = factory->create(this, service->name().latin1(), "KDevCompilerOptions", args); if (!obj->inherits("KDevCompilerOptions")) { @@ -441,7 +441,7 @@ KDevCompilerOptions *AdaProjectPart::createCompilerOptions(const QString &name) return dlg; } -QString AdaProjectPart::defaultOptions( const QString compiler ) +TQString AdaProjectPart::defaultOptions( const TQString compiler ) { KConfig *config = KGlobal::config(); config->setGroup("Ada Compiler"); @@ -454,12 +454,12 @@ QString AdaProjectPart::defaultOptions( const QString compiler ) /*! \fn AdaProjectPart::distFiles() const */ -QStringList AdaProjectPart::distFiles() const +TQStringList AdaProjectPart::distFiles() const { - QStringList sourceList = allFiles(); + TQStringList sourceList = allFiles(); // Scan current source directory for any .pro files. - QString projectDir = projectDirectory(); - QDir dir(projectDir); - QStringList files = dir.entryList( "Makefile"); + TQString projectDir = projectDirectory(); + TQDir dir(projectDir); + TQStringList files = dir.entryList( "Makefile"); return sourceList + files; } |