fixed selection crashes.
This commit is contained in:
		| @@ -91,26 +91,26 @@ void XQChildModel::addSectionEntry( const QString& key, const XQNodePtr& content | ||||
|  | ||||
| void XQChildModel::initContextMenu() | ||||
| { | ||||
|  | ||||
|   _sections.dump(); | ||||
|  | ||||
|   // __fixme! add a menu title | ||||
|   _contextMenu->clear(); | ||||
|  | ||||
|   const QModelIndex& curIdx = _treeTable->currentIndex(); | ||||
|   bool hasSel = curIdx.isValid() && _treeTable->selectionModel()->hasSelection(); | ||||
|   bool canPaste = _clipBoard.canPaste( curIdx ); | ||||
|  | ||||
|   _contextMenu->addAction( "icn11Dummy", "Undo",   XQCommand::cmdUndo,   _undoStack->canUndo() ); | ||||
|   _contextMenu->addAction( "icn17Dummy", "Redo",   XQCommand::cmdRedo,   _undoStack->canRedo() ); | ||||
|  | ||||
|   _contextMenu->addAction( "icn58Dummy", "Cut",    XQCommand::cmdCut,    hasSel ); | ||||
|   _contextMenu->addAction( "icn61Dummy", "Paste",  XQCommand::cmdPaste, canPaste ); | ||||
|   _contextMenu->addAction( "icn55Dummy", "Copy",   XQCommand::cmdCopy,   hasSel ); | ||||
|   //_contextMenu->addAction( "icn35Dummy", "Move",   XQCommand::cmdMove,   hasSel ); | ||||
|   _contextMenu->addAction( "icn70Dummy", "New",    XQCommand::cmdNew,    hasSel ); | ||||
|   _contextMenu->addAction( "icn50Dummy", "Delete", XQCommand::cmdDelete, hasSel ); | ||||
|   // editieren nur wenns kein header ist. | ||||
|   if ( !xqItemFromIndex(curIdx).isHeaderStyle() ) | ||||
|   { | ||||
|     bool hasSel = curIdx.isValid() && _treeTable->selectionModel()->hasSelection(); | ||||
|     bool canPaste = _clipBoard.canPaste( curIdx ); | ||||
|  | ||||
|     _contextMenu->addAction( "icn58Dummy", "Cut",    XQCommand::cmdCut,    hasSel ); | ||||
|     _contextMenu->addAction( "icn61Dummy", "Paste",  XQCommand::cmdPaste, canPaste ); | ||||
|     _contextMenu->addAction( "icn55Dummy", "Copy",   XQCommand::cmdCopy,   hasSel ); | ||||
|     //_contextMenu->addAction( "icn35Dummy", "Move",   XQCommand::cmdMove,   hasSel ); | ||||
|     _contextMenu->addAction( "icn70Dummy", "New",    XQCommand::cmdNew,    hasSel ); | ||||
|     _contextMenu->addAction( "icn50Dummy", "Delete", XQCommand::cmdDelete, hasSel ); | ||||
|   } | ||||
|   // __fixme! set 'toggle section <name>' entry | ||||
|   //contextMenu.actions().first()->setText("<name>"); | ||||
|   _contextMenu->addAction( "icn29Dummy", "Hide Section", XQCommand::cmdToggleSection, true ); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user