|
|
@ -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,11 +602,8 @@ 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); |
|
|
|
{ |
|
|
|
return NULL; // async operation
|
|
|
|
downloadURL(sourceUrl, srcFile, itemPos, QSize(itemSize.width(), itemSize.height()), false, false); |
|
|
|
|
|
|
|
return NULL; // async operation
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
|
|
|
|
|
|
|
@ -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); |
|
|
|
} |
|
|
|
} |
|
|
@ -2220,11 +2217,7 @@ void UBBoardController::copy() |
|
|
|
UBItem* ubItem = dynamic_cast<UBItem*>(gi); |
|
|
|
UBItem* ubItem = dynamic_cast<UBItem*>(gi); |
|
|
|
|
|
|
|
|
|
|
|
if (ubItem && !mActiveScene->tools().contains(gi)) |
|
|
|
if (ubItem && !mActiveScene->tools().contains(gi)) |
|
|
|
{ |
|
|
|
selected << ubItem; |
|
|
|
UBItem *itemCopy = ubItem->deepCopy(); |
|
|
|
|
|
|
|
if (itemCopy) |
|
|
|
|
|
|
|
selected << itemCopy; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (selected.size() > 0) |
|
|
|
if (selected.size() > 0) |
|
|
|