[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/plasma/generic/scriptengines/webkit
From: Aaron J. Seigo <aseigo () kde ! org>
Date: 2010-01-02 19:40:01
Message-ID: 1262461201.701962.5823.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1069080 by aseigo:
final API review before 4.4: bring this in line with the QScript based ones and get \
rid of the dual-object ("applet", "plasma") sillyness and Do It Right(tm) with just \
one "plasmoid" object (mostly code removal, actually). we will maintain API compat \
from 4.4 onward which is palatable now that the API is properly plasma-like.
M +0 -27 plasmajs.cpp
M +0 -16 plasmajs.h
M +10 -5 plasmawebapplet.cpp
M +2 -0 plasmawebapplet.h
--- trunk/KDE/kdebase/workspace/plasma/generic/scriptengines/webkit/plasmajs.cpp \
#1069079:1069080 @@ -22,37 +22,10 @@
#include "plasmajs.h"
#include "plasmawebapplet.h"
-#include <Plasma/DataEngineManager>
#include <Plasma/DataEngine>
using namespace Plasma;
-PlasmaJs::PlasmaJs(PlasmaWebApplet *parent)
- : QObject(parent),
- m_webApplet(parent)
-{
-}
-
-QStringList PlasmaJs::knownEngines()
-{
- return DataEngineManager::listAllEngines();
-}
-
-QObject *PlasmaJs::dataEngine(const QString &name)
-{
- return m_webApplet->dataEngine(name);
-}
-
-QObject *PlasmaJs::config()
-{
- return m_webApplet->config();
-}
-
-QObject *PlasmaJs::globalConfig()
-{
- return m_webApplet->globalConfig();
-}
-
ConfigGroupWrapper::ConfigGroupWrapper(const KConfigGroup &config)
: m_config(config)
{
--- trunk/KDE/kdebase/workspace/plasma/generic/scriptengines/webkit/plasmajs.h \
#1069079:1069080 @@ -28,22 +28,6 @@
class PlasmaWebApplet;
-class PlasmaJs : public QObject
-{
- Q_OBJECT
-public:
- PlasmaJs(PlasmaWebApplet *parent=0);
-
-public Q_SLOTS:
- QStringList knownEngines();
- QObject *dataEngine(const QString &name);
- QObject *config();
- QObject *globalConfig();
-
-private:
- PlasmaWebApplet *m_webApplet;
-};
-
class DataEngineDataWrapper : public QObject
{
Q_OBJECT
--- trunk/KDE/kdebase/workspace/plasma/generic/scriptengines/webkit/plasmawebapplet.cpp \
#1069079:1069080 @@ -28,9 +28,10 @@
#include <KColorScheme>
-#include <Plasma/WebView>
+#include <Plasma/DataEngineManager>
#include <Plasma/Applet>
#include <Plasma/Theme>
+#include <Plasma/WebView>
#define JS_CONSTANTS_CONSTRAINT \
"var NoConstraint = %1;\n"\
@@ -262,6 +263,11 @@
return applet()->shouldConserveResources();
}
+QStringList PlasmaWebApplet::listAllDataEngines()
+{
+ return Plasma::DataEngineManager::listAllEngines();
+}
+
QObject* PlasmaWebApplet::dataEngine(const QString& name)
{
QString id = QString("%1").arg(applet()->id());
@@ -317,9 +323,9 @@
cmd += ',';
}
if (args[i].canConvert<QObject*>()) {
- cmd += QString("window.applet.objArg(%1)").arg(i);
+ cmd += QString("window.plasmoid.objArg(%1)").arg(i);
} else {
- cmd += QString("window.applet.arg(%1)").arg(i);
+ cmd += QString("window.plasmoid.arg(%1)").arg(i);
}
}
cmd += ')';
@@ -345,8 +351,7 @@
{
QWebFrame *frame = qobject_cast<QWebFrame*>(sender());
Q_ASSERT(frame);
- frame->addToJavaScriptWindowObject(QLatin1String("applet"), this);
- frame->addToJavaScriptWindowObject(QLatin1String("plasma"), new PlasmaJs(this));
+ frame->addToJavaScriptWindowObject(QLatin1String("plasmoid"), this);
}
QVariantList PlasmaWebApplet::geometry()
--- trunk/KDE/kdebase/workspace/plasma/generic/scriptengines/webkit/plasmawebapplet.h \
#1069079:1069080 @@ -39,6 +39,7 @@
Q_PROPERTY(QString category READ category)
Q_PROPERTY(int formFactor READ formFactor)
Q_PROPERTY(int location READ location)
+
public:
PlasmaWebApplet(QObject *parent, const QVariantList &args);
virtual ~PlasmaWebApplet();
@@ -55,6 +56,7 @@
int location() const;
public slots:
+ QStringList listAllDataEngines();
QObject* dataEngine(const QString& name);
QObject* config();
QObject* globalConfig();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic