moderately lame way to get conditional compilation of GUI features
svn path=/trunk/KDE/kdebase/runtime/; revision=1070943
This commit is contained in:
parent
a85e29367a
commit
88496997f9
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set(simple_javascript_engine_SRCS
|
set(simple_javascript_engine_SRCS
|
||||||
appletauthorization.cpp
|
appletauthorization.cpp
|
||||||
scriptenv.cpp
|
scriptenvui.cpp
|
||||||
simplejavascriptapplet.cpp
|
simplejavascriptapplet.cpp
|
||||||
simplebindings/animationgroup.cpp
|
simplebindings/animationgroup.cpp
|
||||||
simplebindings/appletinterface.cpp
|
simplebindings/appletinterface.cpp
|
||||||
@ -31,7 +31,6 @@ set(simple_javascript_engine_SRCS
|
|||||||
|
|
||||||
include_directories(${PHONON_INCLUDES})
|
include_directories(${PHONON_INCLUDES})
|
||||||
|
|
||||||
|
|
||||||
kde4_add_plugin(plasma_appletscript_simple_javascript ${simple_javascript_engine_SRCS})
|
kde4_add_plugin(plasma_appletscript_simple_javascript ${simple_javascript_engine_SRCS})
|
||||||
|
|
||||||
target_link_libraries(plasma_appletscript_simple_javascript
|
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
|
set(javascript_dataengine_engine_SRCS
|
||||||
javascriptdataengine.cpp
|
javascriptdataengine.cpp
|
||||||
|
scriptenv.cpp
|
||||||
simplebindings/dataengine.cpp
|
simplebindings/dataengine.cpp
|
||||||
simplebindings/variant.cpp
|
simplebindings/variant.cpp
|
||||||
)
|
)
|
||||||
@ -77,6 +77,7 @@ kde4_add_plugin(plasma_dataenginescript_javascript ${javascript_dataengine_engin
|
|||||||
|
|
||||||
target_link_libraries(plasma_dataenginescript_javascript
|
target_link_libraries(plasma_dataenginescript_javascript
|
||||||
${KDE4_KDECORE_LIBS}
|
${KDE4_KDECORE_LIBS}
|
||||||
|
${KDE4_KIO_LIBS}
|
||||||
${KDE4_PLASMA_LIBS}
|
${KDE4_PLASMA_LIBS}
|
||||||
${QT_QTSCRIPT_LIBRARY})
|
${QT_QTSCRIPT_LIBRARY})
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include <QMetaEnum>
|
#include <QMetaEnum>
|
||||||
|
|
||||||
#include <KDebug>
|
#include <KDebug>
|
||||||
#include <KFileDialog>
|
|
||||||
#include <KIO/Job>
|
#include <KIO/Job>
|
||||||
#include <KLocale>
|
#include <KLocale>
|
||||||
#include <KMimeType>
|
#include <KMimeType>
|
||||||
@ -34,8 +33,9 @@
|
|||||||
#include <KStandardDirs>
|
#include <KStandardDirs>
|
||||||
#include <KRun>
|
#include <KRun>
|
||||||
|
|
||||||
#include "simplejavascriptapplet.h"
|
#ifdef USEGUI
|
||||||
#include "simplebindings/filedialogproxy.h"
|
#include "simplebindings/filedialogproxy.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
ScriptEnv::ScriptEnv(QObject *parent)
|
ScriptEnv::ScriptEnv(QObject *parent)
|
||||||
: QScriptEngine(parent),
|
: QScriptEngine(parent),
|
||||||
@ -187,8 +187,10 @@ bool ScriptEnv::importBuiltinExtension(const QString &extension, QScriptValue &o
|
|||||||
{
|
{
|
||||||
kDebug() << extension;
|
kDebug() << extension;
|
||||||
if ("filedialog" == extension) {
|
if ("filedialog" == extension) {
|
||||||
|
#ifdef USEGUI
|
||||||
FileDialogProxy::registerWithRuntime(this);
|
FileDialogProxy::registerWithRuntime(this);
|
||||||
return true;
|
return true;
|
||||||
|
#endif
|
||||||
} else if ("launchapp" == extension) {
|
} else if ("launchapp" == extension) {
|
||||||
obj.setProperty("runApplication", newFunction(ScriptEnv::runApplication));
|
obj.setProperty("runApplication", newFunction(ScriptEnv::runApplication));
|
||||||
obj.setProperty("runCommand", newFunction(ScriptEnv::runCommand));
|
obj.setProperty("runCommand", newFunction(ScriptEnv::runCommand));
|
||||||
|
21
scriptengines/javascript/scriptenvui.cpp
Normal file
21
scriptengines/javascript/scriptenvui.cpp
Normal 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"
|
||||||
|
|
@ -58,7 +58,6 @@
|
|||||||
|
|
||||||
using namespace Plasma;
|
using namespace Plasma;
|
||||||
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QPainter*)
|
Q_DECLARE_METATYPE(QPainter*)
|
||||||
Q_DECLARE_METATYPE(QStyleOptionGraphicsItem*)
|
Q_DECLARE_METATYPE(QStyleOptionGraphicsItem*)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user