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;
|
kDebug() << msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AppletInterface::gc()
|
||||||
|
{
|
||||||
|
QTimer::singleShot(0, m_appletScriptEngine, SLOT(collectGarbage()));
|
||||||
|
}
|
||||||
|
|
||||||
#include "appletinterface.moc"
|
#include "appletinterface.moc"
|
||||||
|
@ -171,6 +171,7 @@ enum QtScrollBarPolicy {
|
|||||||
};
|
};
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
|
|
||||||
|
Q_INVOKABLE void gc();
|
||||||
Q_INVOKABLE FormFactor formFactor() const;
|
Q_INVOKABLE FormFactor formFactor() const;
|
||||||
|
|
||||||
Location location() const;
|
Location location() const;
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
#include <Plasma/VideoWidget>
|
#include <Plasma/VideoWidget>
|
||||||
|
|
||||||
#include "appletinterface.h"
|
#include "appletinterface.h"
|
||||||
#include "qtgui/filedialogproxy.h"
|
#include "simplebindings/filedialogproxy.h"
|
||||||
|
|
||||||
using namespace Plasma;
|
using namespace Plasma;
|
||||||
|
|
||||||
@ -915,6 +915,12 @@ QScriptValue SimpleJavaScriptApplet::variantToScriptValue(QVariant var)
|
|||||||
return ::variantToScriptValue(m_engine, var);
|
return ::variantToScriptValue(m_engine, var);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SimpleJavaScriptApplet::collectGarbage()
|
||||||
|
{
|
||||||
|
kDebug();
|
||||||
|
m_engine->collectGarbage();
|
||||||
|
}
|
||||||
|
|
||||||
K_EXPORT_PLASMA_APPLETSCRIPTENGINE(qscriptapplet, SimpleJavaScriptApplet)
|
K_EXPORT_PLASMA_APPLETSCRIPTENGINE(qscriptapplet, SimpleJavaScriptApplet)
|
||||||
|
|
||||||
#include "simplejavascriptapplet.moc"
|
#include "simplejavascriptapplet.moc"
|
||||||
|
@ -57,6 +57,7 @@ public slots:
|
|||||||
void dataUpdated( const QString &name, const Plasma::DataEngine::Data &data );
|
void dataUpdated( const QString &name, const Plasma::DataEngine::Data &data );
|
||||||
void configChanged();
|
void configChanged();
|
||||||
void executeAction(const QString &name);
|
void executeAction(const QString &name);
|
||||||
|
void collectGarbage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool importExtensions();
|
bool importExtensions();
|
||||||
|
Loading…
Reference in New Issue
Block a user