Library (right panel): fix for elements not disappearing from current path when they are moved

preferencesAboutTextFull
Craig Watson 8 years ago
parent 88ef7fdd3b
commit c729d965bc
  1. 7
      src/gui/UBFeaturesWidget.cpp

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

Loading…
Cancel
Save