From e681470cca70cfbefba4ebbc037bcc0fae7bbd68 Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Wed, 7 Dec 2011 11:17:42 +0100 Subject: [PATCH] Fixed a drop issue from the web in the Library widget on Ubuntu. Need to test on Mac & Windows now --- src/gui/UBLibraryWidget.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/UBLibraryWidget.cpp b/src/gui/UBLibraryWidget.cpp index 9c718b46..26180856 100644 --- a/src/gui/UBLibraryWidget.cpp +++ b/src/gui/UBLibraryWidget.cpp @@ -364,10 +364,16 @@ void UBLibraryWidget::dropEvent(QDropEvent *event) QList urlList = pMimeData->urls(); for (int i = 0; i < urlList.size() && i < 32; ++i){ QString filePath; + QString crntPath = urlList.at(i).toString(); + #ifdef Q_WS_MACX filePath = QUrl(urlList.at(i)).toString(); #else - filePath = QUrl(urlList.at(i).path()).toLocalFile(); + if(crntPath.startsWith("file:") || crntPath.startsWith("/")){ + filePath = QUrl(crntPath).toLocalFile(); + }else{ + filePath = crntPath; + } #endif mLibraryController->importItemOnLibrary(filePath); bDropAccepted = true;