summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-06-03 17:26:44 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-04 02:27:36 +0800
commit0646b41275a3f38926c75d2746b3208805da3a23 (patch)
tree857e759ca4a7c4710d8d14233d3a242a82deba51 /qt-models
parent08962cb38dbd7e07d98397826c5192f0a4156143 (diff)
downloadsubsurface-0646b41275a3f38926c75d2746b3208805da3a23.tar.gz
Dive pictures: find moved pictures based on filename
Users might have edited their pictures. Therefore, instead of identifying pictures by the hash of the file-content, use the file path. The match between original and new filename is graded by a score. Currently, this is the number of path components that match, starting from the filename. Camparison is case-insensitive. After having identified the matching images, write the caches so that they are saved even if the user doesn't cleanly quit the application. Since the new code uses significantly less resources, it can be run in a single background thread. Thus, the multi-threading can be simplified. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/divepicturemodel.cpp8
-rw-r--r--qt-models/divepicturemodel.h1
2 files changed, 0 insertions, 9 deletions
diff --git a/qt-models/divepicturemodel.cpp b/qt-models/divepicturemodel.cpp
index f84146168..5948f426c 100644
--- a/qt-models/divepicturemodel.cpp
+++ b/qt-models/divepicturemodel.cpp
@@ -23,14 +23,6 @@ DivePictureModel::DivePictureModel() : rowDDStart(0),
this, &DivePictureModel::updateThumbnail, Qt::QueuedConnection);
}
-void DivePictureModel::updateDivePicturesWhenDone(QList<QFuture<void>> futures)
-{
- Q_FOREACH (QFuture<void> f, futures) {
- f.waitForFinished();
- }
- updateDivePictures();
-}
-
void DivePictureModel::setZoomLevel(int level)
{
zoomLevel = level / 10.0;
diff --git a/qt-models/divepicturemodel.h b/qt-models/divepicturemodel.h
index a7a3d7180..dd2f9cbd0 100644
--- a/qt-models/divepicturemodel.h
+++ b/qt-models/divepicturemodel.h
@@ -21,7 +21,6 @@ public:
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual void updateDivePictures();
- void updateDivePicturesWhenDone(QList<QFuture<void>>);
void removePictures(const QVector<QString> &fileUrls);
int rowDDStart, rowDDEnd;
void updateDivePictureOffset(const QString &filename, int offsetSeconds);