Changeset 14092


Ignore:
Timestamp:
Jun 9, 2013, 8:18:47 PM (9 years ago)
Author:
jordan
Message:

(trunk, qt) #5374 handle multifile drag-and-drop in Qt client, patch by kernel_daemon

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/mainwin.cc

    r14008 r14092  
    14081408TrMainWindow :: dropEvent (QDropEvent * event)
    14091409{
    1410   QString key = event->mimeData ()->text ().trimmed ();
    1411 
    1412   const QUrl url (key);
    1413   if (url.scheme () == "file")
    1414     key = QUrl::fromPercentEncoding (url.path ().toUtf8 ());
    1415 
    1416   dynamic_cast<MyApp*> (QApplication::instance ())->addTorrent (key);
     1410  const QStringList list = event->mimeData()->text().trimmed().split('\n');
     1411
     1412  foreach (QString entry, list)
     1413    {
     1414      QString key = entry.trimmed();
     1415
     1416      if (!key.isEmpty())
     1417        {
     1418          const QUrl url (key);
     1419
     1420          if (url.scheme () == "file")
     1421            key = QUrl::fromPercentEncoding (url.path().toUtf8());
     1422
     1423          dynamic_cast<MyApp*> (QApplication::instance ())->addTorrent (key);
     1424        }
     1425    }
     1426
     1427  qDebug() << "Added " << list.size() << " entries.";
    14171428}
    14181429
Note: See TracChangeset for help on using the changeset viewer.