PackageStructure plugin for plasmapkg et al as well as some fixes to the addon package structure definition
svn path=/trunk/KDE/kdebase/runtime/; revision=1161152
This commit is contained in:
parent
88f7ff8f53
commit
4d6e335156
@ -1,6 +1,7 @@
|
|||||||
# APPLET
|
# APPLET
|
||||||
|
|
||||||
set(simple_javascript_engine_SRCS
|
set(simple_javascript_engine_SRCS
|
||||||
|
common/javascriptaddonpackagestructure.cpp
|
||||||
common/scriptenvui.cpp
|
common/scriptenvui.cpp
|
||||||
plasmoid/appletauthorization.cpp
|
plasmoid/appletauthorization.cpp
|
||||||
plasmoid/appletinterface.cpp
|
plasmoid/appletinterface.cpp
|
||||||
@ -52,6 +53,7 @@ install(FILES data/plasma-scriptengine-applet-simple-javascript.desktop DESTINAT
|
|||||||
# RUNNER
|
# RUNNER
|
||||||
|
|
||||||
set(javascript_runner_engine_SRCS
|
set(javascript_runner_engine_SRCS
|
||||||
|
common/javascriptaddonpackagestructure.cpp
|
||||||
common/scriptenv.cpp
|
common/scriptenv.cpp
|
||||||
runner/javascriptrunner.cpp
|
runner/javascriptrunner.cpp
|
||||||
)
|
)
|
||||||
@ -71,9 +73,10 @@ install(FILES data/plasma-scriptengine-runner-javascript.desktop DESTINATION ${S
|
|||||||
# DATAENGINE
|
# DATAENGINE
|
||||||
|
|
||||||
set(javascript_dataengine_engine_SRCS
|
set(javascript_dataengine_engine_SRCS
|
||||||
|
common/javascriptaddonpackagestructure.cpp
|
||||||
|
common/scriptenv.cpp
|
||||||
dataengine/javascriptdataengine.cpp
|
dataengine/javascriptdataengine.cpp
|
||||||
dataengine/javascriptservice.cpp
|
dataengine/javascriptservice.cpp
|
||||||
common/scriptenv.cpp
|
|
||||||
simplebindings/dataengine.cpp
|
simplebindings/dataengine.cpp
|
||||||
simplebindings/variant.cpp
|
simplebindings/variant.cpp
|
||||||
)
|
)
|
||||||
@ -88,5 +91,20 @@ target_link_libraries(plasma_dataenginescript_javascript
|
|||||||
install(TARGETS plasma_dataenginescript_javascript DESTINATION ${PLUGIN_INSTALL_DIR})
|
install(TARGETS plasma_dataenginescript_javascript DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||||
install(FILES data/plasma-scriptengine-dataengine-javascript.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
install(FILES data/plasma-scriptengine-dataengine-javascript.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
||||||
|
|
||||||
|
# ADDONS
|
||||||
|
|
||||||
|
set(javascript_addon_packagestructure_SRCS
|
||||||
|
common/addonpackageplugin.cpp
|
||||||
|
common/javascriptaddonpackagestructure.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
kde4_add_plugin(plasma_packagestructure_javascriptaddon ${javascript_addon_packagestructure_SRCS})
|
||||||
|
target_link_libraries(plasma_packagestructure_javascriptaddon ${KDE4_PLASMA_LIBS})
|
||||||
|
|
||||||
|
install(TARGETS plasma_packagestructure_javascriptaddon DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||||
|
install(FILES data/plasma-packagestructure-javascript-addon.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
||||||
|
|
||||||
install(FILES data/plasma-javascriptaddon.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
|
install(FILES data/plasma-javascriptaddon.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "javascriptaddonpackagestructure.h"
|
||||||
|
|
||||||
|
#include <KConfigGroup>
|
||||||
|
#include <KDesktopFile>
|
||||||
|
|
||||||
|
JavascriptAddonPackageStructure::JavascriptAddonPackageStructure(QObject *parent, const QVariantList &args)
|
||||||
|
: Plasma::PackageStructure(parent, "Plasma/JavascriptAddon")
|
||||||
|
{
|
||||||
|
Q_UNUSED(args)
|
||||||
|
setServicePrefix("plasma-javascriptaddon");
|
||||||
|
setDefaultPackageRoot("plasma/javascript-addons/");
|
||||||
|
addFileDefinition("mainscript", "code/main.js", i18n("Main Script File"));
|
||||||
|
setRequired("mainscript", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void JavascriptAddonPackageStructure::pathChanged()
|
||||||
|
{
|
||||||
|
KDesktopFile config(path() + "/metadata.desktop");
|
||||||
|
KConfigGroup cg = config.desktopGroup();
|
||||||
|
QString mainScript = cg.readEntry("X-Plasma-MainScript", QString());
|
||||||
|
if (!mainScript.isEmpty()) {
|
||||||
|
addFileDefinition("mainscript", mainScript, i18n("Main Script File"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "javascriptaddonpackagestructure.moc"
|
||||||
|
|
@ -26,24 +26,9 @@ class JavascriptAddonPackageStructure : public Plasma::PackageStructure
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
JavascriptAddonPackageStructure(QObject *parent = 0)
|
JavascriptAddonPackageStructure(QObject *parent = 0, const QVariantList &args = QVariantList());
|
||||||
: Plasma::PackageStructure(parent)
|
|
||||||
{
|
|
||||||
setServicePrefix("plasma-layout-template");
|
|
||||||
setDefaultPackageRoot("plasma/javascript-addons/");
|
|
||||||
addFileDefinition("mainscript", "code/main.js", i18n("Main Script File"));
|
|
||||||
setRequired("mainscript", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pathChanged()
|
void pathChanged();
|
||||||
{
|
|
||||||
KDesktopFile config(path() + "/metadata.desktop");
|
|
||||||
KConfigGroup cg = config.desktopGroup();
|
|
||||||
QString mainScript = cg.readEntry("X-Plasma-MainScript", QString());
|
|
||||||
if (!mainScript.isEmpty()) {
|
|
||||||
addFileDefinition("mainscript", mainScript, i18n("Main Script File"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -581,5 +581,4 @@ bool ScriptEnv::removeEventListener(const QString &event, const QScriptValue &fu
|
|||||||
|
|
||||||
#ifndef USEGUI
|
#ifndef USEGUI
|
||||||
#include "scriptenv.moc"
|
#include "scriptenv.moc"
|
||||||
#include "javascriptaddonpackagestructure.moc"
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -19,5 +19,4 @@
|
|||||||
#define USEGUI
|
#define USEGUI
|
||||||
#include "scriptenv.cpp"
|
#include "scriptenv.cpp"
|
||||||
#include "scriptenv.moc"
|
#include "scriptenv.moc"
|
||||||
#include "javascriptaddonpackagestructure.moc"
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user