mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
- Added drag'n Drop from torrent list to labels (for torrent labeling)
- Fix label counters update in some cases
This commit is contained in:
parent
868d423c82
commit
18bd3b855c
5 changed files with 77 additions and 7 deletions
24
src/GUI.cpp
24
src/GUI.cpp
|
@ -598,8 +598,28 @@ void GUI::dragEnterEvent(QDragEnterEvent *event) {
|
|||
foreach(const QString &mime, event->mimeData()->formats()){
|
||||
qDebug("mimeData: %s", mime.toLocal8Bit().data());
|
||||
}
|
||||
if (event->mimeData()->hasFormat(QString::fromUtf8("text/plain")) || event->mimeData()->hasFormat(QString::fromUtf8("text/uri-list"))) {
|
||||
event->acceptProposedAction();
|
||||
if (event->mimeData()->hasFormat("application/x-qstandarditemmodeldatalist")) {
|
||||
if(childAt(event->pos()) == transferListFilters) {
|
||||
qDebug("DragEnterEvent: torrent to filter list, accepting...");
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
} else {
|
||||
if (event->mimeData()->hasFormat(QString::fromUtf8("text/plain")) || event->mimeData()->hasFormat(QString::fromUtf8("text/uri-list"))) {
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GUI::dragMoveEvent(QDragMoveEvent *event) {
|
||||
if (event->mimeData()->hasFormat("application/x-qstandarditemmodeldatalist")) {
|
||||
if(childAt(event->pos()) == transferListFilters) {
|
||||
qDebug("DragMoveEvent: torrent to filter list, accepting...");
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
} else {
|
||||
if (event->mimeData()->hasFormat(QString::fromUtf8("text/plain")) || event->mimeData()->hasFormat(QString::fromUtf8("text/uri-list"))) {
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue