From f3ef38ca0d6db6f7e022a0e565f7460ed22f431e Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 10 Jun 2018 16:39:47 +0200 Subject: Dive pictures: remove hashes In the last commits, the canonical-to-local filename map was made independent from the image hashes and the location of moved images was based on filename not hashes. The hashes are now in principle unused (except for conversion of old-style local filename lookups). Therefore, remove the hashes in this commit. This makes addition of images distinctly faster. Signed-off-by: Berthold Stoeger --- desktop-widgets/mainwindow.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'desktop-widgets/mainwindow.cpp') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index c0c79b00d..dcd7aff32 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -701,9 +701,9 @@ void MainWindow::on_actionCloudOnline_triggered() updateCloudOnlineStatus(); } -static void learnImageDirs(QStringList dirnames) +static void learnImageDirs(QStringList dirnames, QVector imageFilenames) { - learnImages(dirnames, 10); + learnImages(dirnames, 10, imageFilenames); DivePictureModel::instance()->updateDivePictures(); } @@ -720,7 +720,13 @@ void MainWindow::on_actionHash_images_triggered() dirnames = dialog.selectedFiles(); if (dirnames.isEmpty()) return; - future = QtConcurrent::run(learnImageDirs,dirnames); + QVector imageFilenames; + int i; + struct dive *dive; + for_each_dive (i, dive) + FOR_EACH_PICTURE(dive) + imageFilenames.append(QString(picture->filename)); + future = QtConcurrent::run(learnImageDirs, dirnames, imageFilenames); MainWindow::instance()->getNotificationWidget()->showNotification(tr("Scanning images...(this can take a while)"), KMessageWidget::Information); MainWindow::instance()->getNotificationWidget()->setFuture(future); -- cgit v1.2.3-70-g09d2