diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index cf84fdd1..b889c96b 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -485,11 +485,14 @@ void UBBoardController::addScene(UBGraphicsScene* scene, bool replaceActiveIfEmp QString source = scene->document()->persistencePath() + "/" + relativeFile.toString(); QString target = selectedDocument()->persistencePath() + "/" + relativeFile.toString(); - QFileInfo fi(target); - QDir d = fi.dir(); - - d.mkpath(d.absolutePath()); - QFile::copy(source, target); + if(QFileInfo(source).isDir()) + Q_ASSERT(UBFileSystemUtils::copyDir(source,target)); + else{ + QFileInfo fi(target); + QDir d = fi.dir(); + d.mkpath(d.absolutePath()); + Q_ASSERT(QFile::copy(source, target)); + } } } diff --git a/src/gui/UBDocumentNavigator.cpp b/src/gui/UBDocumentNavigator.cpp index 1756b2b5..c8d75a5b 100644 --- a/src/gui/UBDocumentNavigator.cpp +++ b/src/gui/UBDocumentNavigator.cpp @@ -85,7 +85,6 @@ UBDocumentNavigator::~UBDocumentNavigator() void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source) { mThumbsWithLabels.clear(); -// foreach(QGraphicsItem* it, mScene->items()) int selectedIndex = -1; QList graphicsItemList = mScene->items(); for(int i = 0; i < graphicsItemList.size(); i+=1) diff --git a/src/gui/UBDocumentTreeWidget.cpp b/src/gui/UBDocumentTreeWidget.cpp index 6c1409f6..dc5a7a0d 100644 --- a/src/gui/UBDocumentTreeWidget.cpp +++ b/src/gui/UBDocumentTreeWidget.cpp @@ -326,11 +326,14 @@ void UBDocumentTreeWidget::dropEvent(QDropEvent *event) QString source = scene->document()->persistencePath() + "/" + relativeFile.toString(); QString target = targetDocProxy->persistencePath() + "/" + relativeFile.toString(); - QFileInfo fi(target); - QDir d = fi.dir(); - - d.mkpath(d.absolutePath()); - QFile::copy(source, target); + if(QFileInfo(source).isDir()) + Q_ASSERT(UBFileSystemUtils::copyDir(source,target)); + else{ + QFileInfo fi(target); + QDir d = fi.dir(); + d.mkpath(d.absolutePath()); + Q_ASSERT(QFile::copy(source, target)); + } } UBPersistenceManager::persistenceManager()->insertDocumentSceneAt(targetDocProxy, sceneClone, targetDocProxy->pageCount());