From 5f73c3fb0e92cc9ef6433e10bbc2f580ec50726c Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Fri, 28 Oct 2011 17:32:44 -0400 Subject: [PATCH] If people reuse the same requestId, reassign it for them and print a warning. Will cause problems if they are relying on the requestId to map to something, but in that case they'd have problems mapping multiple things to the same requestId in the first place... --- src/libtomahawk/infosystem/infosystemworker.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/infosystem/infosystemworker.cpp b/src/libtomahawk/infosystem/infosystemworker.cpp index 726523bd6..a744f76f3 100644 --- a/src/libtomahawk/infosystem/infosystemworker.cpp +++ b/src/libtomahawk/infosystem/infosystemworker.cpp @@ -199,8 +199,12 @@ InfoSystemWorker::getInfo( Tomahawk::InfoSystem::InfoRequestData requestData, ui foundOne = true; - if ( allSources ) + if ( allSources || m_savedRequestMap.contains( requestData.requestId ) ) + { + if ( m_savedRequestMap.contains( requestData.requestId ) ) + tDebug() << Q_FUNC_INFO << "Warning: reassigning requestId because it already exists"; requestData.internalId = TomahawkUtils::infosystemRequestId(); + } else requestData.internalId = requestData.requestId;