moderately lame way to get conditional compilation of GUI features

svn path=/trunk/KDE/kdebase/runtime/; revision=1070943
This commit is contained in:
Aaron J. Seigo 2010-01-07 02:26:44 +00:00
parent a85e29367a
commit 88496997f9
4 changed files with 28 additions and 5 deletions

View File

@ -2,7 +2,7 @@
set(simple_javascript_engine_SRCS
appletauthorization.cpp
scriptenv.cpp
scriptenvui.cpp
simplejavascriptapplet.cpp
simplebindings/animationgroup.cpp
simplebindings/appletinterface.cpp
@ -31,7 +31,6 @@ set(simple_javascript_engine_SRCS
include_directories(${PHONON_INCLUDES})
kde4_add_plugin(plasma_appletscript_simple_javascript ${simple_javascript_engine_SRCS})
target_link_libraries(plasma_appletscript_simple_javascript
@ -70,6 +69,7 @@ install(FILES plasma-scriptengine-runner-javascript.desktop DESTINATION ${SERVIC
set(javascript_dataengine_engine_SRCS
javascriptdataengine.cpp
scriptenv.cpp
simplebindings/dataengine.cpp
simplebindings/variant.cpp
)
@ -77,6 +77,7 @@ kde4_add_plugin(plasma_dataenginescript_javascript ${javascript_dataengine_engin
target_link_libraries(plasma_dataenginescript_javascript
${KDE4_KDECORE_LIBS}
${KDE4_KIO_LIBS}
${KDE4_PLASMA_LIBS}
${QT_QTSCRIPT_LIBRARY})

View File

@ -25,7 +25,6 @@
#include <QMetaEnum>
#include <KDebug>
#include <KFileDialog>
#include <KIO/Job>
#include <KLocale>
#include <KMimeType>
@ -34,8 +33,9 @@
#include <KStandardDirs>
#include <KRun>
#include "simplejavascriptapplet.h"
#ifdef USEGUI
#include "simplebindings/filedialogproxy.h"
#endif
ScriptEnv::ScriptEnv(QObject *parent)
: QScriptEngine(parent),
@ -187,8 +187,10 @@ bool ScriptEnv::importBuiltinExtension(const QString &extension, QScriptValue &o
{
kDebug() << extension;
if ("filedialog" == extension) {
#ifdef USEGUI
FileDialogProxy::registerWithRuntime(this);
return true;
#endif
} else if ("launchapp" == extension) {
obj.setProperty("runApplication", newFunction(ScriptEnv::runApplication));
obj.setProperty("runCommand", newFunction(ScriptEnv::runCommand));

View File

@ -0,0 +1,21 @@
/*
* Copyright 2010 Aaron J. Seigo <aseigo@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License version 2 as
* published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#define USEGUI
#include "scriptenv.cpp"

View File

@ -58,7 +58,6 @@
using namespace Plasma;
Q_DECLARE_METATYPE(QPainter*)
Q_DECLARE_METATYPE(QStyleOptionGraphicsItem*)