mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Bad behavior fix : in element collection tree, when user drop a directory into itself, this directory is copied in recursive way infinitely.
See bug report N° 121 git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4831 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -122,8 +122,8 @@ bool ElementsCollectionModel::canDropMimeData(const QMimeData *data, Qt::DropAct
|
||||
|
||||
ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(qsi);
|
||||
|
||||
if (data->hasFormat("application/x-qet-element-uri") || data->hasFormat("application/x-qet-category-uri")) {
|
||||
return true;
|
||||
if (data->hasFormat("application/x-qet-element-uri") || data->hasFormat("application/x-qet-category-uri"))
|
||||
{
|
||||
//Return false if user try to drop a item from a folder to the same folder
|
||||
ElementsLocation drop_location(data->text());
|
||||
for (int i=0 ; i<eci->rowCount() ; i++)
|
||||
@@ -154,7 +154,8 @@ bool ElementsCollectionModel::dropMimeData(const QMimeData *data, Qt::DropAction
|
||||
if (!qsi)
|
||||
qsi = itemFromIndex(parent);
|
||||
|
||||
if (qsi->type() == FileElementCollectionItem::Type) {
|
||||
if (qsi->type() == FileElementCollectionItem::Type)
|
||||
{
|
||||
FileElementCollectionItem *feci = static_cast<FileElementCollectionItem *>(qsi);
|
||||
|
||||
if (feci->isCommonCollection())
|
||||
|
||||
Reference in New Issue
Block a user