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

List:       kde-commits
Subject:    branches/kdevelop/3.4/languages/cpp
From:       Jens Dagerbo <jens.dagerbo () swipnet ! se>
Date:       2007-01-27 1:36:40
Message-ID: 1169861800.475153.19648.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 627555 by dagerbo:

make actions without a menu entry work:
1. a "hidden" menu in the ui.rc file that is not inside the <MenuBar> tag
2. a dummy QWidget to plug in

result: navigate context menu (default: ctrl+alt+space) and 
jump to declaration/definition (default: ctrl+',' / ctrl+'.') actions work 

 M  +8 -3      cppcodecompletion.cpp  
 M  +4 -0      cppcodecompletion.h  
 M  +5 -5      cppsupportpart.cpp  
 M  +4 -0      cppsupportpart.h  
 M  +7 -2      kdevcppsupport.rc  


--- branches/kdevelop/3.4/languages/cpp/cppcodecompletion.cpp #627554:627555
@@ -869,9 +869,14 @@
            this, SLOT( slotFileParsed( const QString& ) ) );
   connect( part, SIGNAL( codeModelUpdated( const QString& ) ),
            this, SLOT( slotCodeModelUpdated( const QString& ) ) );
-	
-	new KAction( i18n("Jump to declaration under cursor"), CTRL+Key_Comma, this, \
SLOT(slotJumpToDeclCursorContext()), part->actionCollection(), \
                "jump_to_declaration_cursor_context" );
-	new KAction( i18n("Jump to definition under cursor"), CTRL+Key_Period, this, \
SLOT(slotJumpToDefCursorContext()), part->actionCollection(), \
"jump_to_defintion_cursor_context" ); +
+  KAction * action = new KAction( i18n("Jump to declaration under cursor"), 0, CTRL \
+ Key_Comma, +    this, SLOT(slotJumpToDeclCursorContext()), \
part->actionCollection(), "jump_to_declaration_cursor_context" ); +  action->plug( \
&m_DummyActionWidget ); +
+  action = new KAction( i18n("Jump to definition under cursor"), 0, CTRL + \
Key_Period,  +    this, SLOT(slotJumpToDefCursorContext()), part->actionCollection(), \
"jump_to_defintion_cursor_context" ); +  action->plug( &m_DummyActionWidget );
 }
 
 CppCodeCompletion::~CppCodeCompletion( ) {
--- branches/kdevelop/3.4/languages/cpp/cppcodecompletion.h #627554:627555
@@ -310,6 +310,10 @@
     PopupActions m_popupActions;
     PopupActions m_popupDefinitionActions;
     PopupClassViewActions m_popupClassViewActions;
+	
+	// we need something to plug actions that are not in any menu 
+	// into in order for their shortcuts to work
+	QWidget m_DummyActionWidget;
 };
 
 #endif 
--- branches/kdevelop/3.4/languages/cpp/cppsupportpart.cpp #627554:627555
@@ -281,16 +281,16 @@
 	action->setToolTip( i18n( "Make member" ) );
 	action->setWhatsThis( i18n( "<b>Make member</b><p>Creates a class member function \
                in implementation file "
 	                            "based on the member declaration at the current line." \
                ) );
-	action->plug( new QWidget() );
-
+	action->plug( &m_DummyActionWidget );
+	
 	action = new KAction( i18n( "Navigation Menu" ), 0, CTRL + ALT + Key_Space,
 	                      this, SLOT( slotNavigate() ),
 	                      actionCollection(), "edit_navigate" );
 	action->setToolTip( i18n( "Show the navigation-menu" ) );
 	action->setWhatsThis( i18n( "<b>Navigate</b><p>Shows a navigation-menu based on the \
                type-evaluation of the item under the cursor." ) );
-	action->plug( new QWidget() );
+	action->plug( &m_DummyActionWidget );
+	
 
-
 	action = new KAction( i18n( "New Class..." ), "classnew", 0,
 	                      this, SLOT( slotNewClass() ),
 	                      actionCollection(), "project_newclass" );
@@ -544,7 +544,7 @@
 
 	m_pCompletion = new CppCodeCompletion( this );
 	m_projectClosed = false;
-
+	
 	QTimer::singleShot( 500, this, SLOT( initialParse( ) ) );
 }
 
--- branches/kdevelop/3.4/languages/cpp/cppsupportpart.h #627554:627555
@@ -517,6 +517,10 @@
 	friend class KDevCppSupportIface;
 	friend class CppDriver;
 
+	// we need something to plug actions that are not in any menu 
+	// into in order for their shortcuts to work
+	QWidget m_DummyActionWidget;
+	
 	void emitSynchronousParseReady( const QString& file, ParsedFilePointer unit );
 
 	struct JobData
--- branches/kdevelop/3.4/languages/cpp/kdevcppsupport.rc #627554:627555
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui name="KDevCppSupport" version="8">
+<kpartgui name="KDevCppSupport" version="9">
 <MenuBar>
  <Menu name="edit">
   <Action name="edit_complete_text"/>
@@ -17,7 +17,12 @@
   <Action name="project_newclass" group="project_classes"/>
  </Menu>
 </MenuBar>
-
+ <Menu name="hidden">
+  <Action name="edit_create_getter_setter"/>
+  <Action name="edit_navigate"/>
+  <Action name="jump_to_declaration_cursor_context"/>
+  <Action name="jump_to_defintion_cursor_context"/>
+ </Menu> 
 <ToolBar name="browserToolBar" position="Top" iconText="IconOnly">
   <Action name="project_newclass"/>
 </ToolBar>


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

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