i have following problem:
I have a class Foo which encapsulates a web-api. the interface has following functions:
Foo::addItem( QString id )
Foo::updateItem( QString id )
both function initiate a QNetworkRequest with the same URL but the usage of the data is different. Therefore i need to know in slot function Foo::replyFinished( QNetworkReply *wf_reply ) from where the QNetworkRequest originated.
How would you solve this?
I could use variable to store the adress of the QNetworkRequest to compare it later to wf_reply->request() but this seems like a hack to me. Considering you can call addItem() or updateItem() hundred times before replyFinished() is executed for the first time. The best way would be to add a sting or integer to QNetworkRequest which contains the function name or id.