mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Store Thumbnails with image hashes
This drastically improves the time it takes to select a dive with several pictures at the expense of longer startup and bigger hash files. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e0f43d8a84
commit
2075038de1
2 changed files with 9 additions and 4 deletions
|
@ -1129,6 +1129,7 @@ extern "C" void reverseGeoLookup(degrees_t latitude, degrees_t longitude, uint32
|
|||
QHash<QString, QByteArray> hashOf;
|
||||
QMutex hashOfMutex;
|
||||
QHash<QByteArray, QString> localFilenameOf;
|
||||
QHash <QString, QImage > thumbnailCache;
|
||||
|
||||
extern "C" char * hashstring(char * filename)
|
||||
{
|
||||
|
@ -1152,6 +1153,7 @@ void read_hashes()
|
|||
QDataStream stream(&hashfile);
|
||||
stream >> localFilenameOf;
|
||||
stream >> hashOf;
|
||||
stream >> thumbnailCache;
|
||||
hashfile.close();
|
||||
}
|
||||
}
|
||||
|
@ -1163,6 +1165,7 @@ void write_hashes()
|
|||
QDataStream stream(&hashfile);
|
||||
stream << localFilenameOf;
|
||||
stream << hashOf;
|
||||
stream << thumbnailCache;
|
||||
hashfile.commit();
|
||||
} else {
|
||||
qDebug() << "cannot open" << hashfile.fileName();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue