mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
- second attempt for drag n drop
This commit is contained in:
parent
cf6128a222
commit
685ceafc5b
1 changed files with 10 additions and 1 deletions
11
src/GUI.cpp
11
src/GUI.cpp
|
@ -528,7 +528,16 @@ void GUI::hideEvent(QHideEvent *e) {
|
|||
// Action executed when a file is dropped
|
||||
void GUI::dropEvent(QDropEvent *event) {
|
||||
event->acceptProposedAction();
|
||||
QStringList files=event->mimeData()->text().split(QString::fromUtf8("\n"));
|
||||
QStringList files;
|
||||
if(event->mimeData()->hasUrls()) {
|
||||
QList<QUrl> urls = event->mimeData()->urls();
|
||||
QUrl url;
|
||||
foreach(url, urls) {
|
||||
files << url.toString();
|
||||
}
|
||||
} else {
|
||||
files = event->mimeData()->text().split(QString::fromUtf8("\n"));
|
||||
}
|
||||
// Add file to download list
|
||||
QString file;
|
||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue