summaryrefslogtreecommitdiffstats
path: root/buildtools/lib/parsers/qmake/tests
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
commit48d4a26399959121f33d2bc3bfe51c7827b654fc (patch)
tree5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /buildtools/lib/parsers/qmake/tests
parent7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff)
downloadtdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz
tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip
TQt4 port kdevelop
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'buildtools/lib/parsers/qmake/tests')
-rw-r--r--buildtools/lib/parsers/qmake/tests/runner.cpp64
-rw-r--r--buildtools/lib/parsers/qmake/tests/viewer.cpp48
-rw-r--r--buildtools/lib/parsers/qmake/tests/viewer.h9
-rw-r--r--buildtools/lib/parsers/qmake/tests/viewer_main.cpp2
-rw-r--r--buildtools/lib/parsers/qmake/tests/viewerbase.ui44
5 files changed, 84 insertions, 83 deletions
diff --git a/buildtools/lib/parsers/qmake/tests/runner.cpp b/buildtools/lib/parsers/qmake/tests/runner.cpp
index 6f1d5956..5dd417db 100644
--- a/buildtools/lib/parsers/qmake/tests/runner.cpp
+++ b/buildtools/lib/parsers/qmake/tests/runner.cpp
@@ -21,8 +21,8 @@
#include <cstdlib>
#include <iostream>
#include <stdio.h>
-#include "qmakedriver.h"
-#include "qmakeastvisitor.h"
+#include "tqmakedriver.h"
+#include "tqmakeastvisitor.h"
#include <tqstring.h>
@@ -34,92 +34,92 @@ static const KCmdLineOptions options[] =
{
{"silent", "Enable Parser debug output", 0},
{"!debug", "Disable output of the generated AST", 0},
- {"!+files", "QMake project files", 0}
+ {"!+files", "TQMake project files", 0}
};
-class PrintAST : QMake::ASTVisitor
+class PrintAST : TQMake::ASTVisitor
{
public:
- PrintAST() : QMake::ASTVisitor()
+ PrintAST() : TQMake::ASTVisitor()
{
indent = 0;
}
- virtual void processProject( QMake::ProjectAST* p )
+ virtual void processProject( TQMake::ProjectAST* p )
{
- QMake::ASTVisitor::processProject(p);
+ TQMake::ASTVisitor::processProject(p);
}
private:
- virtual void enterRealProject( QMake::ProjectAST* p )
+ virtual void enterRealProject( TQMake::ProjectAST* p )
{
kdDebug(9024) << getIndent() << "--------- Entering Project: " << replaceWs(p->fileName()) << "| LineEnding:" << p->lineEnding() << " --------------" << endl;
indent += 4;
- QMake::ASTVisitor::enterRealProject(p);
+ TQMake::ASTVisitor::enterRealProject(p);
}
- virtual void leaveRealProject( QMake::ProjectAST* p )
+ virtual void leaveRealProject( TQMake::ProjectAST* p )
{
indent -= 4;
kdDebug(9024) << getIndent() << "--------- Leaving Project: " << replaceWs(p->fileName()) << " --------------" << endl;
- QMake::ASTVisitor::leaveRealProject(p);
+ TQMake::ASTVisitor::leaveRealProject(p);
}
- virtual void enterScope( QMake::ProjectAST* p )
+ virtual void enterScope( TQMake::ProjectAST* p )
{
kdDebug(9024) << getIndent() << "--------- Entering Scope: " << replaceWs(p->scopedID) << " --------------" << endl;
indent += 4;
- QMake::ASTVisitor::enterScope(p);
+ TQMake::ASTVisitor::enterScope(p);
}
- virtual void leaveScope( QMake::ProjectAST* p )
+ virtual void leaveScope( TQMake::ProjectAST* p )
{
indent -= 4;
kdDebug(9024) << getIndent() << "--------- Leaving Scope: " << replaceWs(p->scopedID) << " --------------" << endl;
- QMake::ASTVisitor::leaveScope(p);
+ TQMake::ASTVisitor::leaveScope(p);
}
- virtual void enterFunctionScope( QMake::ProjectAST* p )
+ virtual void enterFunctionScope( TQMake::ProjectAST* p )
{
kdDebug(9024) << getIndent() << "--------- Entering FunctionScope: " << replaceWs(p->scopedID) << "(" << replaceWs(p->args) << ")"<< " --------------" << endl;
indent += 4;
- QMake::ASTVisitor::enterFunctionScope(p);
+ TQMake::ASTVisitor::enterFunctionScope(p);
}
- virtual void leaveFunctionScope( QMake::ProjectAST* p )
+ virtual void leaveFunctionScope( TQMake::ProjectAST* p )
{
indent -= 4;
kdDebug(9024) << getIndent() << "--------- Leaving FunctionScope: " << replaceWs(p->scopedID) << "(" << replaceWs(p->args) << ")"<< " --------------" << endl;
- QMake::ASTVisitor::leaveFunctionScope(p);
+ TQMake::ASTVisitor::leaveFunctionScope(p);
}
TQString replaceWs(TQString s)
{
- return s.replace("\n", "%nl").replace("\t", "%tab").replace(" ", "%spc");
+ return s.tqreplace("\n", "%nl").tqreplace("\t", "%tab").tqreplace(" ", "%spc");
}
- virtual void processAssignment( QMake::AssignmentAST* a)
+ virtual void processAssignment( TQMake::AssignmentAST* a)
{
kdDebug(9024) << getIndent() << "Assignment(" << replaceWs(a->indent) << "):" << replaceWs(a->scopedID) << " " << replaceWs(a->op) << " " << replaceWs(a->values.join("|")) << endl;
- QMake::ASTVisitor::processAssignment(a);
+ TQMake::ASTVisitor::processAssignment(a);
}
- virtual void processNewLine( QMake::NewLineAST* n)
+ virtual void processNewLine( TQMake::NewLineAST* n)
{
kdDebug(9024) << getIndent() << "Newline " << endl;
- QMake::ASTVisitor::processNewLine(n);
+ TQMake::ASTVisitor::processNewLine(n);
}
- virtual void processComment( QMake::CommentAST* a)
+ virtual void processComment( TQMake::CommentAST* a)
{
kdDebug(9024) << getIndent() << "Comment: " << replaceWs(a->comment) << endl;
- QMake::ASTVisitor::processComment(a);
+ TQMake::ASTVisitor::processComment(a);
}
- virtual void processInclude( QMake::IncludeAST* a)
+ virtual void processInclude( TQMake::IncludeAST* a)
{
kdDebug(9024) << getIndent() << "Include: " << replaceWs(a->projectName) << endl;
- QMake::ASTVisitor::processInclude(a);
+ TQMake::ASTVisitor::processInclude(a);
}
TQString getIndent()
@@ -133,7 +133,7 @@ private:
};
int main(int argc, char *argv[])
{
- KCmdLineArgs::init( argc, argv, "QMake Parser", "qmake-parser", "Parse QMake project files", "1.0.0");
+ KCmdLineArgs::init( argc, argv, "TQMake Parser", "qmake-parser", "Parse TQMake project files", "1.0.0");
KCmdLineArgs::addCmdLineOptions(options);
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
@@ -152,8 +152,8 @@ int main(int argc, char *argv[])
debug = 1;
for( int i = 0 ; i < args->count() ; i++ )
{
- QMake::ProjectAST *projectAST;
- int ret = QMake::Driver::parseFile(args->url(i).path(), &projectAST, debug);
+ TQMake::ProjectAST *projectAST;
+ int ret = TQMake::Driver::parseFile(args->url(i).path(), &projectAST, debug);
PrintAST pa;
if ( ret == 0 )
if ( !silent )
@@ -161,7 +161,7 @@ int main(int argc, char *argv[])
pa.processProject(projectAST);
TQString profile;
projectAST->writeBack(profile);
- kdDebug(9024) << "QMake file written back:\n" << profile << endl;
+ kdDebug(9024) << "TQMake file written back:\n" << profile << endl;
}
return ret;
}
diff --git a/buildtools/lib/parsers/qmake/tests/viewer.cpp b/buildtools/lib/parsers/qmake/tests/viewer.cpp
index 4583ab11..6f1e5f25 100644
--- a/buildtools/lib/parsers/qmake/tests/viewer.cpp
+++ b/buildtools/lib/parsers/qmake/tests/viewer.cpp
@@ -29,14 +29,14 @@
#include <tqlistview.h>
#include <tqtabwidget.h>
-#include <qmakeast.h>
-#include <qmakedriver.h>
-#include <qmakeastvisitor.h>
+#include <tqmakeast.h>
+#include <tqmakedriver.h>
+#include <tqmakeastvisitor.h>
-using namespace QMake;
+using namespace TQMake;
-Viewer::Viewer(TQWidget *parent, const char *name)
- :ViewerBase(parent, name), projectAST(0)
+Viewer::Viewer(TQWidget *tqparent, const char *name)
+ :ViewerBase(tqparent, name), projectAST(0)
{
if (TQFile::exists(TQDir::currentDirPath() + "/" + "qtlist"))
{
@@ -47,7 +47,7 @@ Viewer::Viewer(TQWidget *parent, const char *name)
files->insertItem(str.readLine());
}
ast->setSorting(-1);
-// parentProject.push((TQListViewItem*)0);
+// tqparentProject.push((TQListViewItem*)0);
}
void Viewer::addAll_clicked()
@@ -78,7 +78,7 @@ void Viewer::files_currentChanged(TQListBoxItem* item)
source->setText(str.read());
f.close();
- int result = QMake::Driver::parseFile(item->text().ascii(), &projectAST, 0);
+ int result = TQMake::Driver::parseFile(item->text().ascii(), &projectAST, 0);
if (projectAST && (result == 0))
{
processAST(projectAST);
@@ -102,7 +102,7 @@ public:
ViewerVisitor(Viewer *v): ASTVisitor()
{
this->v = v;
- parentProject.push((TQListViewItem*)0);
+ tqparentProject.push((TQListViewItem*)0);
}
virtual void processProject(ProjectAST *project)
@@ -113,39 +113,39 @@ public:
virtual void enterRealProject(ProjectAST *project)
{
TQListViewItem *projectIt;
- if (!parentProject.top())
+ if (!tqparentProject.top())
{
projectIt = new TQListViewItem(v->ast, "Project");
projectIt->setOpen(true);
- parentProject.push(projectIt);
+ tqparentProject.push(projectIt);
}
ASTVisitor::enterRealProject(project);
}
virtual void enterScope(ProjectAST *scope)
{
- TQListViewItem *projectIt = new TQListViewItem(parentProject.top(), scope->scopedID, "scope");
- parentProject.push(projectIt);
+ TQListViewItem *projectIt = new TQListViewItem(tqparentProject.top(), scope->scopedID, "scope");
+ tqparentProject.push(projectIt);
ASTVisitor::enterScope(scope);
}
virtual void leaveScope(ProjectAST *scope)
{
- parentProject.pop();
+ tqparentProject.pop();
}
virtual void enterFunctionScope(ProjectAST *fscope)
{
- TQListViewItem *projectIt = new TQListViewItem(parentProject.top(),
+ TQListViewItem *projectIt = new TQListViewItem(tqparentProject.top(),
fscope->scopedID + "(" + fscope->args + ")", "function scope");
- parentProject.push(projectIt);
+ tqparentProject.push(projectIt);
ASTVisitor::enterFunctionScope(fscope);
}
virtual void leaveFunctionScope(ProjectAST *fscope)
{
- parentProject.pop();
+ tqparentProject.pop();
}
virtual void processAssignment(AssignmentAST *assignment)
{
- TQListViewItem *item = new TQListViewItem(parentProject.top(),
+ TQListViewItem *item = new TQListViewItem(tqparentProject.top(),
assignment->scopedID, assignment->op, assignment->values.join("|"),
"assignment");
item->setMultiLinesEnabled(true);
@@ -154,26 +154,26 @@ public:
}
virtual void processNewLine(NewLineAST *newline)
{
- new TQListViewItem(parentProject.top(), "<newline>");
+ new TQListViewItem(tqparentProject.top(), "<newline>");
ASTVisitor::processNewLine(newline);
}
virtual void processComment(CommentAST *comment)
{
- new TQListViewItem(parentProject.top(), "<comment>");
+ new TQListViewItem(tqparentProject.top(), "<comment>");
ASTVisitor::processComment(comment);
}
virtual void processInclude(IncludeAST *include)
{
- new TQListViewItem(parentProject.top(), "<include>", include->projectName);
- QMake::ASTVisitor::processInclude(include);
+ new TQListViewItem(tqparentProject.top(), "<include>", include->projectName);
+ TQMake::ASTVisitor::processInclude(include);
}
Viewer *v;
- TQValueStack<TQListViewItem *> parentProject;
+ TQValueStack<TQListViewItem *> tqparentProject;
};
-void Viewer::processAST(QMake::ProjectAST *projectAST, TQListViewItem *globAfter)
+void Viewer::processAST(TQMake::ProjectAST *projectAST, TQListViewItem *globAfter)
{
ViewerVisitor visitor(this);
visitor.processProject(projectAST);
diff --git a/buildtools/lib/parsers/qmake/tests/viewer.h b/buildtools/lib/parsers/qmake/tests/viewer.h
index bba85b1f..28a7613c 100644
--- a/buildtools/lib/parsers/qmake/tests/viewer.h
+++ b/buildtools/lib/parsers/qmake/tests/viewer.h
@@ -24,7 +24,7 @@
#include "viewerbase.h"
-namespace QMake {
+namespace TQMake {
class ProjectAST;
}
@@ -32,16 +32,17 @@ class TQListViewItem;
class Viewer: public ViewerBase {
Q_OBJECT
+ TQ_OBJECT
public:
- Viewer(TQWidget *parent = 0, const char *name = 0);
- void processAST(QMake::ProjectAST *projectAST, TQListViewItem *globAfter = 0);
+ Viewer(TQWidget *tqparent = 0, const char *name = 0);
+ void processAST(TQMake::ProjectAST *projectAST, TQListViewItem *globAfter = 0);
public slots:
virtual void tabWidget2_selected(const TQString&);
virtual void files_currentChanged(TQListBoxItem*);
virtual void choose_clicked();
virtual void addAll_clicked();
private:
- QMake::ProjectAST *projectAST;
+ TQMake::ProjectAST *projectAST;
friend class ViewerVisitor;
};
diff --git a/buildtools/lib/parsers/qmake/tests/viewer_main.cpp b/buildtools/lib/parsers/qmake/tests/viewer_main.cpp
index c31ea02c..199b106d 100644
--- a/buildtools/lib/parsers/qmake/tests/viewer_main.cpp
+++ b/buildtools/lib/parsers/qmake/tests/viewer_main.cpp
@@ -27,7 +27,7 @@ int main(int argc, char **argv)
Viewer viewer;
app.setMainWidget(&viewer);
viewer.show();
- viewer.setWindowState(viewer.windowState() | Qt::WindowMaximized);
+ viewer.setWindowState(viewer.windowState() | TQt::WindowMaximized);
return app.exec();
}
diff --git a/buildtools/lib/parsers/qmake/tests/viewerbase.ui b/buildtools/lib/parsers/qmake/tests/viewerbase.ui
index 976d4d0f..c37f41bf 100644
--- a/buildtools/lib/parsers/qmake/tests/viewerbase.ui
+++ b/buildtools/lib/parsers/qmake/tests/viewerbase.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>ViewerBase</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>ViewerBase</cstring>
</property>
@@ -19,37 +19,37 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QSplitter" row="0" column="0">
+ <widget class="TQSplitter" row="0" column="0">
<property name="name">
<cstring>splitter5</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout4</cstring>
+ <cstring>tqlayout4</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLineEdit">
+ <widget class="TQLineEdit">
<property name="name">
<cstring>allLocation</cstring>
</property>
- <property name="maximumSize">
+ <property name="tqmaximumSize">
<size>
<width>32767</width>
<height>32767</height>
</size>
</property>
</widget>
- <widget class="QPushButton">
+ <widget class="TQPushButton">
<property name="name">
<cstring>addAll</cstring>
</property>
- <property name="maximumSize">
+ <property name="tqmaximumSize">
<size>
<width>32767</width>
<height>32767</height>
@@ -59,11 +59,11 @@
<string>Add All From Directory</string>
</property>
</widget>
- <widget class="QPushButton">
+ <widget class="TQPushButton">
<property name="name">
<cstring>choose</cstring>
</property>
- <property name="maximumSize">
+ <property name="tqmaximumSize">
<size>
<width>32767</width>
<height>32767</height>
@@ -73,7 +73,7 @@
<string>Choose File to Add...</string>
</property>
</widget>
- <widget class="QListBox">
+ <widget class="TQListBox">
<property name="name">
<cstring>files</cstring>
</property>
@@ -85,7 +85,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="maximumSize">
+ <property name="tqmaximumSize">
<size>
<width>32767</width>
<height>32767</height>
@@ -97,14 +97,14 @@
</widget>
</vbox>
</widget>
- <widget class="QSplitter">
+ <widget class="TQSplitter">
<property name="name">
<cstring>splitter2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
- <widget class="QTextEdit">
+ <widget class="TQTextEdit">
<property name="name">
<cstring>source</cstring>
</property>
@@ -117,7 +117,7 @@
</sizepolicy>
</property>
</widget>
- <widget class="QTabWidget">
+ <widget class="TQTabWidget">
<property name="name">
<cstring>tabWidget2</cstring>
</property>
@@ -129,7 +129,7 @@
<verstretch>2</verstretch>
</sizepolicy>
</property>
- <widget class="QWidget">
+ <widget class="TQWidget">
<property name="name">
<cstring>tab</cstring>
</property>
@@ -140,7 +140,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QListView" row="0" column="0">
+ <widget class="TQListView" row="0" column="0">
<column>
<property name="text">
<string>Name</string>
@@ -191,7 +191,7 @@
</widget>
</grid>
</widget>
- <widget class="QWidget">
+ <widget class="TQWidget">
<property name="name">
<cstring>tab</cstring>
</property>
@@ -202,7 +202,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QTextEdit" row="0" column="0">
+ <widget class="TQTextEdit" row="0" column="0">
<property name="name">
<cstring>writeBack</cstring>
</property>
@@ -240,11 +240,11 @@
<slot>tabWidget2_selected(const QString&amp;)</slot>
</connection>
</connections>
-<slots>
+<Q_SLOTS>
<slot>addAll_clicked()</slot>
<slot>choose_clicked()</slot>
<slot>files_currentChanged( QListBoxItem * )</slot>
<slot>tabWidget2_selected( const QString &amp; )</slot>
-</slots>
-<layoutdefaults spacing="6" margin="11"/>
+</Q_SLOTS>
+<tqlayoutdefaults spacing="6" margin="11"/>
</UI>