From 6b1e7eff93e5db580e94f8a9f6a6b31f389a8061 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 20 Jun 2024 13:58:56 +0200 Subject: [PATCH] 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 --- src/plugins/texteditor/bookmarkmanager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/texteditor/bookmarkmanager.cpp b/src/plugins/texteditor/bookmarkmanager.cpp index a61cc587363..625eca0c251 100644 --- a/src/plugins/texteditor/bookmarkmanager.cpp +++ b/src/plugins/texteditor/bookmarkmanager.cpp @@ -218,7 +218,6 @@ BookmarkView::BookmarkView() setDragEnabled(true); setDragDropMode(QAbstractItemView::DragDrop); - connect(this, &QAbstractItemView::doubleClicked, this, &BookmarkView::gotoBookmark); connect(this, &QAbstractItemView::activated, this, &BookmarkView::gotoBookmark); }