From ccb069f69e240c890f4f8b921e89c41d8e100589 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Wed, 10 Jan 2024 16:09:41 -0700 Subject: [PATCH] Fix moving a bookmark to a specific location in a different folder. https://redmine.stoutner.com/issues/1149 --- src/widgets/DraggableTreeView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/widgets/DraggableTreeView.cpp b/src/widgets/DraggableTreeView.cpp index 6471b08..b6a28da 100644 --- a/src/widgets/DraggableTreeView.cpp +++ b/src/widgets/DraggableTreeView.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2023 Soren Stoutner . + * Copyright 2023-2024 Soren Stoutner . * * This file is part of Privacy Browser PC . * @@ -62,7 +62,7 @@ void DraggableTreeView::dropEvent(QDropEvent *dropEvent) // Process the move according to the drop position. switch (dropPosition) { - case QAbstractItemView::OnItem: + case QAbstractItemView::OnItem: // This will only ever be called for folders as `BookmarksDialog::populateSubfolders` creates bookmarks without `setDropEnabled`. { // Get the new parent folder ID. double newParentFolderId = dropModelIndex.siblingAtColumn(BookmarksDialog::FOLDER_ID_COLUMN).data().toDouble(); @@ -109,7 +109,7 @@ void DraggableTreeView::dropEvent(QDropEvent *dropEvent) int dropDisplayOrder = dropModelIndex.siblingAtColumn(BookmarksDialog::DISPLAY_ORDER_COLUMN).data().toInt(); // Get the drop parent folder ID. - double dropParentFolderId = dropModelIndex.parent().siblingAtColumn(BookmarksDialog::FOLDER_ID_COLUMN).data().toInt(); + double dropParentFolderId = dropModelIndex.parent().siblingAtColumn(BookmarksDialog::FOLDER_ID_COLUMN).data().toDouble(); // Get a list of all the items in the target folder except those selected. QList *itemsInFolderExceptSelectedListPointer = BookmarksDatabase::getBookmarksInFolderExcept(dropParentFolderId, selectedDatabaseIdsListPointer); @@ -157,7 +157,7 @@ void DraggableTreeView::dropEvent(QDropEvent *dropEvent) int dropDisplayOrder = dropModelIndex.siblingAtColumn(BookmarksDialog::DISPLAY_ORDER_COLUMN).data().toInt(); // Get the drop parent folder ID. - double dropParentFolderId = dropModelIndex.parent().siblingAtColumn(BookmarksDialog::FOLDER_ID_COLUMN).data().toInt(); + double dropParentFolderId = dropModelIndex.parent().siblingAtColumn(BookmarksDialog::FOLDER_ID_COLUMN).data().toDouble(); // Get a list of all the items in the target folder except those selected. QList *itemsInFolderExceptSelectedListPointer = BookmarksDatabase::getBookmarksInFolderExcept(dropParentFolderId, selectedDatabaseIdsListPointer); -- 2.43.0