From kde-commits Sun Jun 02 08:56:30 2013 From: =?utf-8?q?Pali=20Roh=C3=A1r?= Date: Sun, 02 Jun 2013 08:56:30 +0000 To: kde-commits Subject: KDE/kdenetwork/kopete/kopete Message-Id: <20130602085630.53CC8AC85D () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=137016337322045 SVN commit 1356778 by pali: In KopeteWindow handle destroying KopeteApplication and do not call slotIdentityStatusIconChanged and slotIdentityToolTipChanged when exiting - it cause crashing Kopete M +22 -0 kopetewindow.cpp M +1 -0 kopetewindow.h --- trunk/KDE/kdenetwork/kopete/kopete/kopetewindow.cpp #1356777:1356778 @@ -215,6 +215,7 @@ QPoint position; KHBox *statusBarWidget; KopeteSystemTray *tray; + bool appDestroyed; bool hidden; bool autoHide; unsigned int autoHideTimeout; @@ -255,6 +256,8 @@ KopeteWindow::KopeteWindow ( QWidget *parent ) : KXmlGuiWindow ( parent ), d ( new Private ) { + d->appDestroyed = false; + connect ( kapp, SIGNAL (destroyed()), this, SLOT (slotAppDestroyed()) ); setAttribute ( Qt::WA_DeleteOnClose, false ); setAttribute ( Qt::WA_QuitOnClose, false ); // Applications should ensure that their StatusBar exists before calling createGUI() @@ -340,6 +343,11 @@ toolBar ( "quickSearchBar" )->installEventFilter ( this ); } +void KopeteWindow::slotAppDestroyed() +{ + d->appDestroyed = true; +} + void KopeteWindow::initView() { QWidget *w = new QWidget ( this ); @@ -1001,6 +1009,13 @@ void KopeteWindow::slotIdentityToolTipChanged ( Kopete::Identity *identity ) { + if ( d->appDestroyed ) + return; + + KopeteApplication *app = static_cast ( kapp ); + if ( app->sessionSaving() || app->isShuttingDown() ) + return; + // Adds tooltip for each status icon, useful in case you have many accounts // over one protocol KopeteIdentityStatusBarIcon *i = d->identityStatusBarIcons.value ( identity, 0 ); @@ -1024,6 +1039,13 @@ // kDebug(14000) << "Icons: '" << // status.overlayIcons() << "'" << endl; + if ( d->appDestroyed ) + return; + + KopeteApplication *app = static_cast ( kapp ); + if ( app->sessionSaving() || app->isShuttingDown() ) + return; + if ( identity->onlineStatus() != Kopete::OnlineStatus::Connecting ) { // FIXME: It's not global status so don't save it --- trunk/KDE/kdenetwork/kopete/kopete/kopetewindow.h #1356777:1356778 @@ -73,6 +73,7 @@ void slotShowHide(); void slotToggleAway(); void slotNewInfoEvent(); + void slotAppDestroyed(); void setOnlineStatus( uint, const Kopete::StatusMessage& ); void setStatusMessage( const Kopete::StatusMessage& );