|
|
|
@ -24,6 +24,7 @@ |
|
|
|
|
#include "UBDocumentTreeWidget.h" |
|
|
|
|
|
|
|
|
|
#include "document/UBDocumentProxy.h" |
|
|
|
|
//#include "document/UBDocumentContainer.h"
|
|
|
|
|
|
|
|
|
|
#include "core/UBSettings.h" |
|
|
|
|
#include "core/UBApplication.h" |
|
|
|
@ -326,11 +327,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()); |
|
|
|
|