1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-14 04:51:53 +02:00

Rename SavedRequestData and promote it

This commit is contained in:
Jeff Mitchell 2011-07-06 17:32:02 -04:00
parent eb7f3fdab4
commit 51fba9ae62
3 changed files with 11 additions and 10 deletions

View File

@ -107,6 +107,13 @@ enum InfoType { // as items are saved in cache, mark them here to not change the
InfoNotifyUser = 55
};
struct InfoRequestData {
QString caller;
Tomahawk::InfoSystem::InfoType type;
QVariant input;
QVariantMap customData;
};
typedef QMap< InfoType, QVariant > InfoTypeMap;
typedef QMap< InfoType, uint > InfoTimeoutMap;
typedef QMap< QString, QMap< QString, QString > > InfoGenericMap;

View File

@ -184,7 +184,7 @@ InfoSystemWorker::getInfo( QString caller, InfoType type, QVariant input, QVaria
m_dataTracker[ caller ][ type ] = m_dataTracker[ caller ][ type ] + 1;
qDebug() << "current count in dataTracker for type" << type << "is" << m_dataTracker[ caller ][ type ];
SavedRequestData* data = new SavedRequestData;
InfoRequestData* data = new InfoRequestData;
data->caller = caller;
data->type = type;
data->input = input;
@ -271,7 +271,7 @@ InfoSystemWorker::checkTimeoutsTimerFired()
//doh, timed out
qDebug() << Q_FUNC_INFO << " doh, timed out for requestId " << requestId;
SavedRequestData *savedData = m_savedRequestMap[ requestId ];
InfoRequestData *savedData = m_savedRequestMap[ requestId ];
QString target = savedData->caller;
InfoType type = savedData->type;
emit info( target, type, savedData->input, QVariant(), savedData->customData );

View File

@ -37,13 +37,7 @@ namespace Tomahawk {
namespace InfoSystem {
struct SavedRequestData {
QString caller;
Tomahawk::InfoSystem::InfoType type;
QVariant input;
QVariantMap customData;
};
class DLLEXPORT InfoSystemWorker : public QObject
{
Q_OBJECT
@ -80,7 +74,7 @@ private:
QHash< QString, QHash< InfoType, int > > m_dataTracker;
QMultiMap< qint64, uint > m_timeRequestMapper;
QHash< uint, bool > m_requestSatisfiedMap;
QHash< uint, SavedRequestData* > m_savedRequestMap;
QHash< uint, InfoRequestData* > m_savedRequestMap;
QLinkedList< InfoPluginPtr > determineOrderedMatches( const InfoType type ) const;