[Bug 81579] Crash using shortcut for Add Method...
Jens Dagerbo
jens.dagerbo at swipnet.se
Wed May 19 18:49:02 UTC 2004
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=81579
jens.dagerbo swipnet se changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
------- Additional Comments From jens.dagerbo swipnet se 2004-05-19 18:48 -------
CVS commit by dagerbo:
Don't crash when user attempts "add method" without selecting a class
(this is possible through the use of keyboard shortcuts)
CCMAIL: 81579-done bugs kde org
M +8 -0 classviewwidget.cpp 1.50
--- kdevelop/parts/classview/classviewwidget.cpp #1.49:1.50
@ -895,4 +895,6 @ void ClassViewWidget::slotNewClass( )
void ClassViewWidget::slotAddMethod( )
{
+ if ( !selectedItem() ) return;
+
if( m_part->languageSupport()->features() & KDevLanguageSupport::AddMethod )
m_part->languageSupport()->addMethod( static_cast<ClassDomBrowserItem*>( selectedItem() )->dom() );
@ -901,4 +903,6 @ void ClassViewWidget::slotAddMethod( )
void ClassViewWidget::slotAddAttribute( )
{
+ if ( !selectedItem() ) return;
+
if( m_part->languageSupport()->features() & KDevLanguageSupport::AddAttribute )
m_part->languageSupport()->addAttribute( static_cast<ClassDomBrowserItem*>( selectedItem() )->dom() );
@ -907,4 +911,6 @ void ClassViewWidget::slotAddAttribute(
void ClassViewWidget::slotOpenDeclaration( )
{
+ if ( !selectedItem() ) return;
+
static_cast<ClassViewItem*>( selectedItem() )->openDeclaration();
}
@ -912,4 +918,6 @ void ClassViewWidget::slotOpenDeclaratio
void ClassViewWidget::slotOpenImplementation( )
{
+ if ( !selectedItem() ) return;
+
static_cast<ClassViewItem*>( selectedItem() )->openImplementation();
}
More information about the KDevelop-devel
mailing list