From 977f1aceeb4f5f1693f98808ceeda6e58b3572f6 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 19 Jun 2012 20:05:06 +0200 Subject: [PATCH 1/4] prevent save of not loaded modules BUG:301507 --- applet.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/applet.cpp b/applet.cpp index ccab40ebd..104bff86c 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1922,6 +1922,8 @@ void Applet::showConfigurationInterface() #ifndef PLASMA_NO_KUTILS KCModuleProxy *module = new KCModuleProxy(kcm); if (module->realModule()) { + //preemptively load modules to prevent save() crashing on some kcms, like powerdevil ones + module->load(); connect(module, SIGNAL(changed(bool)), dialog, SLOT(settingsModified(bool))); connect(dialog, SIGNAL(okClicked()), module->realModule(), SLOT(save())); @@ -1938,6 +1940,7 @@ void Applet::showConfigurationInterface() QString error; KCModule *module = service->createInstance(dialog, QVariantList(), &error); if (module) { + module->load(); connect(module, SIGNAL(changed(bool)), dialog, SLOT(settingsModified(bool))); connect(dialog, SIGNAL(okClicked()), module, SLOT(save())); From 1b5bf827c6c5f001f3f218f864a2b6cc59a53903 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 21 Jun 2012 10:35:55 +0200 Subject: [PATCH 2/4] don't create handles when applet-in-applet yet another reason why this shouldn't be done ever BUG:301648 --- applet.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/applet.cpp b/applet.cpp index 104bff86c..bb2354cad 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1783,6 +1783,17 @@ bool Applet::sceneEventFilter(QGraphicsItem *watched, QEvent *event) case QEvent::GraphicsSceneHoverEnter: //kDebug() << "got hoverenterEvent" << immutability() << " " << immutability(); if (immutability() == Mutable) { + QGraphicsWidget *pw = this; + //This is for the rare case of applet in applet (systray) + //if the applet is in an applet that is not a containment, don't create the handle BUG:301648 + while (pw = pw->parentWidget()) { + if (qobject_cast(pw)) { + break; + } else if (qobject_cast(pw)) { + return false; + } + } + QGraphicsSceneHoverEvent *he = static_cast(event); if (d->handle) { d->handle.data()->setHoverPos(he->pos()); From 988737b128a45206ae24f79b35f83e6db8a88678 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 21 Jun 2012 15:32:52 +0200 Subject: [PATCH 3/4] fix behavior when hint-bar-stretch is present --- widgets/meter.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/widgets/meter.cpp b/widgets/meter.cpp index d1007e556..6d35275ee 100644 --- a/widgets/meter.cpp +++ b/widgets/meter.cpp @@ -184,10 +184,14 @@ void MeterPrivate::paintBar(QPainter *p, const QString &prefix) image->setUsingRenderingCache(false); if (image->hasElement("hint-bar-stretch")) { + const QSize imageSize = image->size(); + image->resize(); + image->setElementPrefix(prefix); image->resizeFrame(elementRect.size()); - image->paintFrame(p); + image->paintFrame(p, elementRect.topLeft()); + image->resize(imageSize); } else { - QSize imageSize = image->size(); + const QSize imageSize = image->size(); image->resize(); QSize tileSize = image->elementSize("bar-active-center"); From 5b735cfec0517efaa036e175847b33dbdbb30a49 Mon Sep 17 00:00:00 2001 From: Andre Woebbeking Date: Sun, 24 Jun 2012 23:10:16 +0200 Subject: [PATCH 4/4] -pedantic --- abstractrunner.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/abstractrunner.h b/abstractrunner.h index 6657820d6..63ed061bb 100644 --- a/abstractrunner.h +++ b/abstractrunner.h @@ -64,10 +64,10 @@ class PLASMA_EXPORT AbstractRunner : public QObject { Q_OBJECT Q_PROPERTY(bool matchingSuspended READ isMatchingSuspended WRITE suspendMatching NOTIFY matchingSuspended) - Q_PROPERTY(QString id READ id); - Q_PROPERTY(QString description READ description); - Q_PROPERTY(QString name READ name); - Q_PROPERTY(QIcon icon READ icon); + Q_PROPERTY(QString id READ id) + Q_PROPERTY(QString description READ description) + Q_PROPERTY(QString name READ name) + Q_PROPERTY(QIcon icon READ icon) public: /** Specifies a nominal speed for the runner */ enum Speed {