more simplifications thanks to ScriptEnv
svn path=/trunk/KDE/kdebase/runtime/; revision=1171463
This commit is contained in:
parent
bf35cc9176
commit
bb4f213215
@ -105,7 +105,7 @@ SimpleJavaScriptApplet::SimpleJavaScriptApplet(QObject *parent, const QVariantLi
|
||||
// TODO this will be set to the engine we get from QML
|
||||
m_engine = new QScriptEngine(this);
|
||||
m_env = new ScriptEnv(this, m_engine);
|
||||
connect(m_env, SIGNAL(reportError(ScriptEnv*,bool)), this, SLOT(engineReportsError(ScriptEnv*,bool)));
|
||||
connect(m_env, SIGNAL(reportError(ScriptEnv*,bool)), this, SLOT(reportError(ScriptEnv*,bool)));
|
||||
}
|
||||
|
||||
SimpleJavaScriptApplet::~SimpleJavaScriptApplet()
|
||||
@ -115,11 +115,6 @@ SimpleJavaScriptApplet::~SimpleJavaScriptApplet()
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleJavaScriptApplet::engineReportsError(ScriptEnv *engine, bool fatal)
|
||||
{
|
||||
reportError(engine, fatal);
|
||||
}
|
||||
|
||||
void SimpleJavaScriptApplet::reportError(ScriptEnv *env, bool fatal)
|
||||
{
|
||||
SimpleJavaScriptApplet *jsApplet = qobject_cast<SimpleJavaScriptApplet *>(env->parent());
|
||||
@ -137,7 +132,7 @@ void SimpleJavaScriptApplet::reportError(ScriptEnv *env, bool fatal)
|
||||
if (fatal) {
|
||||
jsApplet->setFailedToLaunch(true, failureMsg);
|
||||
} else {
|
||||
jsApplet->showMessage(KIcon("dialog-error"), failureMsg, Plasma::ButtonNone);
|
||||
jsApplet->showMessage(KIcon("dialog-error"), failureMsg, Plasma::ButtonOk);
|
||||
}
|
||||
} else {
|
||||
kDebug() << failureMsg;
|
||||
|
@ -47,7 +47,6 @@ public:
|
||||
~SimpleJavaScriptApplet();
|
||||
bool init();
|
||||
|
||||
static void reportError(ScriptEnv *error, bool fatal = false);
|
||||
|
||||
void paintInterface(QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect &contentsRect);
|
||||
QList<QAction*> contextualActions();
|
||||
@ -68,7 +67,7 @@ public Q_SLOTS:
|
||||
void activate();
|
||||
|
||||
private Q_SLOTS:
|
||||
void engineReportsError(ScriptEnv *engine, bool fatal);
|
||||
void reportError(ScriptEnv *error, bool fatal);
|
||||
|
||||
private:
|
||||
bool importExtensions();
|
||||
|
Loading…
Reference in New Issue
Block a user