1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-23 17:29:42 +01:00

Add some debug to the generic cache

This commit is contained in:
Casey Link 2012-04-13 16:07:55 -05:00
parent 613d40a605
commit c46c9bba8e

View File

@ -19,6 +19,7 @@
#include "tomahawkcache.h"
#include "tomahawksettings.h"
#include "utils/logger.h"
#include <QDateTime>
#include <QSettings>
@ -95,9 +96,11 @@ QVariant Cache::getData ( const QString& identifier, const QString& key )
tLog() << Q_FUNC_INFO << "Removed stale entry: " << identifier << key;
return QVariant();
}
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Fetched data for" << identifier << key;
return data.data;
}
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "No such client" << identifier;
return QVariant();
}
@ -109,6 +112,7 @@ void Cache::putData ( const QString& identifier, qint64 maxAge, const QString& k
addClient ( identifier );
QSettings cached_settings ( cacheDir, QSettings::IniFormat );
cached_settings.setValue ( key, QVariant::fromValue ( CacheData ( QDateTime::currentMSecsSinceEpoch() + maxAge, value ) ) );
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Storing from client " << identifier << maxAge << key << value;
}
void Cache::addClient ( const QString& identifier )
@ -145,3 +149,4 @@ void Cache::removeClient ( const QString& identifier )