crash-- move after first call to applet()

This commit is contained in:
Marco Martin 2011-07-11 22:44:05 +02:00
parent 1d5ec8c2e0
commit 756b3f1685
2 changed files with 2 additions and 3 deletions

View File

@ -70,7 +70,6 @@ DeclarativeAppletScript::DeclarativeAppletScript(QObject *parent, const QVariant
m_env(0), m_env(0),
m_auth(this) m_auth(this)
{ {
KGlobal::locale()->insertCatalog(description().pluginName());
Q_UNUSED(args); Q_UNUSED(args);
} }
@ -82,6 +81,7 @@ bool DeclarativeAppletScript::init()
{ {
m_declarativeWidget = new Plasma::DeclarativeWidget(applet()); m_declarativeWidget = new Plasma::DeclarativeWidget(applet());
m_declarativeWidget->setInitializationDelayed(true); m_declarativeWidget->setInitializationDelayed(true);
KGlobal::locale()->insertCatalog(description().pluginName());
//make possible to import extensions from the package //make possible to import extensions from the package
//FIXME: probably to be removed, would make possible to use native code from within the package :/ //FIXME: probably to be removed, would make possible to use native code from within the package :/

View File

@ -105,8 +105,6 @@ SimpleJavaScriptApplet::SimpleJavaScriptApplet(QObject *parent, const QVariantLi
Q_UNUSED(args); Q_UNUSED(args);
// kDebug() << "Script applet launched, args" << applet()->startupArguments(); // kDebug() << "Script applet launched, args" << applet()->startupArguments();
KGlobal::locale()->insertCatalog(description().pluginName());
// TODO this will be set to the engine we get from QML // TODO this will be set to the engine we get from QML
m_engine = new QScriptEngine(this); m_engine = new QScriptEngine(this);
m_env = new ScriptEnv(this, m_engine); m_env = new ScriptEnv(this, m_engine);
@ -311,6 +309,7 @@ bool SimpleJavaScriptApplet::init()
this, SLOT(extenderItemRestored(Plasma::ExtenderItem*))); this, SLOT(extenderItemRestored(Plasma::ExtenderItem*)));
connect(applet(), SIGNAL(activate()), connect(applet(), SIGNAL(activate()),
this, SLOT(activate())); this, SLOT(activate()));
KGlobal::locale()->insertCatalog(description().pluginName());
setupObjects(); setupObjects();
AppletAuthorization auth(this); AppletAuthorization auth(this);