From c729d965bc5bccc0bb1a733cbf8da95dcefa19fd Mon Sep 17 00:00:00 2001
From: Craig Watson <craig@watsons.ch>
Date: Sun, 4 Sep 2016 23:33:08 -0400
Subject: [PATCH] Library (right panel): fix for elements not disappearing from
 current path when they are moved

---
 src/gui/UBFeaturesWidget.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gui/UBFeaturesWidget.cpp b/src/gui/UBFeaturesWidget.cpp
index 8779fb50..348ea771 100644
--- a/src/gui/UBFeaturesWidget.cpp
+++ b/src/gui/UBFeaturesWidget.cpp
@@ -1224,7 +1224,7 @@ bool UBFeaturesModel::dropMimeData(const QMimeData *mimeData, Qt::DropAction act
             UBFeature sourceElement;
             if (dataFromSameModel) {
                 sourceElement = featList.at(i);
-                moveData(sourceElement, parentFeature, Qt::MoveAction);
+                moveData(sourceElement, parentFeature, Qt::MoveAction, true);
             }
         }
     } else if (mimeData->hasUrls()) {
@@ -1323,6 +1323,11 @@ void UBFeaturesModel::moveData(const UBFeature &source, const UBFeature &destina
     UBFeatureElementType sourceType = source.getType();
     QImage sourceIcon = source.getThumbnail();
 
+    if (sourceType == FEATURE_INTERNAL) {
+        qWarning() << "Built-in tools cannot be moved";
+        return;
+    }
+
     Q_ASSERT( QFileInfo( sourcePath ).exists() );
 
     QString name = QFileInfo( sourcePath ).fileName();