on scene move fixed copying issues

preferencesAboutTextFull
Claudio Valerio 11 years ago
parent 0e22a1d523
commit cab036fe9e
  1. 7
      src/board/UBBoardController.cpp
  2. 1
      src/gui/UBDocumentNavigator.cpp
  3. 7
      src/gui/UBDocumentTreeWidget.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();
if(QFileInfo(source).isDir())
Q_ASSERT(UBFileSystemUtils::copyDir(source,target));
else{
QFileInfo fi(target);
QDir d = fi.dir();
d.mkpath(d.absolutePath());
QFile::copy(source, target);
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();
if(QFileInfo(source).isDir())
Q_ASSERT(UBFileSystemUtils::copyDir(source,target));
else{
QFileInfo fi(target);
QDir d = fi.dir();
d.mkpath(d.absolutePath());
QFile::copy(source, target);
Q_ASSERT(QFile::copy(source, target));
}
}
UBPersistenceManager::persistenceManager()->insertDocumentSceneAt(targetDocProxy, sceneClone, targetDocProxy->pageCount());

Loading…
Cancel
Save