Commit 3b0bb2f0 authored by Claudio Valerio's avatar Claudio Valerio

copy/paste issue fixed. Issues: 4, 41, 53

parent 4e7f1bb6
...@@ -543,7 +543,7 @@ void UBBoardController::duplicateScene() ...@@ -543,7 +543,7 @@ void UBBoardController::duplicateScene()
duplicateScene(mActiveSceneIndex); duplicateScene(mActiveSceneIndex);
} }
UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync) UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item)
{ {
if (!item) if (!item)
return NULL; return NULL;
...@@ -602,12 +602,9 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync) ...@@ -602,12 +602,9 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
if (mitem) if (mitem)
{ {
sourceUrl = mitem->mediaFileUrl(); sourceUrl = mitem->mediaFileUrl();
if (bAsync)
{
downloadURL(sourceUrl, srcFile, itemPos, QSize(itemSize.width(), itemSize.height()), false, false); downloadURL(sourceUrl, srcFile, itemPos, QSize(itemSize.width(), itemSize.height()), false, false);
return NULL; // async operation return NULL; // async operation
} }
}
}break; }break;
case UBMimeType::VectorImage: case UBMimeType::VectorImage:
...@@ -643,8 +640,8 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync) ...@@ -643,8 +640,8 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
mActiveScene->setURStackEnable(false); mActiveScene->setURStackEnable(false);
foreach(QGraphicsItem* pIt, children){ foreach(QGraphicsItem* pIt, children){
UBItem* pItem = dynamic_cast<UBItem*>(pIt); UBItem* pItem = dynamic_cast<UBItem*>(pIt);
if(pItem){ // we diong sync duplication of all childs. if(pItem){
QGraphicsItem * itemToGroup = dynamic_cast<QGraphicsItem *>(duplicateItem(pItem, false)); QGraphicsItem * itemToGroup = dynamic_cast<QGraphicsItem *>(duplicateItem(pItem));
if (itemToGroup) if (itemToGroup)
duplicatedItems.append(itemToGroup); duplicatedItems.append(itemToGroup);
} }
......
...@@ -168,7 +168,7 @@ class UBBoardController : public UBDocumentContainer ...@@ -168,7 +168,7 @@ class UBBoardController : public UBDocumentContainer
void moveSceneToIndex(int source, int target); void moveSceneToIndex(int source, int target);
void duplicateScene(int index); void duplicateScene(int index);
UBGraphicsItem *duplicateItem(UBItem *item, bool bAsync = true); UBGraphicsItem *duplicateItem(UBItem *item);
void deleteScene(int index); void deleteScene(int index);
bool cacheIsVisible() {return mCacheWidgetIsEnabled;} bool cacheIsVisible() {return mCacheWidgetIsEnabled;}
......
...@@ -61,8 +61,5 @@ UBMimeDataGraphicsItem::UBMimeDataGraphicsItem(QList<UBItem*> pItems) ...@@ -61,8 +61,5 @@ UBMimeDataGraphicsItem::UBMimeDataGraphicsItem(QList<UBItem*> pItems)
UBMimeDataGraphicsItem::~UBMimeDataGraphicsItem() UBMimeDataGraphicsItem::~UBMimeDataGraphicsItem()
{ {
foreach(UBItem* item, mItems){ // Explanation: selected items are owned by the scene and handled by this class
delete item;
item = 0;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment