+bool DolphinPlacesModel::panelsLocked() const
+{
+ return m_panelsLocked;
+}
+
+void DolphinPlacesModel::setPanelsLocked(bool locked)
+{
+ if (m_panelsLocked == locked) {
+ return;
+ }
+
+ m_panelsLocked = locked;
+
+ if (rowCount() > 0) {
+ int lastPlace = rowCount() - 1;
+
+ for (int i = 0; i < rowCount(); ++i) {
+ if (KFilePlacesModel::groupType(index(i, 0)) != KFilePlacesModel::PlacesType) {
+ lastPlace = i - 1;
+ break;
+ }
+ }
+
+ Q_EMIT dataChanged(index(0, 0), index(lastPlace, 0), {KFilePlacesModel::GroupRole});
+ }
+}
+
+QStringList DolphinPlacesModel::mimeTypes() const
+{
+ QStringList types = KFilePlacesModel::mimeTypes();
+ types << DragAndDropHelper::arkDndServiceMimeType() << DragAndDropHelper::arkDndPathMimeType();
+ return types;
+}
+
+bool DolphinPlacesModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
+{
+ // We make the view accept the drag by returning them from mimeTypes()
+ // but the drop should be handled exclusively by PlacesPanel::slotUrlsDropped
+ if (DragAndDropHelper::isArkDndMimeType(data)) {
+ return false;
+ }
+
+ return KFilePlacesModel::dropMimeData(data, action, row, column, parent);
+}
+