diff options
author | Alexander Tkachev | 2016-05-26 19:22:27 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | b246c17850687e7b15b644b761fbfe835ffc1c32 (patch) | |
tree | c8ddc679b4ccf46d291cfc4e7bab5d201d8e8771 /backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp | |
parent | a7b28605a01b59de6f3acc9df4cd1cac707c39e7 (diff) | |
download | scummvm-rg350-b246c17850687e7b15b644b761fbfe835ffc1c32.tar.gz scummvm-rg350-b246c17850687e7b15b644b761fbfe835ffc1c32.tar.bz2 scummvm-rg350-b246c17850687e7b15b644b761fbfe835ffc1c32.zip |
CLOUD: Fix CurlJsonRequest to use JsonCallback
Type safety first.
Diffstat (limited to 'backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp')
-rw-r--r-- | backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp b/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp index 31f015a1cd..3158149c02 100644 --- a/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp +++ b/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp @@ -40,7 +40,7 @@ void DropboxListDirectoryRequest::startupWork() { _files.clear(); _complete = false; - Networking::DataCallback innerCallback = new Common::Callback<DropboxListDirectoryRequest, Networking::RequestDataPair>(this, &DropboxListDirectoryRequest::responseCallback); + Networking::JsonCallback innerCallback = new Common::Callback<DropboxListDirectoryRequest, Networking::RequestJsonPair>(this, &DropboxListDirectoryRequest::responseCallback); Networking::CurlJsonRequest *request = new Networking::CurlJsonRequest(innerCallback, "https://api.dropboxapi.com/2/files/list_folder"); request->addHeader("Authorization: Bearer " + _token); request->addHeader("Content-Type: application/json"); @@ -58,8 +58,8 @@ void DropboxListDirectoryRequest::startupWork() { } -void DropboxListDirectoryRequest::responseCallback(Networking::RequestDataPair pair) { - Common::JSONValue *json = (Common::JSONValue *)pair.value; +void DropboxListDirectoryRequest::responseCallback(Networking::RequestJsonPair pair) { + Common::JSONValue *json = pair.value; if (json) { Common::JSONObject response = json->asObject(); @@ -89,7 +89,7 @@ void DropboxListDirectoryRequest::responseCallback(Networking::RequestDataPair p bool hasMore = response.getVal("has_more")->asBool(); if (hasMore) { - Networking::DataCallback innerCallback = new Common::Callback<DropboxListDirectoryRequest, Networking::RequestDataPair>(this, &DropboxListDirectoryRequest::responseCallback); + Networking::JsonCallback innerCallback = new Common::Callback<DropboxListDirectoryRequest, Networking::RequestJsonPair>(this, &DropboxListDirectoryRequest::responseCallback); Networking::CurlJsonRequest *request = new Networking::CurlJsonRequest(innerCallback, "https://api.dropboxapi.com/2/files/list_folder/continue"); request->addHeader("Authorization: Bearer " + _token); request->addHeader("Content-Type: application/json"); |