Fixed pares duplication - corrected previews generation.

preferencesAboutTextFull
Aleksei Kanash 12 years ago
parent e225cfea56
commit b574c5b1c0
  1. 3
      src/board/UBBoardController.cpp
  2. 2
      src/document/UBDocumentContainer.cpp
  3. 8
      src/document/UBDocumentContainer.h
  4. 2
      src/document/UBDocumentController.cpp

@ -526,7 +526,8 @@ void UBBoardController::duplicateScene(int nIndex)
QList<int> scIndexes; QList<int> scIndexes;
scIndexes << nIndex; scIndexes << nIndex;
duplicatePages(scIndexes); duplicatePages(scIndexes);
insertThumbPage(nIndex);
emit documentThumbnailsUpdated(this);
selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));
setActiveDocumentScene(nIndex + 1); setActiveDocumentScene(nIndex + 1);

@ -46,10 +46,8 @@ void UBDocumentContainer::duplicatePages(QList<int>& pageIndexes)
foreach(int sceneIndex, pageIndexes) foreach(int sceneIndex, pageIndexes)
{ {
UBPersistenceManager::persistenceManager()->duplicateDocumentScene(mCurrentDocument, sceneIndex + offset); UBPersistenceManager::persistenceManager()->duplicateDocumentScene(mCurrentDocument, sceneIndex + offset);
insertThumbPage(sceneIndex + offset);
offset++; offset++;
} }
emit documentThumbnailsUpdated(this);
} }
bool UBDocumentContainer::movePageToIndex(int source, int target) bool UBDocumentContainer::movePageToIndex(int source, int target)

@ -44,16 +44,14 @@ class UBDocumentContainer : public QObject
void addEmptyThumbPage(); void addEmptyThumbPage();
private: private:
void deleteThumbPage(int index);
void updateThumbPage(int index);
void insertThumbPage(int index);
UBDocumentProxy* mCurrentDocument; UBDocumentProxy* mCurrentDocument;
QList<const QPixmap*> mDocumentThumbs; QList<const QPixmap*> mDocumentThumbs;
protected: protected:
void deleteThumbPage(int index);
void updateThumbPage(int index);
void insertThumbPage(int index);
void reloadThumbnails(); void reloadThumbnails();
signals: signals:

@ -501,7 +501,7 @@ void UBDocumentController::duplicateSelectedItem()
if (selectedSceneIndexes.count() > 0) if (selectedSceneIndexes.count() > 0)
{ {
duplicatePages(selectedSceneIndexes); duplicatePages(selectedSceneIndexes);
emit documentThumbnailsUpdated(this);
selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));
UBMetadataDcSubsetAdaptor::persist(selectedDocument()); UBMetadataDcSubsetAdaptor::persist(selectedDocument());
mDocumentUI->thumbnailWidget->selectItemAt(selectedSceneIndexes.last() + selectedSceneIndexes.size()); mDocumentUI->thumbnailWidget->selectItemAt(selectedSceneIndexes.last() + selectedSceneIndexes.size());

Loading…
Cancel
Save