forked from qt-creator/qt-creator
Editor: Do not add to history twice for double clicking bookmarks
Activating a bookmark via a double click resulted in both signals getting emitted doubleClicked as well as activated, and both were connected to BookmarkView::gotoBookmark. So the goto code was executed twice resulting in adding the position to the navigation history twice. Fix this by only connecting to activated since this is always emitted alongside the doubleClicked signal as well as when the item is activated by keyboard. Fixes: QTCREATORBUG-30842 Change-Id: I48ea50afa105f81a2be8ac94096dd29164fce5fe Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -218,7 +218,6 @@ BookmarkView::BookmarkView()
|
|||||||
setDragEnabled(true);
|
setDragEnabled(true);
|
||||||
setDragDropMode(QAbstractItemView::DragDrop);
|
setDragDropMode(QAbstractItemView::DragDrop);
|
||||||
|
|
||||||
connect(this, &QAbstractItemView::doubleClicked, this, &BookmarkView::gotoBookmark);
|
|
||||||
connect(this, &QAbstractItemView::activated, this, &BookmarkView::gotoBookmark);
|
connect(this, &QAbstractItemView::activated, this, &BookmarkView::gotoBookmark);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user