mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
08962cb38d
commit
0646b41275
5 changed files with 80 additions and 34 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue