Skip to content

Commit

Permalink
Added the current projection epsg value into the computed md5hex.
Browse files Browse the repository at this point in the history
  • Loading branch information
chris5287 committed Mar 19, 2014
1 parent 6b94851 commit d4503e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 5 additions & 3 deletions QMapControl/src/QMapControl/ImageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
#include <QtCore/QCryptographicHash>
#include <QtGui/QPainter>

// Local includes.
#include "Projection.h"

namespace qmapcontrol
{
namespace
Expand Down Expand Up @@ -240,9 +243,8 @@ namespace qmapcontrol

QString ImageManager::md5hex(const QUrl& url)
{
// Return the md5 hex value of the given url at a specific tile size.
/// @todo encode projection into md5 hex as well.
return QString(QCryptographicHash::hash((url.toString() + QString::number(m_tile_size_px)).toUtf8(), QCryptographicHash::Md5).toHex());
// Return the md5 hex value of the given url at a specific projection and tile size.
return QString(QCryptographicHash::hash((url.toString() + QString::number(projection::get().epsg()) + QString::number(m_tile_size_px)).toUtf8(), QCryptographicHash::Md5).toHex());
}

QString ImageManager::persistentCacheFilename(const QUrl& url)
Expand Down
4 changes: 1 addition & 3 deletions QMapControl/src/QMapControl/ImageManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ namespace qmapcontrol
/*!
* Enables the persistent cache, specifying the directory and expiry timeout.
* @param path The path where the images should be stored.
* @param expiry The max age (in minutes) of an image before its removed and a new one is
* requested (0 to keep forever).
* @param expiry The max age (in minutes) of an image before its removed and a new one is requested (0 to keep forever).
* @return whether the persistent cache was enabled.
* @todo add maximum size?
*/
bool enablePersistentCache(const std::chrono::minutes& expiry, const QDir& path);

Expand Down

0 comments on commit d4503e9

Please sign in to comment.