X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/cad78cdfcf1f3b76acaadc7e9394df3ef466d770..51b978f7fd7ed02b509f34f2579bf016f78bc5e0:/src/panels/places/placesitemmodel.cpp diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index caf6b7566..eae2095c9 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -444,6 +444,11 @@ void PlacesItemModel::dropMimeDataBefore(int index, const QMimeData* mimeData) text = url.host(); } + if (url.isLocalFile() && !QFileInfo(url.toLocalFile()).isDir()) { + // Only directories are allowed + continue; + } + PlacesItem* newItem = createPlacesItem(text, url); const int dropIndex = groupedDropIndex(index, newItem); insertItem(dropIndex, newItem); @@ -612,17 +617,13 @@ void PlacesItemModel::slotStorageSetupDone(Solid::ErrorType error, } if (error) { - // TODO: Request message-freeze exception if (errorData.isValid()) { - // emit errorMessage(i18nc("@info", "An error occurred while accessing '%1', the system responded: %2", - // item->text(), - // errorData.toString())); - emit errorMessage(QString("An error occurred while accessing '%1', the system responded: %2") - .arg(item->text()).arg(errorData.toString())); + emit errorMessage(i18nc("@info", "An error occurred while accessing '%1', the system responded: %2", + item->text(), + errorData.toString())); } else { - // emit errorMessage(i18nc("@info", "An error occurred while accessing '%1'", - // item->text())); - emit errorMessage(QString("An error occurred while accessing '%1'").arg(item->text())); + emit errorMessage(i18nc("@info", "An error occurred while accessing '%1'", + item->text())); } emit storageSetupDone(index, false); } else {