diff --git a/src/libtomahawk/infosystem/infosystemcache.cpp b/src/libtomahawk/infosystem/infosystemcache.cpp index 9ecdc7435..7a247d281 100644 --- a/src/libtomahawk/infosystem/infosystemcache.cpp +++ b/src/libtomahawk/infosystem/infosystemcache.cpp @@ -43,7 +43,7 @@ InfoSystemCache::InfoSystemCache( QObject* parent ) QString cacheFile = cacheDir + '/' + QString::number( i ); QDir dir( cacheDir ); if( dir.exists() && QFile::exists( cacheFile ) ) - loadCache( type, cacheFile ); + QMetaObject::invokeMethod( this, "loadCache", Qt::AutoConnection, Q_ARG( Tomahawk::InfoSystem::InfoType, type ), Q_ARG( QString, cacheFile ) ); } } @@ -122,7 +122,7 @@ InfoSystemCache::updateCacheSlot( Tomahawk::InfoSystem::InfoCacheCriteria criter void -InfoSystemCache::loadCache( InfoType type, const QString &cacheFile ) +InfoSystemCache::loadCache( Tomahawk::InfoSystem::InfoType type, const QString &cacheFile ) { qDebug() << Q_FUNC_INFO; QSettings cachedSettings( cacheFile, QSettings::IniFormat ); @@ -157,7 +157,7 @@ InfoSystemCache::loadCache( InfoType type, const QString &cacheFile ) void -InfoSystemCache::saveCache( InfoType type, const QString &cacheDir ) +InfoSystemCache::saveCache( Tomahawk::InfoSystem::InfoType type, const QString &cacheDir ) { qDebug() << Q_FUNC_INFO; QDir dir( cacheDir ); @@ -201,4 +201,4 @@ InfoSystemCache::saveCache( InfoType type, const QString &cacheDir ) } //namespace InfoSystem -} //namespace Tomahawk \ No newline at end of file +} //namespace Tomahawk diff --git a/src/libtomahawk/infosystem/infosystemcache.h b/src/libtomahawk/infosystem/infosystemcache.h index 20307eab8..38e626878 100644 --- a/src/libtomahawk/infosystem/infosystemcache.h +++ b/src/libtomahawk/infosystem/infosystemcache.h @@ -48,10 +48,11 @@ public slots: void getCachedInfoSlot( Tomahawk::InfoSystem::InfoCacheCriteria criteria, qint64 newMaxAge, QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, Tomahawk::InfoSystem::InfoCustomData customData ); void updateCacheSlot( Tomahawk::InfoSystem::InfoCacheCriteria criteria, qint64 maxAge, Tomahawk::InfoSystem::InfoType type, QVariant output ); -private: - void loadCache( InfoType type, const QString &cacheFile ); - void saveCache( InfoType type, const QString &cacheDir ); +private slots: + void loadCache( Tomahawk::InfoSystem::InfoType type, const QString &cacheFile ); + void saveCache( Tomahawk::InfoSystem::InfoType type, const QString &cacheDir ); +private: QHash< InfoType, QHash< InfoCacheCriteria, QVariant > > m_dataCache; QHash< InfoType, QHash< InfoCacheCriteria, QDateTime > > m_insertTimeCache; QHash< InfoType, QHash< InfoCacheCriteria, QDateTime > > m_maxTimeCache; @@ -62,4 +63,4 @@ private: } //namespace Tomahawk -#endif //TOMAHAWK_INFOSYSTEMCACHE_H \ No newline at end of file +#endif //TOMAHAWK_INFOSYSTEMCACHE_H