clean up actions
svn path=/trunk/KDE/kdebase/runtime/; revision=1100980
This commit is contained in:
parent
791daecc22
commit
e0dbf4f1d8
@ -250,8 +250,14 @@ void AppletInterface::setAction(const QString &name, const QString &text, const
|
|||||||
m_actionSignals->setMapping(action, name);
|
m_actionSignals->setMapping(action, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
action->setIcon(icon.isEmpty() ? QIcon() : KIcon(icon));
|
if (!icon.isEmpty()) {
|
||||||
action->setShortcut(shortcut);
|
action->setIcon(KIcon(icon));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!shortcut.isEmpty()) {
|
||||||
|
action->setShortcut(shortcut);
|
||||||
|
}
|
||||||
|
|
||||||
action->setObjectName(name);
|
action->setObjectName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,18 +198,8 @@ void SimpleJavaScriptApplet::popupEvent(bool popped)
|
|||||||
|
|
||||||
void SimpleJavaScriptApplet::executeAction(const QString &name)
|
void SimpleJavaScriptApplet::executeAction(const QString &name)
|
||||||
{
|
{
|
||||||
//callFunction("action_" + name);
|
QScriptValueList args;
|
||||||
QScriptValue fun = m_self.property("action_" + name);
|
callFunction("action_" + name, args);
|
||||||
if (fun.isFunction()) {
|
|
||||||
QScriptContext *ctx = m_engine->pushContext();
|
|
||||||
ctx->setActivationObject(m_self);
|
|
||||||
fun.call(m_self);
|
|
||||||
m_engine->popContext();
|
|
||||||
|
|
||||||
if (m_engine->hasUncaughtException()) {
|
|
||||||
reportError(m_env);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleJavaScriptApplet::paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect &contentsRect)
|
void SimpleJavaScriptApplet::paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect &contentsRect)
|
||||||
|
Loading…
Reference in New Issue
Block a user