summaryrefslogtreecommitdiffstats
path: root/buildtools/script/scriptprojectpart.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'buildtools/script/scriptprojectpart.cpp')
-rw-r--r--buildtools/script/scriptprojectpart.cpp156
1 files changed, 78 insertions, 78 deletions
diff --git a/buildtools/script/scriptprojectpart.cpp b/buildtools/script/scriptprojectpart.cpp
index ff560f23..2bc19135 100644
--- a/buildtools/script/scriptprojectpart.cpp
+++ b/buildtools/script/scriptprojectpart.cpp
@@ -11,12 +11,12 @@
#include "scriptprojectpart.h"
-#include <qdir.h>
-#include <qregexp.h>
-#include <qstringlist.h>
-#include <qvaluestack.h>
-#include <qvbox.h>
-#include <qwhatsthis.h>
+#include <tqdir.h>
+#include <tqregexp.h>
+#include <tqstringlist.h>
+#include <tqvaluestack.h>
+#include <tqvbox.h>
+#include <tqwhatsthis.h>
#include <kaction.h>
#include <kdebug.h>
#include <kdialogbase.h>
@@ -40,7 +40,7 @@ typedef KDevGenericFactory<ScriptProjectPart> ScriptProjectFactory;
static const KDevPluginInfo data("kdevscriptproject");
K_EXPORT_COMPONENT_FACTORY( libkdevscriptproject, ScriptProjectFactory( data ) )
-ScriptProjectPart::ScriptProjectPart(QObject *parent, const char *name, const QStringList &)
+ScriptProjectPart::ScriptProjectPart(TQObject *parent, const char *name, const TQStringList &)
: KDevBuildTool(&data, parent, name ? name : "ScriptProjectPart")
{
setInstance(ScriptProjectFactory::instance());
@@ -51,17 +51,17 @@ ScriptProjectPart::ScriptProjectPart(QObject *parent, const char *name, const QS
if (!extension<KDevCreateFile>("KDevelop/CreateFile")) {
KAction *action;
action = new KAction( i18n("New File..."), 0,
- this, SLOT(slotNewFile()),
+ this, TQT_SLOT(slotNewFile()),
actionCollection(), "file_newfile" );
action->setWhatsThis( i18n("<b>New file</b><p>Creates a new file.") );
action->setToolTip( i18n("Create a new file") );
}
new KAction( i18n("Rescan Project"), 0, CTRL+ALT+Key_R,
- this, SLOT(rescan()),
+ this, TQT_SLOT(rescan()),
actionCollection(), "rescan" );
- connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
- this, SLOT(projectConfigWidget(KDialogBase*)) );
+ connect( core(), TQT_SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, TQT_SLOT(projectConfigWidget(KDialogBase*)) );
}
@@ -71,10 +71,10 @@ ScriptProjectPart::~ScriptProjectPart()
void ScriptProjectPart::projectConfigWidget(KDialogBase *dlg)
{
- QVBox *vbox;
+ TQVBox *vbox;
vbox = dlg->addVBoxPage(i18n("Script Project Options"), i18n("Script Project Options"), BarIcon("kdevelop", KIcon::SizeMedium));
ScriptOptionsWidget *w = new ScriptOptionsWidget(this, vbox);
- connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+ connect( dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(accept()) );
}
@@ -82,11 +82,11 @@ void ScriptProjectPart::projectConfigWidget(KDialogBase *dlg)
* @todo 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;
}
@@ -95,7 +95,7 @@ static bool matchesPattern(const QString &fileName, const QStringList &patternLi
}
-void ScriptProjectPart::openProject(const QString &dirName, const QString &projectName)
+void ScriptProjectPart::openProject(const TQString &dirName, const TQString &projectName)
{
if (!languageSupport())
kdDebug(9015) << "ScriptProjectPart::openProject: no language support found!" << endl;
@@ -103,7 +103,7 @@ void ScriptProjectPart::openProject(const QString &dirName, const QString &proje
m_projectDirectory = dirName;
m_projectName = projectName;
- QDomDocument &dom = *projectDom();
+ TQDomDocument &dom = *projectDom();
// Set the default directory radio to "executable"
if (DomUtil::readEntry(dom, "/kdevscriptproject/run/directoryradio") == "" ) {
@@ -111,28 +111,28 @@ void ScriptProjectPart::openProject(const QString &dirName, const QString &proje
}
// Put all files from all subdirectories into file list
- QValueStack<QString> s;
+ TQValueStack<TQString> s;
int prefixlen = m_projectDirectory.length()+1;
s.push(m_projectDirectory);
- QDir dir;
+ TQDir dir;
do {
dir.setPath(s.pop());
kdDebug(9015) << "Examining: " << dir.path() << endl;
const QFileInfoList *dirEntries = dir.entryInfoList();
if ( dirEntries )
{
- 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()) {
//do not follow symlinks which point to the themselves
if (it.current()->isSymLink())
{
- QString symLink = it.current()->readLink();
+ TQString symLink = it.current()->readLink();
if ((symLink == path) || (symLink == "./"))
continue;
} else if (canAddDirectoryToProject(path)) {
@@ -157,18 +157,18 @@ void ScriptProjectPart::closeProject()
}
-QString ScriptProjectPart::projectDirectory() const
+TQString ScriptProjectPart::projectDirectory() const
{
return m_projectDirectory;
}
-QString ScriptProjectPart::buildDirectory() const
+TQString ScriptProjectPart::buildDirectory() const
{
return m_projectDirectory;
}
-QString ScriptProjectPart::projectName() const
+TQString ScriptProjectPart::projectName() const
{
return m_projectName;
}
@@ -190,9 +190,9 @@ DomUtil::PairList ScriptProjectPart::runEnvironmentVars() const
* if run/directoryradio == custom
* The custom directory absolute path
*/
-QString ScriptProjectPart::runDirectory() const
+TQString ScriptProjectPart::runDirectory() const
{
- QString cwd = defaultRunDirectory("kdevscriptproject");
+ TQString cwd = defaultRunDirectory("kdevscriptproject");
if (cwd.isEmpty())
cwd = buildDirectory();
return cwd;
@@ -208,15 +208,15 @@ QString ScriptProjectPart::runDirectory() const
* if run/directoryradio == custom or relative == false
* The absolute path to executable
*/
-QString ScriptProjectPart::mainProgram() const
+TQString ScriptProjectPart::mainProgram() const
{
- QDomDocument * dom = projectDom();
+ TQDomDocument * dom = projectDom();
- if ( !dom ) return QString();
+ if ( !dom ) return TQString();
- QString DomMainProgram = DomUtil::readEntry( *dom, "/kdevscriptproject/run/mainprogram");
+ TQString DomMainProgram = DomUtil::readEntry( *dom, "/kdevscriptproject/run/mainprogram");
- if ( DomMainProgram.isEmpty() ) return QString();
+ if ( DomMainProgram.isEmpty() ) return TQString();
if ( DomMainProgram.startsWith("/") ) // assume absolute path
{
@@ -227,36 +227,36 @@ QString ScriptProjectPart::mainProgram() const
return projectDirectory() + "/" + DomMainProgram;
}
- return QString();
+ return TQString();
}
-/** Retuns a QString with the debug command line arguments */
-QString ScriptProjectPart::debugArguments() const
+/** Retuns a TQString with the debug command line arguments */
+TQString ScriptProjectPart::debugArguments() const
{
return DomUtil::readEntry(*projectDom(), "/kdevscriptproject/run/globaldebugarguments");
}
-/** Retuns a QString with the run command line arguments */
-QString ScriptProjectPart::runArguments() const
+/** Retuns a TQString with the run command line arguments */
+TQString ScriptProjectPart::runArguments() const
{
return DomUtil::readEntry(*projectDom(), "/kdevscriptproject/run/programargs");
}
-QString ScriptProjectPart::activeDirectory() const
+TQString ScriptProjectPart::activeDirectory() const
{
- QDomDocument &dom = *projectDom();
+ TQDomDocument &dom = *projectDom();
return DomUtil::readEntry(dom, "/kdevscriptproject/general/activedir");
}
-QStringList ScriptProjectPart::allFiles() const
+TQStringList ScriptProjectPart::allFiles() const
{
-/* QStringList res;
+/* TQStringList res;
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for (it = m_sourceFiles.begin(); it != m_sourceFiles.end(); ++it)
res += (m_projectDirectory + "/" + (*it));
@@ -266,19 +266,19 @@ QStringList ScriptProjectPart::allFiles() const
return m_sourceFiles;
}
-void ScriptProjectPart::addFile(const QString &fileName)
+void ScriptProjectPart::addFile(const TQString &fileName)
{
kdDebug(9015) << "AddFile2" << fileName << endl;
- QStringList fileList;
+ TQStringList fileList;
fileList.append ( fileName );
this->addFiles ( fileList );
}
-void ScriptProjectPart::addFiles ( const QStringList& fileList )
+void ScriptProjectPart::addFiles ( const TQStringList& fileList )
{
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for ( it = fileList.begin(); it != fileList.end(); ++it )
{
@@ -288,19 +288,19 @@ void ScriptProjectPart::addFiles ( const QStringList& fileList )
emit addedFilesToProject ( fileList );
}
-void ScriptProjectPart::removeFile(const QString &fileName)
+void ScriptProjectPart::removeFile(const TQString &fileName)
{
- QStringList fileList;
+ TQStringList fileList;
fileList.append ( fileName );
this->addFiles ( fileList );
}
-void ScriptProjectPart::removeFiles ( const QStringList& fileList )
+void ScriptProjectPart::removeFiles ( const TQStringList& fileList )
{
emit removedFilesFromProject ( fileList );
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for ( it = fileList.begin(); it != fileList.end(); ++it )
{
@@ -317,13 +317,13 @@ void ScriptProjectPart::slotNewFile()
/*!
\fn ScriptProjectPart::distFiles() const
*/
-QStringList ScriptProjectPart::distFiles() const
+TQStringList ScriptProjectPart::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( "*README*");
+ TQString projectDir = projectDirectory();
+ TQDir dir(projectDir);
+ TQStringList files = dir.entryList( "*README*");
return sourceList + files;
}
@@ -332,28 +332,28 @@ void ScriptProjectPart::rescan()
// kdDebug() << "Directory " << path << " changed, scanning for new files in the project" << endl;
// Put all files from all subdirectories into file list
- QValueStack<QString> s;
+ TQValueStack<TQString> s;
int prefixlen = m_projectDirectory.length()+1;
s.push(m_projectDirectory);
- QDir dir;
+ TQDir dir;
do {
dir.setPath(s.pop());
kdDebug(9015) << "Examining: " << dir.path() << endl;
const QFileInfoList *dirEntries = dir.entryInfoList();
if ( dirEntries )
{
- 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()) {
//do not follow symlinks which point to the themselves
if (it.current()->isSymLink())
{
- QString symLink = it.current()->readLink();
+ TQString symLink = it.current()->readLink();
if ((symLink == path) || (symLink == "./"))
continue;
} else if (canAddDirectoryToProject(path)) {
@@ -370,18 +370,18 @@ void ScriptProjectPart::rescan()
}
} while (!s.isEmpty());
-/* const QFileInfoList *dirEntries = QDir(path).entryInfoList();
+/* const QFileInfoList *dirEntries = TQDir(path).entryInfoList();
if ( dirEntries )
{
kdDebug() << "1" << endl;
- QPtrListIterator<QFileInfo> it(*dirEntries);
+ TQPtrListIterator<TQFileInfo> it(*dirEntries);
for (; it.current(); ++it) {
kdDebug() << "2" << endl;
- QString fileName = it.current()->fileName();
+ TQString fileName = it.current()->fileName();
if (fileName == "." || fileName == "..")
continue;
kdDebug() << "3" << endl;
- QString filePath = it.current()->absFilePath();
+ TQString filePath = it.current()->absFilePath();
if (!it.current()->isDir() && canAddToProject(filePath) && !isProjectFile(filePath)) {
kdDebug() << "=== adding " << filePath << endl;
addFile(filePath);
@@ -390,12 +390,12 @@ void ScriptProjectPart::rescan()
}*/
}
-bool ScriptProjectPart::canAddToProject(const QString & path)
+bool ScriptProjectPart::canAddToProject(const TQString & path)
{
- QDomDocument &dom = *projectDom();
- QString includepatterns
+ TQDomDocument &dom = *projectDom();
+ TQString includepatterns
= DomUtil::readEntry(dom, "/kdevscriptproject/general/includepatterns");
- QStringList includepatternList;
+ TQStringList includepatternList;
if ( includepatterns.isNull() ) {
if ( languageSupport() ){
KMimeType::List list = languageSupport()->mimeTypes();
@@ -406,14 +406,14 @@ bool ScriptProjectPart::canAddToProject(const QString & path)
}
}
} else {
- includepatternList = QStringList::split(",", includepatterns);
+ includepatternList = TQStringList::split(",", includepatterns);
}
- QString excludepatterns
+ TQString excludepatterns
= DomUtil::readEntry(dom, "/kdevscriptproject/general/excludepatterns");
if (excludepatterns.isNull())
excludepatterns = "*~";
- QStringList excludepatternList = QStringList::split(",", excludepatterns);
+ TQStringList excludepatternList = TQStringList::split(",", excludepatterns);
if (matchesPattern(path, includepatternList)
&& !matchesPattern(path, excludepatternList)) {
@@ -425,15 +425,15 @@ bool ScriptProjectPart::canAddToProject(const QString & path)
}
}
-bool ScriptProjectPart::canAddDirectoryToProject(const QString & path)
+bool ScriptProjectPart::canAddDirectoryToProject(const TQString & path)
{
- QDomDocument &dom = *projectDom();
- QString excludepatterns
+ TQDomDocument &dom = *projectDom();
+ TQString excludepatterns
= DomUtil::readEntry(dom, "/kdevscriptproject/general/excludepatterns");
if (excludepatterns.isNull()) {
return true;
}
- QStringList excludepatternList = QStringList::split(",", excludepatterns);
+ TQStringList excludepatternList = TQStringList::split(",", excludepatterns);
if (!matchesPattern(path, excludepatternList)) {
return true;