Commit cab036fe authored by Claudio Valerio's avatar Claudio Valerio

on scene move fixed copying issues

parent 0e22a1d5
...@@ -485,11 +485,14 @@ void UBBoardController::addScene(UBGraphicsScene* scene, bool replaceActiveIfEmp ...@@ -485,11 +485,14 @@ void UBBoardController::addScene(UBGraphicsScene* scene, bool replaceActiveIfEmp
QString source = scene->document()->persistencePath() + "/" + relativeFile.toString(); QString source = scene->document()->persistencePath() + "/" + relativeFile.toString();
QString target = selectedDocument()->persistencePath() + "/" + relativeFile.toString(); QString target = selectedDocument()->persistencePath() + "/" + relativeFile.toString();
QFileInfo fi(target); if(QFileInfo(source).isDir())
QDir d = fi.dir(); Q_ASSERT(UBFileSystemUtils::copyDir(source,target));
else{
d.mkpath(d.absolutePath()); QFileInfo fi(target);
QFile::copy(source, target); QDir d = fi.dir();
d.mkpath(d.absolutePath());
Q_ASSERT(QFile::copy(source, target));
}
} }
} }
......
...@@ -85,7 +85,6 @@ UBDocumentNavigator::~UBDocumentNavigator() ...@@ -85,7 +85,6 @@ UBDocumentNavigator::~UBDocumentNavigator()
void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source) void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
{ {
mThumbsWithLabels.clear(); mThumbsWithLabels.clear();
// foreach(QGraphicsItem* it, mScene->items())
int selectedIndex = -1; int selectedIndex = -1;
QList<QGraphicsItem*> graphicsItemList = mScene->items(); QList<QGraphicsItem*> graphicsItemList = mScene->items();
for(int i = 0; i < graphicsItemList.size(); i+=1) for(int i = 0; i < graphicsItemList.size(); i+=1)
......
...@@ -326,11 +326,14 @@ void UBDocumentTreeWidget::dropEvent(QDropEvent *event) ...@@ -326,11 +326,14 @@ void UBDocumentTreeWidget::dropEvent(QDropEvent *event)
QString source = scene->document()->persistencePath() + "/" + relativeFile.toString(); QString source = scene->document()->persistencePath() + "/" + relativeFile.toString();
QString target = targetDocProxy->persistencePath() + "/" + relativeFile.toString(); QString target = targetDocProxy->persistencePath() + "/" + relativeFile.toString();
QFileInfo fi(target); if(QFileInfo(source).isDir())
QDir d = fi.dir(); Q_ASSERT(UBFileSystemUtils::copyDir(source,target));
else{
d.mkpath(d.absolutePath()); QFileInfo fi(target);
QFile::copy(source, target); QDir d = fi.dir();
d.mkpath(d.absolutePath());
Q_ASSERT(QFile::copy(source, target));
}
} }
UBPersistenceManager::persistenceManager()->insertDocumentSceneAt(targetDocProxy, sceneClone, targetDocProxy->pageCount()); UBPersistenceManager::persistenceManager()->insertDocumentSceneAt(targetDocProxy, sceneClone, targetDocProxy->pageCount());
......
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