mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
Fix installing search plugin by drag-n-dropping file.
This commit is contained in:
parent
9cac51d9b0
commit
ac60072ded
1 changed files with 15 additions and 1 deletions
|
@ -82,7 +82,21 @@ engineSelectDlg::~engineSelectDlg() {
|
||||||
|
|
||||||
void engineSelectDlg::dropEvent(QDropEvent *event) {
|
void engineSelectDlg::dropEvent(QDropEvent *event) {
|
||||||
event->acceptProposedAction();
|
event->acceptProposedAction();
|
||||||
QStringList files = event->mimeData()->text().split(QString::fromUtf8("\n"));
|
QStringList files;
|
||||||
|
if (event->mimeData()->hasUrls()) {
|
||||||
|
const QList<QUrl> urls = event->mimeData()->urls();
|
||||||
|
foreach (const QUrl &url, urls) {
|
||||||
|
if (!url.isEmpty()) {
|
||||||
|
if (url.scheme().compare("file", Qt::CaseInsensitive) == 0)
|
||||||
|
files << url.toLocalFile();
|
||||||
|
else
|
||||||
|
files << url.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
files = event->mimeData()->text().split(QString::fromUtf8("\n"));
|
||||||
|
}
|
||||||
foreach (QString file, files) {
|
foreach (QString file, files) {
|
||||||
qDebug("dropped %s", qPrintable(file));
|
qDebug("dropped %s", qPrintable(file));
|
||||||
if (misc::isUrl(file)) {
|
if (misc::isUrl(file)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue