Changeset 14098


Ignore:
Timestamp:
Jun 26, 2013, 1:48:47 AM (9 years ago)
Author:
jordan
Message:

(trunk, qt) #5374: add url support for dragging-and-dropping multiple URLs into transmission-qt. patch by rb07

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/mainwin.cc

    r14092 r14098  
    14001400
    14011401  if (mime->hasFormat ("application/x-bittorrent")
     1402        || mime->hasUrls()
    14021403        || mime->text ().trimmed ().endsWith (".torrent", Qt::CaseInsensitive)
    14031404        || mime->text ().startsWith ("magnet:", Qt::CaseInsensitive))
     
    14081409TrMainWindow :: dropEvent (QDropEvent * event)
    14091410{
    1410   const QStringList list = event->mimeData()->text().trimmed().split('\n');
     1411  QStringList list;
     1412
     1413  if (event->mimeData()->hasText())
     1414    {
     1415      list = event->mimeData()->text().trimmed().split('\n');
     1416    }
     1417  else if (event->mimeData()->hasUrls())
     1418    {
     1419      foreach (QUrl url, event->mimeData()->urls())
     1420        list.append(url.toLocalFile());
     1421    }
    14111422
    14121423  foreach (QString entry, list)
     
    14241435        }
    14251436    }
    1426 
    1427   qDebug() << "Added " << list.size() << " entries.";
    14281437}
    14291438
Note: See TracChangeset for help on using the changeset viewer.