Summary: | Crash using shortcut for Add Method... | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Steven T. Hatton <hattons> |
Component: | general | Assignee: | KDevelop Developers <kdevelop-devel> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Steven T. Hatton
2004-05-14 16:04:08 UTC
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(); } CVS commit by dagerbo: BACKPORT Don't crash when user attempts "add method" without selecting a class (this is possible through the use of keyboard shortcuts) CCMAIL: 81579@bugs.kde.org M +8 -2 classviewwidget.cpp 1.48.2.1 --- kdevelop/parts/classview/classviewwidget.cpp #1.48:1.48.2.1 @@ -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(); } @@ -940,6 +948,4 @@ bool FunctionDomBrowserItem::hasImplemen void ClassViewWidget::maybeTip( QPoint const & p ) { - kdDebug(0) << "ClassViewWidget::maybeTip()" << endl; - ClassViewItem * item = dynamic_cast<ClassViewItem*>( itemAt( p ) ); if ( !item ) return; |