when an extender is created on an applet without an extender and it is a popup applet without an explicitly defined graphicsWidget, make it re-check the layout so it creates a dialog or whatever when appropriate based on having a graphicsWidget now

svn path=/trunk/KDE/kdelibs/; revision=1180038
This commit is contained in:
Aaron J. Seigo 2010-09-26 20:19:11 +00:00
parent 9d89e5519a
commit 03f8db0342

View File

@ -44,6 +44,7 @@
#include "private/extenderapplet_p.h"
#include "private/extenderitem_p.h"
#include "private/extenderitemmimedata_p.h"
#include "private/popupapplet_p.h"
namespace Plasma
{
@ -91,7 +92,13 @@ Extender::Extender(Applet *applet)
kWarning() << "Applet already has an extender, and can have only one extender."
<< "The previous extender will be destroyed.";
delete applet->d->extender.data();
} else if (PopupApplet *popup = qobject_cast<PopupApplet *>(applet)) {
if (!popup->d->graphicsWidget) {
// ensure the popup gets a dialog with us as the graphics widget
popup->d->popupConstraintsEvent(SizeConstraint);
}
}
applet->d->extender = this;
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);