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);
|
||||
}
|
||||
|
||||
action->setIcon(icon.isEmpty() ? QIcon() : KIcon(icon));
|
||||
action->setShortcut(shortcut);
|
||||
if (!icon.isEmpty()) {
|
||||
action->setIcon(KIcon(icon));
|
||||
}
|
||||
|
||||
if (!shortcut.isEmpty()) {
|
||||
action->setShortcut(shortcut);
|
||||
}
|
||||
|
||||
action->setObjectName(name);
|
||||
}
|
||||
|
||||
|
@ -198,18 +198,8 @@ void SimpleJavaScriptApplet::popupEvent(bool popped)
|
||||
|
||||
void SimpleJavaScriptApplet::executeAction(const QString &name)
|
||||
{
|
||||
//callFunction("action_" + name);
|
||||
QScriptValue fun = m_self.property("action_" + name);
|
||||
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);
|
||||
}
|
||||
}
|
||||
QScriptValueList args;
|
||||
callFunction("action_" + name, args);
|
||||
}
|
||||
|
||||
void SimpleJavaScriptApplet::paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect &contentsRect)
|
||||
|
Loading…
Reference in New Issue
Block a user