From kde-commits Wed Jan 21 22:22:29 2009 From: Sebastian Sauer Date: Wed, 21 Jan 2009 22:22:29 +0000 To: kde-commits Subject: KDE/kdebase/workspace/plasma/applets/kickoff/simpleapplet Message-Id: <1232576549.308219.15505.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=123257655707235 SVN commit 914866 by sebsauer: another crash-workaround. guess I should to the 'MergeModel' soon M +14 -2 simpleapplet.cpp M +1 -0 simpleapplet.h --- trunk/KDE/kdebase/workspace/plasma/applets/kickoff/simpleapplet/simpleapplet.cpp #914865:914866 @@ -422,8 +422,7 @@ if (!d->menuview) { d->menuview = new Kickoff::MenuView(); connect(d->menuview, SIGNAL(triggered(QAction*)), this, SLOT(actionTriggered(QAction*))); - connect(d->menuview, SIGNAL(aboutToHide()), d->icon, SLOT(setUnpressed())); - connect(d->menuview, SIGNAL(aboutToHide()), d->menuview, SLOT(deleteLater())); + connect(d->menuview, SIGNAL(aboutToHide()), this, SLOT(aboutToHideMenu())); switch (d->viewtype) { case Combined: { @@ -547,6 +546,19 @@ d->icon->setPressed(); } +void MenuLauncherApplet::aboutToHideMenu() +{ + d->icon->setUnpressed(); + if(d->menuview) { + //sebsauer, 2009-01-21; another dirty hack; delay destruction else it crashes in the KIconLoader + //dtor for whatever reason (rather hard to reproduce). Solution for this and the other hacks + //would be to finally get right of the way we build the menu by providing a model that does + //handle merging of the other models und updating the menus if content changes. + QTimer::singleShot(100, d->menuview, SLOT(delayedDestruct())); + d->menuview = 0; + } +} + void MenuLauncherApplet::actionTriggered(QAction *action) { KUrl url = action->data().value(); --- trunk/KDE/kdebase/workspace/plasma/applets/kickoff/simpleapplet/simpleapplet.h #914865:914866 @@ -111,6 +111,7 @@ void configAccepted(); void toggleMenu(bool pressed); void toggleMenu(); + void aboutToHideMenu(); void actionTriggered(QAction *action); private: