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
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));
}
}
}
......
......@@ -85,7 +85,6 @@ UBDocumentNavigator::~UBDocumentNavigator()
void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
{
mThumbsWithLabels.clear();
// foreach(QGraphicsItem* it, mScene->items())
int selectedIndex = -1;
QList<QGraphicsItem*> graphicsItemList = mScene->items();
for(int i = 0; i < graphicsItemList.size(); i+=1)
......
......@@ -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());
......
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