mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
BookmarksToolbar: Fix drag and drop
- Fix crash - Fix bookmark final position Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
parent
6e7047f7ec
commit
06ea9c6b9c
@ -269,10 +269,15 @@ void BookmarksToolbar::dropEvent(QDropEvent* e)
|
|||||||
if (mime->hasFormat(BookmarksButtonMimeData::mimeType())) {
|
if (mime->hasFormat(BookmarksButtonMimeData::mimeType())) {
|
||||||
const auto* bookmarkMime = static_cast<const BookmarksButtonMimeData*>(mime);
|
const auto* bookmarkMime = static_cast<const BookmarksButtonMimeData*>(mime);
|
||||||
bookmark = bookmarkMime->item();
|
bookmark = bookmarkMime->item();
|
||||||
const int initialIndex = bookmark->parent()->children().indexOf(bookmark);
|
|
||||||
BookmarksToolbarButton* current = buttonAt(m_dropPos);
|
if (row < 0) {
|
||||||
if (initialIndex < m_layout->indexOf(current)) {
|
row = parent->children().count() - 1;
|
||||||
row -= 1;
|
}
|
||||||
|
else {
|
||||||
|
const int initialIndex = bookmark->parent()->children().indexOf(bookmark);
|
||||||
|
if ((row > 0) && (initialIndex < row)) {
|
||||||
|
row -= 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const QUrl url = mime->urls().at(0);
|
const QUrl url = mime->urls().at(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user