Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/core/UBPersistenceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,7 @@ void UBPersistenceManager::createDocumentProxiesStructure(const QFileInfoList &c
QObject::connect(&futureWatcher, &QFutureWatcher<void>::progressValueChanged, &mProgress, &QProgressDialog::setValue);

// Start the computation.
std::function<std::shared_ptr<UBDocumentProxy> (QFileInfo contentInfo)> createDocumentProxyLambda = [=](QFileInfo contentInfo) {
return createDocumentProxyStructure(contentInfo);
};

QFuture<std::shared_ptr<UBDocumentProxy>> proxiesFuture = QtConcurrent::mapped(contentInfoList, createDocumentProxyLambda);
QFuture<std::shared_ptr<UBDocumentProxy>> proxiesFuture = QtConcurrent::mapped(contentInfoList, &UBPersistenceManager::createDocumentProxyStructure);
futureWatcher.setFuture(proxiesFuture);

// Display the dialog and start the event loop.
Expand Down Expand Up @@ -258,7 +254,7 @@ void UBPersistenceManager::createDocumentProxiesStructure(bool interactive)
}
}

std::shared_ptr<UBDocumentProxy> UBPersistenceManager::createDocumentProxyStructure(QFileInfo& contentInfo)
std::shared_ptr<UBDocumentProxy> UBPersistenceManager::createDocumentProxyStructure(const QFileInfo& contentInfo)
{
QString fullPath = contentInfo.absoluteFilePath();

Expand Down
4 changes: 2 additions & 2 deletions src/core/UBPersistenceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class UBPersistenceManager : public QObject

void createDocumentProxiesStructure(bool interactive = false);
void createDocumentProxiesStructure(const QFileInfoList &contentInfoList, bool interactive = false);
std::shared_ptr<UBDocumentProxy> createDocumentProxyStructure(QFileInfo &contentInfo);
static std::shared_ptr<UBDocumentProxy> createDocumentProxyStructure(const QFileInfo &contentInfo);
QDialog::DialogCode processInteractiveReplacementDialog(std::shared_ptr<UBDocumentProxy> pProxy, bool multipleFiles = false);

QStringList documentSubDirectories()
Expand Down Expand Up @@ -167,7 +167,7 @@ class UBPersistenceManager : public QObject
void documentSceneDeleted(std::shared_ptr<UBDocumentProxy> pDocumentProxy, int pIndex);

private:
int sceneCount(const std::shared_ptr<UBDocumentProxy> pDocumentProxy);
static int sceneCount(const std::shared_ptr<UBDocumentProxy> pDocumentProxy);
static QStringList getSceneFileNames(const QString& folder);
void renamePage(std::shared_ptr<UBDocumentProxy> pDocumentProxy,
const int sourceIndex, const int targetIndex);
Expand Down