[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdenetwork/kopete/kopete/chatwindow
From:       Roman Jarosz <kedgedev () gmail ! com>
Date:       2009-10-30 20:59:33
Message-ID: 1256936373.825999.9026.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1042843 by rjarosz:

Fix crash when sendMessage or m_activeView is null.
BUG: 209994



 M  +6 -3      kopetechatwindow.cpp  


--- trunk/KDE/kdenetwork/kopete/kopete/chatwindow/kopetechatwindow.cpp #1042842:1042843
@@ -351,6 +351,9 @@
 
 void KopeteChatWindow::updateSendKeySequence()
 {
+	if ( !sendMessage || !m_activeView )
+		return;
+
 	m_activeView->editPart()->textEdit()->setSendKeySequence( sendMessage->shortcut() );
 }
 
@@ -363,6 +366,8 @@
 	chatSend = new KAction( KIcon("mail-send"), i18n( "&Send Message" ), coll );
 	//Recuperate the qAction for later
 	sendMessage = coll->addAction( "chat_send", chatSend );
+	//Set up change signal in case the user changer the shortcut later
+	connect( sendMessage, SIGNAL(changed()), SLOT(updateSendKeySequence()) );
 
 	connect( chatSend, SIGNAL( triggered(bool) ), SLOT( slotSendMessage() ) );
 	//Default to 'Return' and 'Enter' for sending messages
@@ -998,9 +1003,7 @@
 	updateActions();
 	slotUpdateSendEnabled();
 	m_activeView->loadChatSettings();
-	m_activeView->editPart()->textEdit()->setSendKeySequence( sendMessage->shortcut() );
-	//Set up change signal in case the user changer the shortcut later
-	connect( sendMessage, SIGNAL(changed()), SLOT(updateSendKeySequence()) );
+	updateSendKeySequence();
 
 	emit chatSessionChanged(m_activeView->msgManager());
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic