r16441 by craig - #9827: Fix crash due to shortcut widget change

scribus-commit scribus-commit at lists.scribus.net
Fri Mar 11 23:33:54 CET 2011


Author: craig
Date: Fri Mar 11 22:33:53 2011
New Revision: 16441

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16441
Log:
#9827: Fix crash due to shortcut widget change

Modified:
    trunk/Scribus/scribus/ui/stylemanager.cpp

Modified: trunk/Scribus/scribus/ui/stylemanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16441&path=/trunk/Scribus/scribus/ui/stylemanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/stylemanager.cpp (original)
+++ trunk/Scribus/scribus/ui/stylemanager.cpp Fri Mar 11 22:33:53 2011
@@ -1053,7 +1053,8 @@
 		QMessageBox::information(this, CommonStrings::trWarning,
 		                         tr("This key sequence is already in use"),
 		                         CommonStrings::tr_OK);
-		m_shortcutWidget->setShortcut(m_item->shortcut(sitem->text(NAME_COL)));
+		if (m_shortcutWidget)
+			m_shortcutWidget->setShortcut(m_item->shortcut(sitem->text(NAME_COL)));
 		return;
 	}
 
@@ -1144,16 +1145,22 @@
 		{
 			nameEdit->setText( tr("More than one style selected"));
 			nameEdit->setEnabled(false);
-			m_shortcutWidget->setEnabled(false);
-			m_shortcutWidget->setShortcut(QString::null);
+			if (m_shortcutWidget)
+			{
+				m_shortcutWidget->setEnabled(false);
+				m_shortcutWidget->setShortcut(QString::null);
+			}
 		}
 		else
 		{
 			nameEdit->setText(selection.second[0]);
 // 			qDebug() << selection.second[0] << m_item->isDefaultStyle(selection.second[0]);
 			nameEdit->setEnabled(! (m_item->isDefaultStyle(selection.second[0])));
-			m_shortcutWidget->setEnabled(true);
-			m_shortcutWidget->setShortcut(m_item->shortcut(selection.second[0]));
+			if (m_shortcutWidget)
+			{
+				m_shortcutWidget->setEnabled(true);
+				m_shortcutWidget->setShortcut(m_item->shortcut(selection.second[0]));
+			}
 		}
 	}
 	else




More information about the scribus-commit mailing list