From kde-commits Tue Aug 31 20:49:42 2010 From: Marco Martin Date: Tue, 31 Aug 2010 20:49:42 +0000 To: kde-commits Subject: branches/KDE/4.5/kdelibs/plasma Message-Id: <20100831204942.8836CAC857 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=128328758306973 SVN commit 1170431 by mart: backport the earlier initialization of the size patch by Mivhael Seiwert M +10 -11 applet.cpp --- branches/KDE/4.5/kdelibs/plasma/applet.cpp #1170430:1170431 @@ -2655,6 +2655,12 @@ // but it doesn't actually work anyways =/ q->setLayoutDirection(qApp->layoutDirection()); + //set a default size before any saved settings are read + QSize size(200, 200); + q->setBackgroundHints(Applet::DefaultBackground); + q->setHasConfigurationInterface(true); //FIXME why not default it to true in the constructor? + + if (!appletDescription.isValid()) { kDebug() << "Check your constructor! " << "You probably want to be passing in a Service::Ptr " @@ -2662,6 +2668,10 @@ return; } + size = appletDescription.property("X-Plasma-DefaultSize").toSize(); + //kDebug() << "size" << size; + q->resize(size); + QString api = appletDescription.property("X-Plasma-API").toString(); // we have a scripted plasmoid @@ -2717,17 +2727,6 @@ } } - //set a default size before any saved settings are read - QSize size = appletDescription.property("X-Plasma-DefaultSize").toSize(); - if (size.isEmpty()) { - size = QSize(200, 200); - } - //kDebug() << "size" << size; - q->resize(size); - - q->setBackgroundHints(Applet::DefaultBackground); - q->setHasConfigurationInterface(true); //FIXME why not default it to true in the constructor? - QAction *closeApplet = actions->action("remove"); if (closeApplet) { closeApplet->setText(i18nc("%1 is the name of the applet", "Remove this %1", q->name()));