]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/places/placesitemmodel.cpp
Merge remote-tracking branch 'origin/KDE/4.10'
[dolphin.git] / src / panels / places / placesitemmodel.cpp
index caf6b75662c4953fce522d86faf4f8dbfba0fe1e..eae2095c994ff37fe78fb8dc9a82a1be2cdda644 100644 (file)
@@ -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 {