DirectoryTree: warn if user does not drop on a folder item

This commit is contained in:
Le Tan 2018-11-12 20:12:30 +08:00
parent b6b73c3f82
commit 5b996654cf

View File

@ -1245,6 +1245,17 @@ bool VDirectoryTree::dropMimeData(QTreeWidgetItem *p_parent,
{ {
Q_UNUSED(p_index); Q_UNUSED(p_index);
if (!p_parent) {
VUtils::showMessage(QMessageBox::Warning,
tr("Warning"),
tr("Please drop it on a folder item."),
"",
QMessageBox::Ok,
QMessageBox::Ok,
this);
return false;
}
if (p_data->hasFormat(ClipboardConfig::c_format)) { if (p_data->hasFormat(ClipboardConfig::c_format)) {
VDirectory *dir = getVDirectory(p_parent); VDirectory *dir = getVDirectory(p_parent);
if (!dir) { if (!dir) {