Merge pull request #683 from Gelmir/rss_proper_drag_move

Fix Drag/Move event in RSS widget
This commit is contained in:
sledgehammer999 2013-06-30 12:50:15 -07:00
commit 647f81ff84

View File

@ -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();
} else { return;
QTreeWidget::dragMoveEvent(event);
}
} }
// Prohibit dropping onto feeds
if (item && isFeed(item)) {
event->ignore();
return;
} }
} }