mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-14 16:57:55 +00:00
Drag'n'Drop fixups.
1. Proper event handling 2. Allow folder moving 3. Allow moving into folders
This commit is contained in:
parent
4f667c6e7d
commit
562e9ce108
@ -173,19 +173,23 @@ void FeedListWidget::updateCurrentFeed(QTreeWidgetItem* new_item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FeedListWidget::dragMoveEvent(QDragMoveEvent * event) {
|
void FeedListWidget::dragMoveEvent(QDragMoveEvent * event) {
|
||||||
|
QTreeWidget::dragMoveEvent(event);
|
||||||
|
|
||||||
QTreeWidgetItem *item = itemAt(event->pos());
|
QTreeWidgetItem *item = itemAt(event->pos());
|
||||||
|
// Prohibit dropping onto global unread counter
|
||||||
if (item == m_unreadStickyItem) {
|
if (item == m_unreadStickyItem) {
|
||||||
event->ignore();
|
event->ignore();
|
||||||
} else {
|
return;
|
||||||
if (item && isFolder(item))
|
}
|
||||||
event->ignore();
|
// Prohibit dragging of global unread counter
|
||||||
else {
|
if (selectedItems().contains(m_unreadStickyItem)) {
|
||||||
if (selectedItems().contains(m_unreadStickyItem)) {
|
event->ignore();
|
||||||
event->ignore();
|
return;
|
||||||
} else {
|
}
|
||||||
QTreeWidget::dragMoveEvent(event);
|
// Prohibit dropping onto feeds
|
||||||
}
|
if (item && isFeed(item)) {
|
||||||
}
|
event->ignore();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user