aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-06-30 11:36:37 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-08 11:00:44 -0700
commit3d7865cf269d8b2f9e06084586ee76e8a44faff1 (patch)
tree0473244d27775664edf717cd45cf2f62613c77b6 /core
parentb28dba6087f0433af8ece176b64fcac54ca370a4 (diff)
downloadsubsurface-3d7865cf269d8b2f9e06084586ee76e8a44faff1.tar.gz
Dive pictures: detach ProfileWidget2 from DivePictureModel
As long as ProfileWidget2 and DivePictureModel showed the same set of pictures and any change would lead to a full recalculation of the set, it made sense to let ProfileWidget2 use DivePictureModel's data. Recently, keeping the two lists in sync become more and more of a burden. Therefore, disconnect ProfileWidget2 and DivePictureModel. This will lead to some code-duplication and perhaps a temporary drop in UI-performance, but in the end the code is distinctly simpler and also more flexible. Thus, for example the DivePhotoTab could be changed to support headings without having to touch ProfileWidget2 at all. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r--core/imagedownloader.cpp3
-rw-r--r--core/imagedownloader.h4
2 files changed, 3 insertions, 4 deletions
diff --git a/core/imagedownloader.cpp b/core/imagedownloader.cpp
index 141cc79d3..0a46265d9 100644
--- a/core/imagedownloader.cpp
+++ b/core/imagedownloader.cpp
@@ -269,12 +269,11 @@ void Thumbnailer::imageDownloadFailed(QString filename)
workingOn.remove(filename);
}
-QImage Thumbnailer::fetchThumbnail(PictureEntry &entry)
+QImage Thumbnailer::fetchThumbnail(const QString &filename)
{
QMutexLocker l(&lock);
// We are not currently fetching this thumbnail - add it to the list.
- const QString &filename = entry.filename;
if (!workingOn.contains(filename)) {
workingOn.insert(filename,
QtConcurrent::run(&pool, [this, filename]() { processItem(filename, true); }));
diff --git a/core/imagedownloader.h b/core/imagedownloader.h
index d5cb889fe..e0db016ed 100644
--- a/core/imagedownloader.h
+++ b/core/imagedownloader.h
@@ -31,9 +31,9 @@ public:
static Thumbnailer *instance();
// Schedule a thumbnail for fetching or calculation.
- // Returns a placehlder thumbnail. The actual thumbnail will be sent
+ // Returns a placeholder thumbnail. The actual thumbnail will be sent
// via a signal later.
- QImage fetchThumbnail(PictureEntry &entry);
+ QImage fetchThumbnail(const QString &filename);
// Schedule multiple thumbnails for forced recalculation
void calculateThumbnails(const QVector<QString> &filenames);