X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=blobdiff_plain;f=src%2Fwidgets%2FDraggableTreeView.cpp;fp=src%2Fwidgets%2FDraggableTreeView.cpp;h=b6a28da6896e7ea4460469620b81add1847790cf;hp=6471b08b4bf0f6ffba130efce540e9215421017f;hb=ccb069f69e240c890f4f8b921e89c41d8e100589;hpb=03d1e9e85a1fc8c7f561d0c7d9492ef1bee292db 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);