From 2def311e936337468e2f4a9ee093b38f2c57685a Mon Sep 17 00:00:00 2001 From: Ivan Ilin Date: Fri, 16 Dec 2011 17:52:31 +0200 Subject: [PATCH] Sankore 431 fixed --- src/adaptors/UBCFFSubsetAdaptor.cpp | 1 - src/gui/UBDocumentTreeWidget.cpp | 13 ++++++++++++- src/gui/UBDocumentTreeWidget.h | 2 +- src/gui/UBThumbnailView.h | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/adaptors/UBCFFSubsetAdaptor.cpp b/src/adaptors/UBCFFSubsetAdaptor.cpp index aeb0a2a8..877a93a0 100644 --- a/src/adaptors/UBCFFSubsetAdaptor.cpp +++ b/src/adaptors/UBCFFSubsetAdaptor.cpp @@ -1039,7 +1039,6 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::persistScenes() UBThumbnailAdaptor::persistScene(mProxy->persistencePath(), tmpScene, i); delete tmpScene; - mCurrentScene->setModified(false); } diff --git a/src/gui/UBDocumentTreeWidget.cpp b/src/gui/UBDocumentTreeWidget.cpp index 7f06d5d2..b344855c 100644 --- a/src/gui/UBDocumentTreeWidget.cpp +++ b/src/gui/UBDocumentTreeWidget.cpp @@ -25,6 +25,10 @@ #include "core/UBDocumentManager.h" #include "document/UBDocumentController.h" +#include "adaptors/UBThumbnailAdaptor.h" +#include "adaptors/UBSvgSubsetAdaptor.h" +#include "frameworks/UBFileSystemUtils.h" + #include "core/memcheck.h" UBDocumentTreeWidget::UBDocumentTreeWidget(QWidget * parent) @@ -290,7 +294,14 @@ void UBDocumentTreeWidget::dropEvent(QDropEvent *event) } UBPersistenceManager::persistenceManager()->insertDocumentSceneAt(targetDocProxy, sceneClone, targetDocProxy->pageCount()); - } + + //due to incorrect generation of thumbnails of invisible scene I've used direct copying of thumbnail files + //it's not universal and good way but it's faster + QString from = sourceItem.documentProxy()->persistencePath() + UBFileSystemUtils::digitFileFormat("/page%1.thumbnail.jpg", sourceItem.sceneIndex() + 1); + QString to = targetDocProxy->persistencePath() + UBFileSystemUtils::digitFileFormat("/page%1.thumbnail.jpg", targetDocProxy->pageCount()); + QFile::remove(to); + QFile::copy(from, to); + } } QApplication::restoreOverrideCursor(); diff --git a/src/gui/UBDocumentTreeWidget.h b/src/gui/UBDocumentTreeWidget.h index ab2e9866..f76d1696 100644 --- a/src/gui/UBDocumentTreeWidget.h +++ b/src/gui/UBDocumentTreeWidget.h @@ -23,7 +23,7 @@ class UBDocumentProxyTreeItem; class UBDocumentTreeWidget : public QTreeWidget { - Q_OBJECT; + Q_OBJECT public: UBDocumentTreeWidget(QWidget *parent = 0); diff --git a/src/gui/UBThumbnailView.h b/src/gui/UBThumbnailView.h index ecd13a19..32390f1a 100644 --- a/src/gui/UBThumbnailView.h +++ b/src/gui/UBThumbnailView.h @@ -22,7 +22,7 @@ class UBGraphicsScene; class UBThumbnailView : public QGraphicsView { - Q_OBJECT; + Q_OBJECT public: UBThumbnailView();