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/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index d18b53ac..2ca0fe6d 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -777,6 +777,12 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString { QString mimeType = pContentTypeHeader; + // In some cases "image/jpeg;charset=" is retourned by the drag-n-drop. That is + // why we will check if an ; exists and take the first part (the standard allows this kind of mimetype) + int position=mimeType.indexOf(";"); + if(position != -1) + mimeType=mimeType.left(position); + if (!pSuccess) { UBApplication::showMessage(tr("Downloading content %1 failed").arg(sourceUrl.toString())); 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();