diff --git a/applet.cpp b/applet.cpp index ed0777ea8..1ce002035 100644 --- a/applet.cpp +++ b/applet.cpp @@ -39,7 +39,6 @@ #include #include #include -#include #include #include @@ -1446,6 +1445,13 @@ QVariant Applet::itemChange(GraphicsItemChange change, const QVariant &value) break; case ItemPositionHasChanged: emit geometryChanged(); + // fall through! + case ItemTransformHasChanged: { + if (d->modificationsTimerId) { + killTimer(d->modificationsTimerId); + } + d->modificationsTimerId = startTimer(1000); + } break; default: break; @@ -1500,6 +1506,11 @@ void Applet::timerEvent(QTimerEvent *event) killTimer(d->constraintsTimerId); d->constraintsTimerId = 0; flushPendingConstraintsEvents(); + } else if (event->timerId() == d->modificationsTimerId) { + killTimer(d->modificationsTimerId); + KConfigGroup cg = config(); + save(cg); + emit configNeedsSaving(); } } @@ -1566,10 +1577,10 @@ AppletPrivate::AppletPrivate(KService::Ptr service, int uniqueID, Applet *applet extender(0), backgroundHints(Applet::StandardBackground), appletDescription(service), - package(0), needsConfigOverlay(0), background(0), script(0), + package(0), configXml(0), mainConfig(0), pendingConstraints(NoConstraint), @@ -1602,9 +1613,14 @@ AppletPrivate::~AppletPrivate() DataEngineManager::self()->unloadEngine( engine ); } + delete script; + script = 0; delete package; + package = 0; delete configXml; + configXml = 0; delete mainConfig; + mainConfig = 0; } void AppletPrivate::init() diff --git a/private/applet_p.h b/private/applet_p.h index d084ea043..c6a3e17b4 100644 --- a/private/applet_p.h +++ b/private/applet_p.h @@ -29,7 +29,6 @@ namespace Plasma class PanelSvg; class AppletScript; -class ShadowItem; class Wallpaper; class AppletOverlayWidget : public QGraphicsWidget @@ -62,7 +61,6 @@ public: QString instanceName(); void scheduleConstraintsUpdate(Plasma::Constraints c); KConfigGroup* mainConfigGroup(); - void copyEntries(KConfigGroup *source, KConfigGroup *destination); QString visibleFailureText(const QString& reason); void checkImmutability(); void themeChanged(); @@ -82,18 +80,17 @@ public: // number of members at this point. uint appletId; Applet *q; + Extender *extender; Applet::BackgroundHints backgroundHints; KPluginInfo appletDescription; - Package* package; AppletOverlayWidget *needsConfigOverlay; QList registeredAsDragHandle; QStringList loadedEngines; Plasma::PanelSvg *background; - //Plasma::LineEdit *failureText; AppletScript *script; - ConfigXml* configXml; - ShadowItem* shadow; + Package *package; + ConfigXml *configXml; KConfigGroup *mainConfig; Plasma::Constraints pendingConstraints; Plasma::AspectRatioMode aspectRatioMode; @@ -101,6 +98,7 @@ public: KActionCollection actions; KAction *activationAction; int constraintsTimerId; + int modificationsTimerId; bool hasConfigurationInterface : 1; bool failed : 1; bool isContainment : 1;