From b27654523e5c297fa53094c716761cb17faf9cac Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 6 Aug 2009 16:21:24 +0200 Subject: remove final traces of qtscript from qmake --- qmake/project.cpp | 131 ------------------------------------------------------ qmake/project.h | 11 ----- qmake/qmake.pri | 3 +- qmake/qmake.pro | 6 +-- 4 files changed, 3 insertions(+), 148 deletions(-) diff --git a/qmake/project.cpp b/qmake/project.cpp index 4fefbab..e44c6c7 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -153,91 +153,6 @@ QMap qmake_testFunctions() return *qmake_test_functions; } -QT_END_NAMESPACE - -#ifdef QTSCRIPT_SUPPORT -#include "qscriptvalue.h" -#include "qscriptengine.h" -#include "qscriptvalueiterator.h" - -QT_BEGIN_NAMESPACE - -static QScriptValue qscript_projectWrapper(QScriptEngine *eng, QMakeProject *project, - const QMap &place); - -static bool qscript_createQMakeProjectMap(QMap &vars, QScriptValue js) -{ - QScriptValueIterator it(js); - while(it.hasNext()) { - it.next(); - vars[it.name()] = qscriptvalue_cast(it.value()); - } - return true; -} - -static QScriptValue qscript_call_testfunction(QScriptContext *context, QScriptEngine *engine) -{ - QMakeProject *self = qscriptvalue_cast(context->callee().property("qmakeProject")); - QString func = context->callee().property("functionName").toString(); - QStringList args; - for(int i = 0; i < context->argumentCount(); ++i) - args += context->argument(i).toString(); - QMap place = self->variables(); - qscript_createQMakeProjectMap(place, engine->globalObject().property("qmake")); - QScriptValue ret(engine, self->doProjectTest(func, args, place)); - engine->globalObject().setProperty("qmake", qscript_projectWrapper(engine, self, place)); - return ret; -} - -static QScriptValue qscript_call_expandfunction(QScriptContext *context, QScriptEngine *engine) -{ - QMakeProject *self = qscriptvalue_cast(context->callee().property("qmakeProject")); - QString func = context->callee().property("functionName").toString(); - QStringList args; - for(int i = 0; i < context->argumentCount(); ++i) - args += context->argument(i).toString(); - QMap place = self->variables(); - qscript_createQMakeProjectMap(place, engine->globalObject().property("qmake")); - QScriptValue ret = qScriptValueFromValue(engine, self->doProjectExpand(func, args, place)); - engine->globalObject().setProperty("qmake", qscript_projectWrapper(engine, self, place)); - return ret; -} - -static QScriptValue qscript_projectWrapper(QScriptEngine *eng, QMakeProject *project, - const QMap &place) -{ - QScriptValue ret = eng->newObject(); - { - QStringList testFuncs = qmake_testFunctions().keys() + project->userTestFunctions(); - for(int i = 0; i < testFuncs.size(); ++i) { - QString funcName = testFuncs.at(i); - QScriptValue fun = eng->newFunction(qscript_call_testfunction); - fun.setProperty("qmakeProject", eng->newVariant(qVariantFromValue(project))); - fun.setProperty("functionName", QScriptValue(eng, funcName)); - eng->globalObject().setProperty(funcName, fun); - } - } - { - QStringList testFuncs = qmake_expandFunctions().keys() + project->userExpandFunctions(); - for(int i = 0; i < testFuncs.size(); ++i) { - QString funcName = testFuncs.at(i); - QScriptValue fun = eng->newFunction(qscript_call_expandfunction); - fun.setProperty("qmakeProject", eng->newVariant(qVariantFromValue(project))); - fun.setProperty("functionName", QScriptValue(eng, funcName)); - eng->globalObject().setProperty(funcName, fun); - } - } - for(QMap::ConstIterator it = place.begin(); it != place.end(); ++it) - ret.setProperty(it.key(), qScriptValueFromValue(eng, it.value())); - return ret; -} - -QT_END_NAMESPACE - -#endif - -QT_BEGIN_NAMESPACE - struct parser_info { QString file; int line_no; @@ -1797,27 +1712,8 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QMap sc = scope_blocks; IteratorBlock *it = iterator; @@ -2306,19 +2202,6 @@ QMakeProject::doProjectExpand(QString func, QList args_list, } break; } default: { -#ifdef QTSCRIPT_SUPPORT - { - QScriptValue jsFunc = eng.globalObject().property(func); - if(jsFunc.isFunction()) { - QScriptValueList jsArgs; - for(int i = 0; i < args.size(); ++i) - jsArgs += QScriptValue(&eng, args.at(i)); - QScriptValue jsRet = jsFunc.call(eng.globalObject(), jsArgs); - ret = qscriptvalue_cast(jsRet); - break; - } - } -#endif fprintf(stderr, "%s:%d: Unknown replace function: %s\n", parser.file.toLatin1().constData(), parser.line_no, func.toLatin1().constData()); @@ -2782,20 +2665,6 @@ QMakeProject::doProjectTest(QString func, QList args_list, QMap(jsRet); - } - } -#endif fprintf(stderr, "%s:%d: Unknown test function: %s\n", parser.file.toLatin1().constData(), parser.line_no, func.toLatin1().constData()); } diff --git a/qmake/project.h b/qmake/project.h index 6850782..3e455ac 100644 --- a/qmake/project.h +++ b/qmake/project.h @@ -49,14 +49,6 @@ #include #include -#ifndef QT_BUILD_QMAKE_LIBRARY -//# define QTSCRIPT_SUPPORT -#endif - -#ifdef QTSCRIPT_SUPPORT -# include -#endif - QT_BEGIN_NAMESPACE class QMakeProperty; @@ -80,9 +72,6 @@ class QMakeProject friend struct IteratorBlock; friend struct FunctionBlock; -#ifdef QTSCRIPT_SUPPORT - QScriptEngine eng; -#endif QStack scope_blocks; QStack function_blocks; IteratorBlock *iterator; diff --git a/qmake/qmake.pri b/qmake/qmake.pri index 1f9243b..f5f675c 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -120,10 +120,9 @@ bootstrap { #Qt code LFLAGS += -lcpp } DEFINES *= QT_NO_QOBJECT - include($$QT_SOURCE_TREE/src/script/script.pri) } else { CONFIG += qt - QT = core script + QT = core } *-g++:profiling { QMAKE_CFLAGS = -pg diff --git a/qmake/qmake.pro b/qmake/qmake.pro index 5740061..a044d47 100644 --- a/qmake/qmake.pro +++ b/qmake/qmake.pro @@ -17,10 +17,8 @@ VPATH += $$QT_SOURCE_TREE/src/corelib/global \ $$QT_SOURCE_TREE/src/corelib/kernel \ $$QT_SOURCE_TREE/src/corelib/codecs \ $$QT_SOURCE_TREE/src/corelib/plugin \ - $$QT_SOURCE_TREE/src/corelib/io \ - $$QT_SOURCE_TREE/src/script + $$QT_SOURCE_TREE/src/corelib/io INCPATH += generators generators/unix generators/win32 generators/mac \ - $$QT_SOURCE_TREE/include $$QT_SOURCE_TREE/include/QtCore \ - $$QT_SOURCE_TREE/qmake $$QT_SOURCE_TREE/include/QtScript + $$QT_SOURCE_TREE/include $$QT_SOURCE_TREE/include/QtCore include(qmake.pri) -- cgit v0.12