add a delayed gc() for convenience so one doesn't have to set up a timer in the script to do that (leaving the timer itself behind in all likliehood *sigh*)
svn path=/trunk/KDE/kdebase/runtime/; revision=1051138
This commit is contained in:
parent
8ff52246b7
commit
9d9d849d72
@ -336,4 +336,9 @@ void AppletInterface::debug(const QString &msg)
|
||||
kDebug() << msg;
|
||||
}
|
||||
|
||||
void AppletInterface::gc()
|
||||
{
|
||||
QTimer::singleShot(0, m_appletScriptEngine, SLOT(collectGarbage()));
|
||||
}
|
||||
|
||||
#include "appletinterface.moc"
|
||||
|
@ -171,6 +171,7 @@ enum QtScrollBarPolicy {
|
||||
};
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
Q_INVOKABLE void gc();
|
||||
Q_INVOKABLE FormFactor formFactor() const;
|
||||
|
||||
Location location() const;
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <Plasma/VideoWidget>
|
||||
|
||||
#include "appletinterface.h"
|
||||
#include "qtgui/filedialogproxy.h"
|
||||
#include "simplebindings/filedialogproxy.h"
|
||||
|
||||
using namespace Plasma;
|
||||
|
||||
@ -915,6 +915,12 @@ QScriptValue SimpleJavaScriptApplet::variantToScriptValue(QVariant var)
|
||||
return ::variantToScriptValue(m_engine, var);
|
||||
}
|
||||
|
||||
void SimpleJavaScriptApplet::collectGarbage()
|
||||
{
|
||||
kDebug();
|
||||
m_engine->collectGarbage();
|
||||
}
|
||||
|
||||
K_EXPORT_PLASMA_APPLETSCRIPTENGINE(qscriptapplet, SimpleJavaScriptApplet)
|
||||
|
||||
#include "simplejavascriptapplet.moc"
|
||||
|
@ -57,6 +57,7 @@ public slots:
|
||||
void dataUpdated( const QString &name, const Plasma::DataEngine::Data &data );
|
||||
void configChanged();
|
||||
void executeAction(const QString &name);
|
||||
void collectGarbage();
|
||||
|
||||
private:
|
||||
bool importExtensions();
|
||||
|
Loading…
Reference in New Issue
Block a user