From 8eebc6320f9aded1b07d2ce574bd0421e5b22ff6 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Wed, 4 Jul 2012 13:29:40 +0200 Subject: [PATCH] fixed some errors on duplications of scene --- src/document/UBDocumentController.cpp | 15 --------------- src/document/UBDocumentController.h | 2 -- src/gui/UBThumbnailWidget.cpp | 5 +---- 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index 634c3dcb..1f9e1407 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -534,21 +534,6 @@ void UBDocumentController::openSelectedItem() QApplication::restoreOverrideCursor(); } - -void UBDocumentController::duplicateScenes(UBDocumentProxy* proxy, QList scenesIndex) -{ - if(scenesIndex.count()){ - int offset = 0; - foreach (int eachSceneIndex, scenesIndex){ - UBPersistenceManager::persistenceManager()->duplicateDocumentScene(proxy, eachSceneIndex + offset); - mDocumentThumbs.insert(eachSceneIndex + offset, mDocumentThumbs.at(eachSceneIndex + offset)); - UBApplication::boardController->setActiveDocumentScene(proxy,eachSceneIndex+offset+1); - offset++; - } - } - -} - void UBDocumentController::duplicateSelectedItem() { if (UBApplication::applicationController->displayMode() != UBApplicationController::Document) diff --git a/src/document/UBDocumentController.h b/src/document/UBDocumentController.h index d74654a3..f3e387ba 100644 --- a/src/document/UBDocumentController.h +++ b/src/document/UBDocumentController.h @@ -50,8 +50,6 @@ class UBDocumentController : public QObject UBDocumentProxy* getCurrentDocument() { return mCurrentDocument; }; void deletePages(QList itemsToDelete); int getSelectedItemIndex(); - void duplicateScenes(UBDocumentProxy* proxy, QList scenesIndex); - signals: void refreshThumbnails(); diff --git a/src/gui/UBThumbnailWidget.cpp b/src/gui/UBThumbnailWidget.cpp index abc1df48..5debf1b4 100644 --- a/src/gui/UBThumbnailWidget.cpp +++ b/src/gui/UBThumbnailWidget.cpp @@ -870,10 +870,7 @@ void UBSceneThumbnailNavigPixmap::deletePage() void UBSceneThumbnailNavigPixmap::duplicatePage() { - QList itemsToDelete; - itemsToDelete << sceneIndex(); - - UBApplication::documentController->duplicateScenes(proxy(),itemsToDelete); + UBApplication::boardController->duplicateScene(); } void UBSceneThumbnailNavigPixmap::moveUpPage()