diff options
author | Alexander Tkachev | 2016-07-21 11:44:36 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 438ba985a4a97a8695a6e6fdda6930694976c07b (patch) | |
tree | 066e589b809278ff2e06df31069f8ea3fb6989d7 /backends/cloud | |
parent | 01161ae7ddbc5f147dd9e71991eb2f1a1c9a7b06 (diff) | |
download | scummvm-rg350-438ba985a4a97a8695a6e6fdda6930694976c07b.tar.gz scummvm-rg350-438ba985a4a97a8695a6e6fdda6930694976c07b.tar.bz2 scummvm-rg350-438ba985a4a97a8695a6e6fdda6930694976c07b.zip |
JANITORIAL: Remove spaces at the end of the line
I knew there were some, but I wanted to fix them once, instead of doing
it all the time.
Diffstat (limited to 'backends/cloud')
53 files changed, 174 insertions, 174 deletions
diff --git a/backends/cloud/box/boxlistdirectorybyidrequest.cpp b/backends/cloud/box/boxlistdirectorybyidrequest.cpp index d4606b1851..537666bc52 100644 --- a/backends/cloud/box/boxlistdirectorybyidrequest.cpp +++ b/backends/cloud/box/boxlistdirectorybyidrequest.cpp @@ -87,7 +87,7 @@ void BoxListDirectoryByIdRequest::responseCallback(Networking::JsonResponse resp Common::JSONObject responseObject = json->asObject(); //debug("%s", json->stringify(true).c_str()); - + //TODO: check that error is returned the right way /* if (responseObject.contains("error") || responseObject.contains("error_summary")) { @@ -100,7 +100,7 @@ void BoxListDirectoryByIdRequest::responseCallback(Networking::JsonResponse resp } */ - //TODO: check that ALL keys exist AND HAVE RIGHT TYPE to avoid segfaults + //TODO: check that ALL keys exist AND HAVE RIGHT TYPE to avoid segfaults if (responseObject.contains("entries") && responseObject.getVal("entries")->isArray()) { Common::JSONArray items = responseObject.getVal("entries")->asArray(); @@ -160,7 +160,7 @@ void BoxListDirectoryByIdRequest::restart() { start(); } Common::String BoxListDirectoryByIdRequest::date() const { return _date; } -void BoxListDirectoryByIdRequest::finishListing(Common::Array<StorageFile> &files) { +void BoxListDirectoryByIdRequest::finishListing(Common::Array<StorageFile> &files) { Request::finishSuccess(); if (_listDirectoryCallback) (*_listDirectoryCallback)(Storage::ListDirectoryResponse(this, files)); } diff --git a/backends/cloud/box/boxlistdirectorybyidrequest.h b/backends/cloud/box/boxlistdirectorybyidrequest.h index ccf8d2e342..13f1ba056c 100644 --- a/backends/cloud/box/boxlistdirectorybyidrequest.h +++ b/backends/cloud/box/boxlistdirectorybyidrequest.h @@ -34,7 +34,7 @@ namespace Box { class BoxStorage; class BoxListDirectoryByIdRequest: public Networking::Request { - Common::String _requestedId; + Common::String _requestedId; BoxStorage *_storage; Storage::ListDirectoryCallback _listDirectoryCallback; @@ -42,7 +42,7 @@ class BoxListDirectoryByIdRequest: public Networking::Request { Request *_workingRequest; bool _ignoreCallback; Common::String _date; - + void start(); void makeRequest(uint32 offset); void responseCallback(Networking::JsonResponse response); diff --git a/backends/cloud/box/boxstorage.cpp b/backends/cloud/box/boxstorage.cpp index c31c72b49f..6d4b5efd8e 100644 --- a/backends/cloud/box/boxstorage.cpp +++ b/backends/cloud/box/boxstorage.cpp @@ -152,7 +152,7 @@ void BoxStorage::infoInnerCallback(StorageInfoCallback outerCallback, Networking delete outerCallback; return; } - + Common::JSONObject info = json->asObject(); Common::String uid, name, email; @@ -224,7 +224,7 @@ Networking::Request *BoxStorage::createDirectoryWithParentId(Common::String pare Common::JSONObject parentObject; parentObject.setVal("id", new Common::JSONValue(parentId)); - Common::JSONObject jsonRequestParameters; + Common::JSONObject jsonRequestParameters; jsonRequestParameters.setVal("name", new Common::JSONValue(name)); jsonRequestParameters.setVal("parent", new Common::JSONValue(parentObject)); @@ -248,7 +248,7 @@ Networking::Request *BoxStorage::upload(Common::String path, Common::SeekableRea } bool BoxStorage::uploadStreamSupported() { - return false; + return false; } Networking::Request *BoxStorage::streamFileById(Common::String id, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback) { diff --git a/backends/cloud/box/boxstorage.h b/backends/cloud/box/boxstorage.h index 1373c2fbeb..89bc470a26 100644 --- a/backends/cloud/box/boxstorage.h +++ b/backends/cloud/box/boxstorage.h @@ -48,7 +48,7 @@ class BoxStorage: public Id::IdStorage { void infoInnerCallback(StorageInfoCallback outerCallback, Networking::JsonResponse json); void createDirectoryInnerCallback(BoolCallback outerCallback, Networking::JsonResponse response); -public: +public: /** This constructor uses OAuth code flow to get tokens. */ BoxStorage(Common::String code); virtual ~BoxStorage(); @@ -97,7 +97,7 @@ public: virtual Common::String savesDirectoryPath(); /** - * Load token and user id from configs and return BoxStorage for those. + * Load token and user id from configs and return BoxStorage for those. * @return pointer to the newly created BoxStorage or 0 if some problem occured. */ static BoxStorage *loadFromConfig(Common::String keyPrefix); diff --git a/backends/cloud/box/boxtokenrefresher.cpp b/backends/cloud/box/boxtokenrefresher.cpp index f100e186be..65964f3010 100644 --- a/backends/cloud/box/boxtokenrefresher.cpp +++ b/backends/cloud/box/boxtokenrefresher.cpp @@ -52,7 +52,7 @@ void BoxTokenRefresher::tokenRefreshed(Storage::BoolResponse response) { } setHeaders(_headers); - //successfully received refreshed token, can restart the original request now + //successfully received refreshed token, can restart the original request now retry(0); } @@ -77,7 +77,7 @@ void BoxTokenRefresher::finishJson(Common::JSONValue *json) { Common::String code, message; if (result.contains("code")) { code = result.getVal("code")->asString(); - debug(9, "code = %s", code.c_str()); + debug(9, "code = %s", code.c_str()); } if (result.contains("message")) { @@ -88,13 +88,13 @@ void BoxTokenRefresher::finishJson(Common::JSONValue *json) { //TODO: decide when token refreshment will help //if (code == "unauthenticated") irrecoverable = false; - if (irrecoverable) { + if (irrecoverable) { finishError(Networking::ErrorResponse(this, false, true, json->stringify(true), httpCode)); delete json; return; } - pause(); + pause(); delete json; _parentStorage->getAccessToken(new Common::Callback<BoxTokenRefresher, Storage::BoolResponse>(this, &BoxTokenRefresher::tokenRefreshed)); return; @@ -117,7 +117,7 @@ void BoxTokenRefresher::finishError(Networking::ErrorResponse error) { Request::finishError(error); } -void BoxTokenRefresher::setHeaders(Common::Array<Common::String> &headers) { +void BoxTokenRefresher::setHeaders(Common::Array<Common::String> &headers) { _headers = headers; curl_slist_free_all(_headersList); _headersList = 0; diff --git a/backends/cloud/box/boxtokenrefresher.h b/backends/cloud/box/boxtokenrefresher.h index 7dedefdbe5..c08e8468c3 100644 --- a/backends/cloud/box/boxtokenrefresher.h +++ b/backends/cloud/box/boxtokenrefresher.h @@ -33,13 +33,13 @@ class BoxStorage; class BoxTokenRefresher: public Networking::CurlJsonRequest { BoxStorage *_parentStorage; - Common::Array<Common::String> _headers; - + Common::Array<Common::String> _headers; + void tokenRefreshed(Storage::BoolResponse response); virtual void finishJson(Common::JSONValue *json); virtual void finishError(Networking::ErrorResponse error); -public: +public: BoxTokenRefresher(BoxStorage *parent, Networking::JsonCallback callback, Networking::ErrorCallback ecb, const char *url); virtual ~BoxTokenRefresher(); diff --git a/backends/cloud/box/boxuploadrequest.cpp b/backends/cloud/box/boxuploadrequest.cpp index c81a3ab439..d1f68f1d24 100644 --- a/backends/cloud/box/boxuploadrequest.cpp +++ b/backends/cloud/box/boxuploadrequest.cpp @@ -123,12 +123,12 @@ void BoxUploadRequest::upload() { _workingRequest = ConnMan.addRequest(request); } -void BoxUploadRequest::uploadedCallback(Networking::JsonResponse response) { +void BoxUploadRequest::uploadedCallback(Networking::JsonResponse response) { _workingRequest = nullptr; if (_ignoreCallback) return; - + Networking::ErrorResponse error(this, false, true, "", -1); - Networking::CurlJsonRequest *rq = (Networking::CurlJsonRequest *)response.request; + Networking::CurlJsonRequest *rq = (Networking::CurlJsonRequest *)response.request; if (rq) { const Networking::NetworkReadStream *stream = rq->getNetworkReadStream(); if (stream) { @@ -193,7 +193,7 @@ void BoxUploadRequest::uploadedCallback(Networking::JsonResponse response) { delete json; } -void BoxUploadRequest::notUploadedCallback(Networking::ErrorResponse error) { +void BoxUploadRequest::notUploadedCallback(Networking::ErrorResponse error) { _workingRequest = nullptr; if (_ignoreCallback) return; finishError(error); diff --git a/backends/cloud/box/boxuploadrequest.h b/backends/cloud/box/boxuploadrequest.h index 3d15aa70b3..1bc8690210 100644 --- a/backends/cloud/box/boxuploadrequest.h +++ b/backends/cloud/box/boxuploadrequest.h @@ -39,7 +39,7 @@ class BoxUploadRequest: public Networking::Request { Request *_workingRequest; bool _ignoreCallback; Common::String _resolvedId, _parentId; - + void start(); void resolveId(); void idResolvedCallback(Storage::UploadResponse response); diff --git a/backends/cloud/cloudmanager.cpp b/backends/cloud/cloudmanager.cpp index 55dbb2b42d..a4763dba2d 100644 --- a/backends/cloud/cloudmanager.cpp +++ b/backends/cloud/cloudmanager.cpp @@ -42,7 +42,7 @@ const char *const CloudManager::kStoragePrefix = "storage_"; CloudManager::CloudManager() : _currentStorageIndex(0), _activeStorage(nullptr) {} CloudManager::~CloudManager() { - //TODO: do we have to save storages on manager destruction? + //TODO: do we have to save storages on manager destruction? delete _activeStorage; freeStorages(); } diff --git a/backends/cloud/cloudmanager.h b/backends/cloud/cloudmanager.h index 2941ea6331..0146a4118e 100644 --- a/backends/cloud/cloudmanager.h +++ b/backends/cloud/cloudmanager.h @@ -89,7 +89,7 @@ public: * @note this method automatically saves the changes with ConfMan. * * @param storage Cloud::Storage to replace active storage with. - * @param index one of Cloud::StorageID enum values to indicate what storage type is replaced. + * @param index one of Cloud::StorageID enum values to indicate what storage type is replaced. */ void replaceStorage(Storage *storage, uint32 index); @@ -160,7 +160,7 @@ public: */ void setStorageUsername(uint32 index, Common::String name); - /** + /** * Set Storage's used space field. * Automatically saves changes to the config. * diff --git a/backends/cloud/downloadrequest.cpp b/backends/cloud/downloadrequest.cpp index e8c410ae3e..33ac81138d 100644 --- a/backends/cloud/downloadrequest.cpp +++ b/backends/cloud/downloadrequest.cpp @@ -66,7 +66,7 @@ void DownloadRequest::streamErrorCallback(Networking::ErrorResponse error) { finishError(error); } -void DownloadRequest::handle() { +void DownloadRequest::handle() { if (!_localFile) { warning("DownloadRequest: no file to write"); finishError(Networking::ErrorResponse(this, false, true, "", -1)); @@ -96,12 +96,12 @@ void DownloadRequest::handle() { if (_remoteFileStream->eos()) { if (_remoteFileStream->httpResponseCode() != 200) { warning("HTTP response code is not 200 OK (it's %ld)", _remoteFileStream->httpResponseCode()); - //TODO: do something about it actually + //TODO: do something about it actually } finishDownload(_remoteFileStream->httpResponseCode() == 200); - _localFile->close(); //yes, I know it's closed automatically in ~DumpFile() + _localFile->close(); //yes, I know it's closed automatically in ~DumpFile() } } diff --git a/backends/cloud/downloadrequest.h b/backends/cloud/downloadrequest.h index 138616a04b..7e58098849 100644 --- a/backends/cloud/downloadrequest.h +++ b/backends/cloud/downloadrequest.h @@ -32,8 +32,8 @@ namespace Cloud { #define DOWNLOAD_REQUEST_BUFFER_SIZE 1 * 1024 * 1024 -class DownloadRequest: public Networking::Request { - Storage::BoolCallback _boolCallback; +class DownloadRequest: public Networking::Request { + Storage::BoolCallback _boolCallback; Common::DumpFile *_localFile; Common::String _remoteFileId; Storage *_storage; diff --git a/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp b/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp index 81ace75dda..6d228224d7 100644 --- a/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp +++ b/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp @@ -44,7 +44,7 @@ DropboxCreateDirectoryRequest::~DropboxCreateDirectoryRequest() { void DropboxCreateDirectoryRequest::start() { _ignoreCallback = true; - if (_workingRequest) _workingRequest->finish(); + if (_workingRequest) _workingRequest->finish(); _ignoreCallback = false; Networking::JsonCallback innerCallback = new Common::Callback<DropboxCreateDirectoryRequest, Networking::JsonResponse>(this, &DropboxCreateDirectoryRequest::responseCallback); @@ -74,13 +74,13 @@ void DropboxCreateDirectoryRequest::responseCallback(Networking::JsonResponse re Networking::CurlJsonRequest *rq = (Networking::CurlJsonRequest *)response.request; if (rq && rq->getNetworkReadStream()) error.httpResponseCode = rq->getNetworkReadStream()->httpResponseCode(); - + if (!json) { warning("NULL passed instead of JSON"); finishError(error); return; } - + Common::JSONObject info = json->asObject(); if (info.contains("id")) finishCreation(true); else { diff --git a/backends/cloud/dropbox/dropboxcreatedirectoryrequest.h b/backends/cloud/dropbox/dropboxcreatedirectoryrequest.h index 4bdc6dbee6..0ef6a22a04 100644 --- a/backends/cloud/dropbox/dropboxcreatedirectoryrequest.h +++ b/backends/cloud/dropbox/dropboxcreatedirectoryrequest.h @@ -37,7 +37,7 @@ class DropboxCreateDirectoryRequest: public Networking::Request { Request *_workingRequest; bool _ignoreCallback; Common::String _date; - + void start(); void responseCallback(Networking::JsonResponse response); void errorCallback(Networking::ErrorResponse error); diff --git a/backends/cloud/dropbox/dropboxinforequest.cpp b/backends/cloud/dropbox/dropboxinforequest.cpp index f5a14abe1c..e147ac58e2 100644 --- a/backends/cloud/dropbox/dropboxinforequest.cpp +++ b/backends/cloud/dropbox/dropboxinforequest.cpp @@ -45,7 +45,7 @@ DropboxInfoRequest::~DropboxInfoRequest() { void DropboxInfoRequest::start() { _ignoreCallback = true; - if (_workingRequest) _workingRequest->finish(); + if (_workingRequest) _workingRequest->finish(); _ignoreCallback = false; Networking::JsonCallback innerCallback = new Common::Callback<DropboxInfoRequest, Networking::JsonResponse>(this, &DropboxInfoRequest::userResponseCallback); @@ -70,7 +70,7 @@ void DropboxInfoRequest::userResponseCallback(Networking::JsonResponse response) Networking::CurlJsonRequest *rq = (Networking::CurlJsonRequest *)response.request; if (rq && rq->getNetworkReadStream()) error.httpResponseCode = rq->getNetworkReadStream()->httpResponseCode(); - + if (!json) { warning("NULL passed instead of JSON"); finishError(error); diff --git a/backends/cloud/dropbox/dropboxinforequest.h b/backends/cloud/dropbox/dropboxinforequest.h index a91d016e60..68a3e135de 100644 --- a/backends/cloud/dropbox/dropboxinforequest.h +++ b/backends/cloud/dropbox/dropboxinforequest.h @@ -36,7 +36,7 @@ class DropboxInfoRequest: public Networking::Request { Storage::StorageInfoCallback _infoCallback; Request *_workingRequest; bool _ignoreCallback; - + void start(); void userResponseCallback(Networking::JsonResponse response); void quotaResponseCallback(Networking::JsonResponse response); diff --git a/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp b/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp index dcbca3131e..cc82f123b1 100644 --- a/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp +++ b/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp @@ -81,7 +81,7 @@ void DropboxListDirectoryRequest::responseCallback(Networking::JsonResponse resp Common::JSONValue *json = response.value; if (json) { Common::JSONObject responseObjecct = json->asObject(); - + if (responseObjecct.contains("error") || responseObjecct.contains("error_summary")) { warning("Dropbox returned error: %s", responseObjecct.getVal("error_summary")->asString().c_str()); error.failed = true; @@ -91,7 +91,7 @@ void DropboxListDirectoryRequest::responseCallback(Networking::JsonResponse resp return; } - //TODO: check that ALL keys exist AND HAVE RIGHT TYPE to avoid segfaults + //TODO: check that ALL keys exist AND HAVE RIGHT TYPE to avoid segfaults if (responseObjecct.contains("entries")) { Common::JSONArray items = responseObjecct.getVal("entries")->asArray(); @@ -110,7 +110,7 @@ void DropboxListDirectoryRequest::responseCallback(Networking::JsonResponse resp bool hasMore = (responseObjecct.contains("has_more") && responseObjecct.getVal("has_more")->asBool()); - if (hasMore) { + if (hasMore) { Networking::JsonCallback callback = new Common::Callback<DropboxListDirectoryRequest, Networking::JsonResponse>(this, &DropboxListDirectoryRequest::responseCallback); Networking::ErrorCallback failureCallback = new Common::Callback<DropboxListDirectoryRequest, Networking::ErrorResponse>(this, &DropboxListDirectoryRequest::errorCallback); Networking::CurlJsonRequest *request = new Networking::CurlJsonRequest(callback, failureCallback, "https://api.dropboxapi.com/2/files/list_folder/continue"); @@ -124,9 +124,9 @@ void DropboxListDirectoryRequest::responseCallback(Networking::JsonResponse resp request->addPostField(Common::JSON::stringify(&value)); _workingRequest = ConnMan.addRequest(request); - } else { + } else { finishListing(_files); - } + } } else { warning("null, not json"); error.failed = true; @@ -149,7 +149,7 @@ void DropboxListDirectoryRequest::restart() { start(); } Common::String DropboxListDirectoryRequest::date() const { return _date; } -void DropboxListDirectoryRequest::finishListing(Common::Array<StorageFile> &files) { +void DropboxListDirectoryRequest::finishListing(Common::Array<StorageFile> &files) { Request::finishSuccess(); if (_listDirectoryCallback) (*_listDirectoryCallback)(Storage::ListDirectoryResponse(this, files)); } diff --git a/backends/cloud/dropbox/dropboxlistdirectoryrequest.h b/backends/cloud/dropbox/dropboxlistdirectoryrequest.h index 62dde71f76..5c0d8dfa21 100644 --- a/backends/cloud/dropbox/dropboxlistdirectoryrequest.h +++ b/backends/cloud/dropbox/dropboxlistdirectoryrequest.h @@ -41,7 +41,7 @@ class DropboxListDirectoryRequest: public Networking::Request { Request *_workingRequest; bool _ignoreCallback; Common::String _date; - + void start(); void responseCallback(Networking::JsonResponse response); void errorCallback(Networking::ErrorResponse error); diff --git a/backends/cloud/dropbox/dropboxstorage.cpp b/backends/cloud/dropbox/dropboxstorage.cpp index 7e3521f40e..7ef07a5a65 100644 --- a/backends/cloud/dropbox/dropboxstorage.cpp +++ b/backends/cloud/dropbox/dropboxstorage.cpp @@ -87,7 +87,7 @@ void DropboxStorage::codeFlowComplete(Networking::JsonResponse response) { CloudMan.removeStorage(this); } else { _token = result.getVal("access_token")->asString(); - _uid = result.getVal("uid")->asString(); + _uid = result.getVal("uid")->asString(); ConfMan.removeKey("dropbox_code", ConfMan.kCloudDomain); CloudMan.replaceStorage(this, kStorageDropboxId); ConfMan.flushToDisk(); diff --git a/backends/cloud/dropbox/dropboxstorage.h b/backends/cloud/dropbox/dropboxstorage.h index 9dd28ba810..0d308f4131 100644 --- a/backends/cloud/dropbox/dropboxstorage.h +++ b/backends/cloud/dropbox/dropboxstorage.h @@ -72,9 +72,9 @@ public: /** Returns ListDirectoryStatus struct with list of files. */ virtual Networking::Request *listDirectory(Common::String path, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback, bool recursive = false); - + /** Returns UploadStatus struct with info about uploaded file. */ - virtual Networking::Request *upload(Common::String path, Common::SeekableReadStream *contents, UploadCallback callback, Networking::ErrorCallback errorCallback); + virtual Networking::Request *upload(Common::String path, Common::SeekableReadStream *contents, UploadCallback callback, Networking::ErrorCallback errorCallback); /** Returns pointer to Networking::NetworkReadStream. */ virtual Networking::Request *streamFileById(Common::String path, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback); @@ -92,7 +92,7 @@ public: virtual Common::String savesDirectoryPath(); /** - * Load token and user id from configs and return DropboxStorage for those. + * Load token and user id from configs and return DropboxStorage for those. * @return pointer to the newly created DropboxStorage or 0 if some problem occured. */ static DropboxStorage *loadFromConfig(Common::String keyPrefix); diff --git a/backends/cloud/dropbox/dropboxuploadrequest.cpp b/backends/cloud/dropbox/dropboxuploadrequest.cpp index 29b7f60c8a..eaa945ada3 100644 --- a/backends/cloud/dropbox/dropboxuploadrequest.cpp +++ b/backends/cloud/dropbox/dropboxuploadrequest.cpp @@ -63,9 +63,9 @@ void DropboxUploadRequest::start() { uploadNextPart(); } -void DropboxUploadRequest::uploadNextPart() { +void DropboxUploadRequest::uploadNextPart() { const uint32 UPLOAD_PER_ONE_REQUEST = 10 * 1024 * 1024; - + Common::String url = "https://content.dropboxapi.com/2/files/upload_session/"; Common::JSONObject jsonRequestParameters; @@ -82,8 +82,8 @@ void DropboxUploadRequest::uploadNextPart() { } } else { if ((uint32)(_contentsStream->size() - _contentsStream->pos()) <= UPLOAD_PER_ONE_REQUEST) { - url += "finish"; - Common::JSONObject jsonCursor, jsonCommit; + url += "finish"; + Common::JSONObject jsonCursor, jsonCommit; jsonCursor.setVal("session_id", new Common::JSONValue(_sessionId)); jsonCursor.setVal("offset", new Common::JSONValue((long long int)_contentsStream->pos())); jsonCommit.setVal("path", new Common::JSONValue(_savePath)); @@ -98,22 +98,22 @@ void DropboxUploadRequest::uploadNextPart() { jsonCursor.setVal("session_id", new Common::JSONValue(_sessionId)); jsonCursor.setVal("offset", new Common::JSONValue((long long int)_contentsStream->pos())); jsonRequestParameters.setVal("cursor", new Common::JSONValue(jsonCursor)); - jsonRequestParameters.setVal("close", new Common::JSONValue(false)); + jsonRequestParameters.setVal("close", new Common::JSONValue(false)); } } - + Common::JSONValue value(jsonRequestParameters); Networking::JsonCallback callback = new Common::Callback<DropboxUploadRequest, Networking::JsonResponse>(this, &DropboxUploadRequest::partUploadedCallback); Networking::ErrorCallback failureCallback = new Common::Callback<DropboxUploadRequest, Networking::ErrorResponse>(this, &DropboxUploadRequest::partUploadedErrorCallback); Networking::CurlJsonRequest *request = new Networking::CurlJsonRequest(callback, failureCallback, url); request->addHeader("Authorization: Bearer " + _token); - request->addHeader("Content-Type: application/octet-stream"); - request->addHeader("Dropbox-API-Arg: " + Common::JSON::stringify(&value)); + request->addHeader("Content-Type: application/octet-stream"); + request->addHeader("Dropbox-API-Arg: " + Common::JSON::stringify(&value)); byte *buffer = new byte[UPLOAD_PER_ONE_REQUEST]; uint32 size = _contentsStream->read(buffer, UPLOAD_PER_ONE_REQUEST); request->setBuffer(buffer, size); - + _workingRequest = ConnMan.addRequest(request); } @@ -137,7 +137,7 @@ void DropboxUploadRequest::partUploadedCallback(Networking::JsonResponse respons //debug("%s", json->stringify(true).c_str()); if (object.contains("error") || object.contains("error_summary")) { - warning("Dropbox returned error: %s", object.getVal("error_summary")->asString().c_str()); + warning("Dropbox returned error: %s", object.getVal("error_summary")->asString().c_str()); error.response = json->stringify(true); finishError(error); delete json; @@ -162,14 +162,14 @@ void DropboxUploadRequest::partUploadedCallback(Networking::JsonResponse respons } } - if (!needsFinishRequest && (_contentsStream->eos() || _contentsStream->pos() >= _contentsStream->size() - 1)) { + if (!needsFinishRequest && (_contentsStream->eos() || _contentsStream->pos() >= _contentsStream->size() - 1)) { warning("no file info to return"); finishUpload(StorageFile(_savePath, 0, 0, false)); } else { uploadNextPart(); } } else { - warning("null, not json"); + warning("null, not json"); finishError(error); } diff --git a/backends/cloud/dropbox/dropboxuploadrequest.h b/backends/cloud/dropbox/dropboxuploadrequest.h index 8d9a3e2650..5adf5a6df2 100644 --- a/backends/cloud/dropbox/dropboxuploadrequest.h +++ b/backends/cloud/dropbox/dropboxuploadrequest.h @@ -39,7 +39,7 @@ class DropboxUploadRequest: public Networking::Request { Request *_workingRequest; bool _ignoreCallback; Common::String _sessionId; - + void start(); void uploadNextPart(); void partUploadedCallback(Networking::JsonResponse response); diff --git a/backends/cloud/folderdownloadrequest.cpp b/backends/cloud/folderdownloadrequest.cpp index 9e05202bf7..de60480423 100644 --- a/backends/cloud/folderdownloadrequest.cpp +++ b/backends/cloud/folderdownloadrequest.cpp @@ -46,7 +46,7 @@ FolderDownloadRequest::~FolderDownloadRequest() { void FolderDownloadRequest::start() { //cleanup _ignoreCallback = true; - if (_workingRequest) _workingRequest->finish(); + if (_workingRequest) _workingRequest->finish(); _currentFile = StorageFile(); _pendingFiles.clear(); _failedFiles.clear(); @@ -108,7 +108,7 @@ void FolderDownloadRequest::downloadNextFile() { finishDownload(_failedFiles); return; } - + _currentFile = _pendingFiles.back(); _pendingFiles.pop_back(); } while (_currentFile.isDirectory()); //TODO: may be create these directories (in case those are empty) @@ -124,7 +124,7 @@ void FolderDownloadRequest::downloadNextFile() { } else { warning("Can't process the following paths:"); warning("remote directory: %s", _remoteDirectoryPath.c_str()); - warning("remote file under that directory: %s", remotePath.c_str()); + warning("remote file under that directory: %s", remotePath.c_str()); } if (_localDirectoryPath != "") { if (_localDirectoryPath.lastChar() == '/' || _localDirectoryPath.lastChar() == '\\') diff --git a/backends/cloud/googledrive/googledrivelistdirectorybyidrequest.cpp b/backends/cloud/googledrive/googledrivelistdirectorybyidrequest.cpp index 36bc390da0..7b05d48784 100644 --- a/backends/cloud/googledrive/googledrivelistdirectorybyidrequest.cpp +++ b/backends/cloud/googledrive/googledrivelistdirectorybyidrequest.cpp @@ -82,7 +82,7 @@ void GoogleDriveListDirectoryByIdRequest::responseCallback(Networking::JsonRespo Common::JSONObject responseObject = json->asObject(); ///debug("%s", json->stringify(true).c_str()); - + if (responseObject.contains("error") || responseObject.contains("error_summary")) { warning("GoogleDrive returned error: %s", responseObject.getVal("error_summary")->asString().c_str()); error.failed = true; @@ -92,7 +92,7 @@ void GoogleDriveListDirectoryByIdRequest::responseCallback(Networking::JsonRespo return; } - //TODO: check that ALL keys exist AND HAVE RIGHT TYPE to avoid segfaults + //TODO: check that ALL keys exist AND HAVE RIGHT TYPE to avoid segfaults if (responseObject.contains("files") && responseObject.getVal("files")->isArray()) { Common::JSONArray items = responseObject.getVal("files")->asArray(); @@ -117,9 +117,9 @@ void GoogleDriveListDirectoryByIdRequest::responseCallback(Networking::JsonRespo if (hasMore) { Common::String token = responseObject.getVal("nextPageToken")->asString(); makeRequest(token); - } else { + } else { finishListing(_files); - } + } } else { warning("null, not json"); error.failed = true; @@ -142,7 +142,7 @@ void GoogleDriveListDirectoryByIdRequest::restart() { start(); } Common::String GoogleDriveListDirectoryByIdRequest::date() const { return _date; } -void GoogleDriveListDirectoryByIdRequest::finishListing(Common::Array<StorageFile> &files) { +void GoogleDriveListDirectoryByIdRequest::finishListing(Common::Array<StorageFile> &files) { Request::finishSuccess(); if (_listDirectoryCallback) (*_listDirectoryCallback)(Storage::ListDirectoryResponse(this, files)); } diff --git a/backends/cloud/googledrive/googledrivelistdirectorybyidrequest.h b/backends/cloud/googledrive/googledrivelistdirectorybyidrequest.h index ecde880323..e94c6b1f4e 100644 --- a/backends/cloud/googledrive/googledrivelistdirectorybyidrequest.h +++ b/backends/cloud/googledrive/googledrivelistdirectorybyidrequest.h @@ -34,7 +34,7 @@ namespace GoogleDrive { class GoogleDriveStorage; class GoogleDriveListDirectoryByIdRequest: public Networking::Request { - Common::String _requestedId; + Common::String _requestedId; GoogleDriveStorage *_storage; Storage::ListDirectoryCallback _listDirectoryCallback; @@ -42,7 +42,7 @@ class GoogleDriveListDirectoryByIdRequest: public Networking::Request { Request *_workingRequest; bool _ignoreCallback; Common::String _date; - + void start(); void makeRequest(Common::String pageToken); void responseCallback(Networking::JsonResponse response); diff --git a/backends/cloud/googledrive/googledrivestorage.cpp b/backends/cloud/googledrive/googledrivestorage.cpp index 77ac8989f1..2d9f33cfce 100644 --- a/backends/cloud/googledrive/googledrivestorage.cpp +++ b/backends/cloud/googledrive/googledrivestorage.cpp @@ -138,7 +138,7 @@ void GoogleDriveStorage::codeFlowFailed(Networking::ErrorResponse error) { CloudMan.removeStorage(this); } -void GoogleDriveStorage::saveConfig(Common::String keyPrefix) { +void GoogleDriveStorage::saveConfig(Common::String keyPrefix) { ConfMan.set(keyPrefix + "access_token", _token, ConfMan.kCloudDomain); ConfMan.set(keyPrefix + "refresh_token", _refreshToken, ConfMan.kCloudDomain); } @@ -173,11 +173,11 @@ void GoogleDriveStorage::infoInnerCallback(StorageInfoCallback outerCallback, Ne //"usageInDrive":"6332462","limit":"18253611008","usage":"6332462","usageInDriveTrash":"0" Common::JSONObject storageQuota = info.getVal("storageQuota")->asObject(); Common::String usage = storageQuota.getVal("usage")->asString(); - Common::String limit = storageQuota.getVal("limit")->asString(); + Common::String limit = storageQuota.getVal("limit")->asString(); quotaUsed = usage.asUint64(); quotaAllocated = limit.asUint64(); } - + CloudMan.setStorageUsername(kStorageGoogleDriveId, email); if (outerCallback) { @@ -197,7 +197,7 @@ void GoogleDriveStorage::createDirectoryInnerCallback(BoolCallback outerCallback } if (outerCallback) { - Common::JSONObject info = json->asObject(); + Common::JSONObject info = json->asObject(); (*outerCallback)(BoolResponse(nullptr, info.contains("id"))); delete outerCallback; } @@ -212,7 +212,7 @@ Networking::Request *GoogleDriveStorage::listDirectoryById(Common::String id, Li } Networking::Request *GoogleDriveStorage::upload(Common::String path, Common::SeekableReadStream *contents, UploadCallback callback, Networking::ErrorCallback errorCallback) { - return addRequest(new GoogleDriveUploadRequest(this, path, contents, callback, errorCallback)); + return addRequest(new GoogleDriveUploadRequest(this, path, contents, callback, errorCallback)); } Networking::Request *GoogleDriveStorage::streamFileById(Common::String id, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback) { @@ -221,7 +221,7 @@ Networking::Request *GoogleDriveStorage::streamFileById(Common::String id, Netwo Common::String header = "Authorization: Bearer " + _token; curl_slist *headersList = curl_slist_append(nullptr, header.c_str()); Networking::NetworkReadStream *stream = new Networking::NetworkReadStream(url.c_str(), headersList, ""); - (*callback)(Networking::NetworkReadStreamResponse(nullptr, stream)); + (*callback)(Networking::NetworkReadStreamResponse(nullptr, stream)); } delete callback; delete errorCallback; @@ -237,8 +237,8 @@ void GoogleDriveStorage::printInfo(StorageInfoResponse response) { Networking::Request *GoogleDriveStorage::createDirectoryWithParentId(Common::String parentId, Common::String name, BoolCallback callback, Networking::ErrorCallback errorCallback) { if (!errorCallback) errorCallback = getErrorPrintingCallback(); - - Common::String url = "https://www.googleapis.com/drive/v3/files"; + + Common::String url = "https://www.googleapis.com/drive/v3/files"; Networking::JsonCallback innerCallback = new Common::CallbackBridge<GoogleDriveStorage, BoolResponse, Networking::JsonResponse>(this, &GoogleDriveStorage::createDirectoryInnerCallback, callback); Networking::CurlJsonRequest *request = new GoogleDriveTokenRefresher(this, innerCallback, errorCallback, url.c_str()); request->addHeader("Authorization: Bearer " + accessToken()); @@ -263,7 +263,7 @@ Networking::Request *GoogleDriveStorage::info(StorageInfoCallback callback, Netw Networking::JsonCallback innerCallback = new Common::CallbackBridge<GoogleDriveStorage, StorageInfoResponse, Networking::JsonResponse>(this, &GoogleDriveStorage::infoInnerCallback, callback); Networking::CurlJsonRequest *request = new GoogleDriveTokenRefresher(this, innerCallback, errorCallback, "https://www.googleapis.com/drive/v3/about?fields=storageQuota,user"); request->addHeader("Authorization: Bearer " + _token); - return addRequest(request); + return addRequest(request); } Common::String GoogleDriveStorage::savesDirectoryPath() { return "scummvm/saves/"; } diff --git a/backends/cloud/googledrive/googledrivestorage.h b/backends/cloud/googledrive/googledrivestorage.h index 4c164dd91d..e60719c770 100644 --- a/backends/cloud/googledrive/googledrivestorage.h +++ b/backends/cloud/googledrive/googledrivestorage.h @@ -95,7 +95,7 @@ public: virtual Common::String savesDirectoryPath(); /** - * Load token and user id from configs and return GoogleDriveStorage for those. + * Load token and user id from configs and return GoogleDriveStorage for those. * @return pointer to the newly created GoogleDriveStorage or 0 if some problem occured. */ static GoogleDriveStorage *loadFromConfig(Common::String keyPrefix); diff --git a/backends/cloud/googledrive/googledrivetokenrefresher.cpp b/backends/cloud/googledrive/googledrivetokenrefresher.cpp index 9e26e62149..b876bc2995 100644 --- a/backends/cloud/googledrive/googledrivetokenrefresher.cpp +++ b/backends/cloud/googledrive/googledrivetokenrefresher.cpp @@ -52,7 +52,7 @@ void GoogleDriveTokenRefresher::tokenRefreshed(Storage::BoolResponse response) { } setHeaders(_headers); - //successfully received refreshed token, can restart the original request now + //successfully received refreshed token, can restart the original request now retry(0); } @@ -65,13 +65,13 @@ void GoogleDriveTokenRefresher::finishJson(Common::JSONValue *json) { Common::JSONObject result = json->asObject(); if (result.contains("error")) { - //new token needed => request token & then retry original request + //new token needed => request token & then retry original request if (_stream) { debug(9, "code %ld", _stream->httpResponseCode()); } Common::JSONObject error = result.getVal("error")->asObject(); - bool irrecoverable = true; + bool irrecoverable = true; uint32 code = -1; Common::String message; @@ -88,13 +88,13 @@ void GoogleDriveTokenRefresher::finishJson(Common::JSONValue *json) { if (code == 401 || message == "Invalid Credentials") irrecoverable = false; - if (irrecoverable) { + if (irrecoverable) { finishError(Networking::ErrorResponse(this, false, true, json->stringify(true), -1)); //TODO: httpCode delete json; return; } - pause(); + pause(); delete json; _parentStorage->getAccessToken(new Common::Callback<GoogleDriveTokenRefresher, Storage::BoolResponse>(this, &GoogleDriveTokenRefresher::tokenRefreshed)); return; @@ -104,7 +104,7 @@ void GoogleDriveTokenRefresher::finishJson(Common::JSONValue *json) { CurlJsonRequest::finishJson(json); } -void GoogleDriveTokenRefresher::setHeaders(Common::Array<Common::String> &headers) { +void GoogleDriveTokenRefresher::setHeaders(Common::Array<Common::String> &headers) { _headers = headers; curl_slist_free_all(_headersList); _headersList = 0; diff --git a/backends/cloud/googledrive/googledrivetokenrefresher.h b/backends/cloud/googledrive/googledrivetokenrefresher.h index 3bc5fbd784..6cb3e41849 100644 --- a/backends/cloud/googledrive/googledrivetokenrefresher.h +++ b/backends/cloud/googledrive/googledrivetokenrefresher.h @@ -33,12 +33,12 @@ class GoogleDriveStorage; class GoogleDriveTokenRefresher: public Networking::CurlJsonRequest { GoogleDriveStorage *_parentStorage; - Common::Array<Common::String> _headers; - + Common::Array<Common::String> _headers; + void tokenRefreshed(Storage::BoolResponse response); virtual void finishJson(Common::JSONValue *json); -public: +public: GoogleDriveTokenRefresher(GoogleDriveStorage *parent, Networking::JsonCallback callback, Networking::ErrorCallback ecb, const char *url); virtual ~GoogleDriveTokenRefresher(); diff --git a/backends/cloud/googledrive/googledriveuploadrequest.cpp b/backends/cloud/googledrive/googledriveuploadrequest.cpp index b63e989df8..4a7c30e9a5 100644 --- a/backends/cloud/googledrive/googledriveuploadrequest.cpp +++ b/backends/cloud/googledrive/googledriveuploadrequest.cpp @@ -164,7 +164,7 @@ void GoogleDriveUploadRequest::startUploadCallback(Networking::JsonResponse resp } } - Common::JSONValue *json = response.value; + Common::JSONValue *json = response.value; delete json; finishError(error); @@ -179,11 +179,11 @@ void GoogleDriveUploadRequest::startUploadErrorCallback(Networking::ErrorRespons void GoogleDriveUploadRequest::uploadNextPart() { const uint32 UPLOAD_PER_ONE_REQUEST = 10 * 1024 * 1024; Common::String url = _uploadUrl; - + Networking::JsonCallback callback = new Common::Callback<GoogleDriveUploadRequest, Networking::JsonResponse>(this, &GoogleDriveUploadRequest::partUploadedCallback); Networking::ErrorCallback failureCallback = new Common::Callback<GoogleDriveUploadRequest, Networking::ErrorResponse>(this, &GoogleDriveUploadRequest::partUploadedErrorCallback); Networking::CurlJsonRequest *request = new GoogleDriveTokenRefresher(_storage, callback, failureCallback, url.c_str()); - request->addHeader("Authorization: Bearer " + _storage->accessToken()); + request->addHeader("Authorization: Bearer " + _storage->accessToken()); request->usePut(); uint32 oldPos = _contentsStream->pos(); @@ -206,17 +206,17 @@ void GoogleDriveUploadRequest::uploadNextPart() { else request->addHeader(Common::String::format("Content-Range: bytes %u-%u/%u", oldPos, _contentsStream->pos() - 1, _contentsStream->size())); } - + _workingRequest = ConnMan.addRequest(request); } bool GoogleDriveUploadRequest::handleHttp308(const Networking::NetworkReadStream *stream) { //308 Resume Incomplete, with Range: X-Y header if (!stream) return false; - if (stream->httpResponseCode() != 308) return false; //seriously - + if (stream->httpResponseCode() != 308) return false; //seriously + Common::String headers = stream->responseHeaders(); - const char *cstr = headers.c_str(); + const char *cstr = headers.c_str(); for (int rangeTry = 0; rangeTry < 2; ++rangeTry) { const char *needle = (rangeTry==0 ? "Range: 0-" : "Range: bytes=0-"); uint32 needleLength = (rangeTry == 0 ? 9 : 15); @@ -239,12 +239,12 @@ bool GoogleDriveUploadRequest::handleHttp308(const Networking::NetworkReadStream return false; } -void GoogleDriveUploadRequest::partUploadedCallback(Networking::JsonResponse response) { +void GoogleDriveUploadRequest::partUploadedCallback(Networking::JsonResponse response) { _workingRequest = nullptr; if (_ignoreCallback) return; - + Networking::ErrorResponse error(this, false, true, "", -1); - Networking::CurlJsonRequest *rq = (Networking::CurlJsonRequest *)response.request; + Networking::CurlJsonRequest *rq = (Networking::CurlJsonRequest *)response.request; if (rq) { const Networking::NetworkReadStream *stream = rq->getNetworkReadStream(); if (stream) { @@ -301,16 +301,16 @@ void GoogleDriveUploadRequest::partUploadedCallback(Networking::JsonResponse res delete json; } -void GoogleDriveUploadRequest::partUploadedErrorCallback(Networking::ErrorResponse error) { +void GoogleDriveUploadRequest::partUploadedErrorCallback(Networking::ErrorResponse error) { _workingRequest = nullptr; if (_ignoreCallback) return; - + Networking::CurlJsonRequest *rq = (Networking::CurlJsonRequest *)error.request; if (rq) { const Networking::NetworkReadStream *stream = rq->getNetworkReadStream(); if (stream) { - long code = stream->httpResponseCode(); - if (code == 308 && handleHttp308(stream)) { + long code = stream->httpResponseCode(); + if (code == 308 && handleHttp308(stream)) { return; } } diff --git a/backends/cloud/googledrive/googledriveuploadrequest.h b/backends/cloud/googledrive/googledriveuploadrequest.h index 8cc40795e9..73acab5bbd 100644 --- a/backends/cloud/googledrive/googledriveuploadrequest.h +++ b/backends/cloud/googledrive/googledriveuploadrequest.h @@ -42,7 +42,7 @@ class GoogleDriveUploadRequest: public Networking::Request { Common::String _resolvedId, _parentId; Common::String _uploadUrl; uint64 _serverReceivedBytes; - + void start(); void resolveId(); void idResolvedCallback(Storage::UploadResponse response); diff --git a/backends/cloud/id/idcreatedirectoryrequest.cpp b/backends/cloud/id/idcreatedirectoryrequest.cpp index 7968a4b126..f64133c888 100644 --- a/backends/cloud/id/idcreatedirectoryrequest.cpp +++ b/backends/cloud/id/idcreatedirectoryrequest.cpp @@ -56,7 +56,7 @@ void IdCreateDirectoryRequest::start() { _workingRequest = _storage->createDirectory("ScummVM", callback, failureCallback); return; } - + resolveId(); } @@ -97,9 +97,9 @@ void IdCreateDirectoryRequest::idResolveFailedCallback(Networking::ErrorResponse _workingRequest = nullptr; if (_ignoreCallback) return; if (error.request) _date = error.request->date(); - + //not resolved => folder not exists - if (error.response.contains("no such file found in its parent directory")) { + if (error.response.contains("no such file found in its parent directory")) { //parent's id after the '\n' Common::String parentId = error.response; for (uint32 i = 0; i < parentId.size(); ++i) diff --git a/backends/cloud/id/iddownloadrequest.cpp b/backends/cloud/id/iddownloadrequest.cpp index 7166a1e026..edd2d26ece 100644 --- a/backends/cloud/id/iddownloadrequest.cpp +++ b/backends/cloud/id/iddownloadrequest.cpp @@ -48,7 +48,7 @@ void IdDownloadRequest::start() { //find file's id Storage::UploadCallback innerCallback = new Common::Callback<IdDownloadRequest, Storage::UploadResponse>(this, &IdDownloadRequest::idResolvedCallback); - Networking::ErrorCallback innerErrorCallback = new Common::Callback<IdDownloadRequest, Networking::ErrorResponse>(this, &IdDownloadRequest::idResolveFailedCallback); + Networking::ErrorCallback innerErrorCallback = new Common::Callback<IdDownloadRequest, Networking::ErrorResponse>(this, &IdDownloadRequest::idResolveFailedCallback); _workingRequest = _storage->resolveFileId(_requestedFile, innerCallback, innerErrorCallback); } diff --git a/backends/cloud/id/idlistdirectoryrequest.cpp b/backends/cloud/id/idlistdirectoryrequest.cpp index 012065dc77..6c70ed56a2 100644 --- a/backends/cloud/id/idlistdirectoryrequest.cpp +++ b/backends/cloud/id/idlistdirectoryrequest.cpp @@ -83,7 +83,7 @@ void IdListDirectoryRequest::listNextDirectory() { _directoriesQueue.pop_back(); Storage::FileArrayCallback callback = new Common::Callback<IdListDirectoryRequest, Storage::FileArrayResponse>(this, &IdListDirectoryRequest::listedDirectoryCallback); - Networking::ErrorCallback failureCallback = new Common::Callback<IdListDirectoryRequest, Networking::ErrorResponse>(this, &IdListDirectoryRequest::listedDirectoryErrorCallback); + Networking::ErrorCallback failureCallback = new Common::Callback<IdListDirectoryRequest, Networking::ErrorResponse>(this, &IdListDirectoryRequest::listedDirectoryErrorCallback); _workingRequest = _storage->listDirectoryById(_currentDirectory.id(), callback, failureCallback); } diff --git a/backends/cloud/id/idresolveidrequest.cpp b/backends/cloud/id/idresolveidrequest.cpp index fc61137088..abd64df1db 100644 --- a/backends/cloud/id/idresolveidrequest.cpp +++ b/backends/cloud/id/idresolveidrequest.cpp @@ -47,7 +47,7 @@ void IdResolveIdRequest::start() { _currentDirectory = ""; _currentDirectoryId = _storage->getRootDirectoryId(); _ignoreCallback = false; - + listNextDirectory(StorageFile(_currentDirectoryId, 0, 0, true)); } @@ -62,10 +62,10 @@ void IdResolveIdRequest::listNextDirectory(StorageFile fileToReturn) { _workingRequest = _storage->listDirectoryById(_currentDirectoryId, callback, failureCallback); } -void IdResolveIdRequest::listedDirectoryCallback(Storage::FileArrayResponse response) { +void IdResolveIdRequest::listedDirectoryCallback(Storage::FileArrayResponse response) { _workingRequest = nullptr; if (_ignoreCallback) return; - + Common::String currentLevelName = _requestedPath; ///debug("'%s'", currentLevelName.c_str()); if (_currentDirectory.size()) currentLevelName.erase(0, _currentDirectory.size()); diff --git a/backends/cloud/id/idresolveidrequest.h b/backends/cloud/id/idresolveidrequest.h index 94d4af5030..e735e96385 100644 --- a/backends/cloud/id/idresolveidrequest.h +++ b/backends/cloud/id/idresolveidrequest.h @@ -33,7 +33,7 @@ namespace Id { class IdStorage; class IdResolveIdRequest: public Networking::Request { - Common::String _requestedPath; + Common::String _requestedPath; IdStorage *_storage; Storage::UploadCallback _uploadCallback; Common::String _currentDirectory; diff --git a/backends/cloud/id/idstorage.h b/backends/cloud/id/idstorage.h index ccadc0e455..7e64fd4a37 100644 --- a/backends/cloud/id/idstorage.h +++ b/backends/cloud/id/idstorage.h @@ -50,7 +50,7 @@ protected: void printFile(UploadResponse response); ListDirectoryCallback getPrintFilesCallback(); - + public: virtual ~IdStorage(); diff --git a/backends/cloud/id/idstreamfilerequest.cpp b/backends/cloud/id/idstreamfilerequest.cpp index 08060b9e40..cc1ce2c54f 100644 --- a/backends/cloud/id/idstreamfilerequest.cpp +++ b/backends/cloud/id/idstreamfilerequest.cpp @@ -47,7 +47,7 @@ void IdStreamFileRequest::start() { //find file's id Storage::UploadCallback innerCallback = new Common::Callback<IdStreamFileRequest, Storage::UploadResponse>(this, &IdStreamFileRequest::idResolvedCallback); - Networking::ErrorCallback innerErrorCallback = new Common::Callback<IdStreamFileRequest, Networking::ErrorResponse>(this, &IdStreamFileRequest::idResolveFailedCallback); + Networking::ErrorCallback innerErrorCallback = new Common::Callback<IdStreamFileRequest, Networking::ErrorResponse>(this, &IdStreamFileRequest::idResolveFailedCallback); _workingRequest = _storage->resolveFileId(_requestedFile, innerCallback, innerErrorCallback); } diff --git a/backends/cloud/iso8601.cpp b/backends/cloud/iso8601.cpp index 1675c7ce54..b2483fd7f9 100644 --- a/backends/cloud/iso8601.cpp +++ b/backends/cloud/iso8601.cpp @@ -44,9 +44,9 @@ int find(const char *cstr, uint32 startPosition, char needle) { namespace Cloud { namespace ISO8601 { -uint32 convertToTimestamp(const Common::String &iso8601Date) { +uint32 convertToTimestamp(const Common::String &iso8601Date) { //2015-05-12T15:50:38Z - const char *cstr = iso8601Date.c_str(); + const char *cstr = iso8601Date.c_str(); int firstHyphen = find(cstr, 0, '-'); int secondHyphen = find(cstr, firstHyphen + 1, '-'); int tSeparator = find(cstr, secondHyphen + 1, 'T'); @@ -54,7 +54,7 @@ uint32 convertToTimestamp(const Common::String &iso8601Date) { int secondColon = find(cstr, firstColon + 1, ':'); int zSeparator = find(cstr, secondColon + 1, 'Z'); if (zSeparator == -1) zSeparator = find(cstr, secondColon + 1, '-'); // Box's RFC 3339 - //now note '+1' which means if there ever was '-1' result of find(), we still did a valid find() from 0th char + //now note '+1' which means if there ever was '-1' result of find(), we still did a valid find() from 0th char Common::String year = getSubstring(iso8601Date, 0, firstHyphen); Common::String month = getSubstring(iso8601Date, firstHyphen + 1, secondHyphen); diff --git a/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp b/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp index 617346529b..c934f2e684 100644 --- a/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp +++ b/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp @@ -45,7 +45,7 @@ OneDriveCreateDirectoryRequest::~OneDriveCreateDirectoryRequest() { void OneDriveCreateDirectoryRequest::start() { _ignoreCallback = true; - if (_workingRequest) _workingRequest->finish(); + if (_workingRequest) _workingRequest->finish(); _ignoreCallback = false; Common::String name = _path, parent = _path; @@ -54,7 +54,7 @@ void OneDriveCreateDirectoryRequest::start() { while (true) { parent.deleteLastChar(); if (name[i] == '/' || name[i] == '\\') { - name.erase(0, i + 1); + name.erase(0, i + 1); break; } if (i == 0) break; @@ -62,9 +62,9 @@ void OneDriveCreateDirectoryRequest::start() { } } - Common::String url = "https://api.onedrive.com/v1.0/drive/special/approot"; + Common::String url = "https://api.onedrive.com/v1.0/drive/special/approot"; if (parent != "") url += ":/" + ConnMan.urlEncode(parent) + ":"; - url += "/children"; + url += "/children"; Networking::JsonCallback innerCallback = new Common::Callback<OneDriveCreateDirectoryRequest, Networking::JsonResponse>(this, &OneDriveCreateDirectoryRequest::responseCallback); Networking::ErrorCallback errorCallback = new Common::Callback<OneDriveCreateDirectoryRequest, Networking::ErrorResponse>(this, &OneDriveCreateDirectoryRequest::errorCallback); Networking::CurlJsonRequest *request = new OneDriveTokenRefresher(_storage, innerCallback, errorCallback, url.c_str()); @@ -93,13 +93,13 @@ void OneDriveCreateDirectoryRequest::responseCallback(Networking::JsonResponse r Networking::CurlJsonRequest *rq = (Networking::CurlJsonRequest *)response.request; if (rq && rq->getNetworkReadStream()) error.httpResponseCode = rq->getNetworkReadStream()->httpResponseCode(); - + if (!json) { warning("NULL passed instead of JSON"); finishError(error); return; } - + Common::JSONObject info = json->asObject(); if (info.contains("id")) finishCreation(true); else { diff --git a/backends/cloud/onedrive/onedrivecreatedirectoryrequest.h b/backends/cloud/onedrive/onedrivecreatedirectoryrequest.h index 83c72c4e0a..acaca2bf00 100644 --- a/backends/cloud/onedrive/onedrivecreatedirectoryrequest.h +++ b/backends/cloud/onedrive/onedrivecreatedirectoryrequest.h @@ -39,7 +39,7 @@ class OneDriveCreateDirectoryRequest: public Networking::Request { Request *_workingRequest; bool _ignoreCallback; Common::String _date; - + void start(); void responseCallback(Networking::JsonResponse response); void errorCallback(Networking::ErrorResponse error); diff --git a/backends/cloud/onedrive/onedrivelistdirectoryrequest.cpp b/backends/cloud/onedrive/onedrivelistdirectoryrequest.cpp index baccdf418e..d0b2714989 100644 --- a/backends/cloud/onedrive/onedrivelistdirectoryrequest.cpp +++ b/backends/cloud/onedrive/onedrivelistdirectoryrequest.cpp @@ -77,7 +77,7 @@ void OneDriveListDirectoryRequest::listNextDirectory() { makeRequest(url); } -void OneDriveListDirectoryRequest::makeRequest(Common::String url) { +void OneDriveListDirectoryRequest::makeRequest(Common::String url) { Networking::JsonCallback callback = new Common::Callback<OneDriveListDirectoryRequest, Networking::JsonResponse>(this, &OneDriveListDirectoryRequest::listedDirectoryCallback); Networking::ErrorCallback failureCallback = new Common::Callback<OneDriveListDirectoryRequest, Networking::ErrorResponse>(this, &OneDriveListDirectoryRequest::listedDirectoryErrorCallback); Networking::CurlJsonRequest *request = new OneDriveTokenRefresher(_storage, callback, failureCallback, url.c_str()); @@ -107,18 +107,18 @@ void OneDriveListDirectoryRequest::listedDirectoryCallback(Networking::JsonRespo return; } - Common::JSONObject object = json->asObject(); - + Common::JSONObject object = json->asObject(); + //TODO: check that ALL keys exist AND HAVE RIGHT TYPE to avoid segfaults Common::JSONArray items = object.getVal("value")->asArray(); for (uint32 i = 0; i < items.size(); ++i) { - Common::JSONObject item = items[i]->asObject(); + Common::JSONObject item = items[i]->asObject(); Common::String path = _currentDirectory + item.getVal("name")->asString(); - bool isDirectory = item.contains("folder"); + bool isDirectory = item.contains("folder"); uint32 size = item.getVal("size")->asIntegerNumber(); - uint32 timestamp = ISO8601::convertToTimestamp(item.getVal("lastModifiedDateTime")->asString()); + uint32 timestamp = ISO8601::convertToTimestamp(item.getVal("lastModifiedDateTime")->asString()); StorageFile file(path, size, timestamp, isDirectory); _files.push_back(file); diff --git a/backends/cloud/onedrive/onedrivestorage.cpp b/backends/cloud/onedrive/onedrivestorage.cpp index 39213e82ed..5fc10b748c 100644 --- a/backends/cloud/onedrive/onedrivestorage.cpp +++ b/backends/cloud/onedrive/onedrivestorage.cpp @@ -154,7 +154,7 @@ void OneDriveStorage::infoInnerCallback(StorageInfoCallback outerCallback, Netwo delete outerCallback; return; } - + Common::JSONObject info = json->asObject(); Common::String uid, name, email; diff --git a/backends/cloud/onedrive/onedrivestorage.h b/backends/cloud/onedrive/onedrivestorage.h index 60817e6084..4985f3fd67 100644 --- a/backends/cloud/onedrive/onedrivestorage.h +++ b/backends/cloud/onedrive/onedrivestorage.h @@ -47,7 +47,7 @@ class OneDriveStorage: public Cloud::Storage { void infoInnerCallback(StorageInfoCallback outerCallback, Networking::JsonResponse json); void fileInfoCallback(Networking::NetworkReadStreamCallback outerCallback, Networking::JsonResponse response); -public: +public: /** This constructor uses OAuth code flow to get tokens. */ OneDriveStorage(Common::String code); virtual ~OneDriveStorage(); @@ -92,7 +92,7 @@ public: virtual Common::String savesDirectoryPath(); /** - * Load token and user id from configs and return OneDriveStorage for those. + * Load token and user id from configs and return OneDriveStorage for those. * @return pointer to the newly created OneDriveStorage or 0 if some problem occured. */ static OneDriveStorage *loadFromConfig(Common::String keyPrefix); diff --git a/backends/cloud/onedrive/onedrivetokenrefresher.cpp b/backends/cloud/onedrive/onedrivetokenrefresher.cpp index 9afea3d5bd..88b5154d8a 100644 --- a/backends/cloud/onedrive/onedrivetokenrefresher.cpp +++ b/backends/cloud/onedrive/onedrivetokenrefresher.cpp @@ -52,7 +52,7 @@ void OneDriveTokenRefresher::tokenRefreshed(Storage::BoolResponse response) { } setHeaders(_headers); - //successfully received refreshed token, can restart the original request now + //successfully received refreshed token, can restart the original request now retry(0); } @@ -65,7 +65,7 @@ void OneDriveTokenRefresher::finishJson(Common::JSONValue *json) { Common::JSONObject result = json->asObject(); if (result.contains("error")) { - //new token needed => request token & then retry original request + //new token needed => request token & then retry original request if (_stream) { debug(9, "code %ld", _stream->httpResponseCode()); } @@ -76,7 +76,7 @@ void OneDriveTokenRefresher::finishJson(Common::JSONValue *json) { Common::String code, message; if (error.contains("code")) { code = error.getVal("code")->asString(); - debug(9, "code = %s", code.c_str()); + debug(9, "code = %s", code.c_str()); } if (error.contains("message")) { @@ -92,13 +92,13 @@ void OneDriveTokenRefresher::finishJson(Common::JSONValue *json) { if (code == "unauthenticated") irrecoverable = false; - if (irrecoverable) { + if (irrecoverable) { finishError(Networking::ErrorResponse(this, false, true, json->stringify(true), -1)); //TODO: httpCode delete json; return; } - pause(); + pause(); delete json; _parentStorage->getAccessToken(new Common::Callback<OneDriveTokenRefresher, Storage::BoolResponse>(this, &OneDriveTokenRefresher::tokenRefreshed)); return; @@ -108,7 +108,7 @@ void OneDriveTokenRefresher::finishJson(Common::JSONValue *json) { CurlJsonRequest::finishJson(json); } -void OneDriveTokenRefresher::setHeaders(Common::Array<Common::String> &headers) { +void OneDriveTokenRefresher::setHeaders(Common::Array<Common::String> &headers) { _headers = headers; curl_slist_free_all(_headersList); _headersList = 0; diff --git a/backends/cloud/onedrive/onedrivetokenrefresher.h b/backends/cloud/onedrive/onedrivetokenrefresher.h index 4be1fa726b..77e34d4e03 100644 --- a/backends/cloud/onedrive/onedrivetokenrefresher.h +++ b/backends/cloud/onedrive/onedrivetokenrefresher.h @@ -33,12 +33,12 @@ class OneDriveStorage; class OneDriveTokenRefresher: public Networking::CurlJsonRequest { OneDriveStorage *_parentStorage; - Common::Array<Common::String> _headers; - + Common::Array<Common::String> _headers; + void tokenRefreshed(Storage::BoolResponse response); virtual void finishJson(Common::JSONValue *json); -public: +public: OneDriveTokenRefresher(OneDriveStorage *parent, Networking::JsonCallback callback, Networking::ErrorCallback ecb, const char *url); virtual ~OneDriveTokenRefresher(); diff --git a/backends/cloud/onedrive/onedriveuploadrequest.cpp b/backends/cloud/onedrive/onedriveuploadrequest.cpp index 569809d16b..2af4d06741 100644 --- a/backends/cloud/onedrive/onedriveuploadrequest.cpp +++ b/backends/cloud/onedrive/onedriveuploadrequest.cpp @@ -64,7 +64,7 @@ void OneDriveUploadRequest::start() { uploadNextPart(); } -void OneDriveUploadRequest::uploadNextPart() { +void OneDriveUploadRequest::uploadNextPart() { const uint32 UPLOAD_PER_ONE_REQUEST = 10 * 1024 * 1024; if (_uploadUrl == "" && (uint32)_contentsStream->size() > UPLOAD_PER_ONE_REQUEST) { @@ -79,16 +79,16 @@ void OneDriveUploadRequest::uploadNextPart() { } Common::String url; - if (_uploadUrl == "") { + if (_uploadUrl == "") { url = "https://api.onedrive.com/v1.0/drive/special/approot:/"+ConnMan.urlEncode(_savePath)+":/content"; - } else { + } else { url = _uploadUrl; } - + Networking::JsonCallback callback = new Common::Callback<OneDriveUploadRequest, Networking::JsonResponse>(this, &OneDriveUploadRequest::partUploadedCallback); Networking::ErrorCallback failureCallback = new Common::Callback<OneDriveUploadRequest, Networking::ErrorResponse>(this, &OneDriveUploadRequest::partUploadedErrorCallback); Networking::CurlJsonRequest *request = new OneDriveTokenRefresher(_storage, callback, failureCallback, url.c_str()); - request->addHeader("Authorization: Bearer " + _storage->accessToken()); + request->addHeader("Authorization: Bearer " + _storage->accessToken()); request->usePut(); uint32 oldPos = _contentsStream->pos(); @@ -106,18 +106,18 @@ void OneDriveUploadRequest::uploadNextPart() { delete request; return; } - + _workingRequest = ConnMan.addRequest(request); } -void OneDriveUploadRequest::partUploadedCallback(Networking::JsonResponse response) { +void OneDriveUploadRequest::partUploadedCallback(Networking::JsonResponse response) { _workingRequest = nullptr; if (_ignoreCallback) return; - + Networking::ErrorResponse error(this, false, true, "", -1); Networking::CurlJsonRequest *rq = (Networking::CurlJsonRequest *)response.request; if (rq && rq->getNetworkReadStream()) - error.httpResponseCode = rq->getNetworkReadStream()->httpResponseCode(); + error.httpResponseCode = rq->getNetworkReadStream()->httpResponseCode(); Common::JSONValue *json = response.value; if (json) { @@ -133,7 +133,7 @@ void OneDriveUploadRequest::partUploadedCallback(Networking::JsonResponse respon } if (object.contains("id") && object.contains("name")) { - //finished + //finished Common::String path = _savePath; uint32 size = object.getVal("size")->asIntegerNumber(); uint32 timestamp = ISO8601::convertToTimestamp(object.getVal("lastModifiedDateTime")->asString()); @@ -145,7 +145,7 @@ void OneDriveUploadRequest::partUploadedCallback(Networking::JsonResponse respon if (object.contains("uploadUrl")) _uploadUrl = object.getVal("uploadUrl")->asString(); else - warning("no uploadUrl found in OneDrive's response"); + warning("no uploadUrl found in OneDrive's response"); } } @@ -156,14 +156,14 @@ void OneDriveUploadRequest::partUploadedCallback(Networking::JsonResponse respon uploadNextPart(); } } else { - warning("null, not json"); + warning("null, not json"); finishError(error); } delete json; } -void OneDriveUploadRequest::partUploadedErrorCallback(Networking::ErrorResponse error) { +void OneDriveUploadRequest::partUploadedErrorCallback(Networking::ErrorResponse error) { _workingRequest = nullptr; if (_ignoreCallback) return; finishError(error); diff --git a/backends/cloud/onedrive/onedriveuploadrequest.h b/backends/cloud/onedrive/onedriveuploadrequest.h index f613c415e1..4e2cb24a7f 100644 --- a/backends/cloud/onedrive/onedriveuploadrequest.h +++ b/backends/cloud/onedrive/onedriveuploadrequest.h @@ -40,7 +40,7 @@ class OneDriveUploadRequest: public Networking::Request { Request *_workingRequest; bool _ignoreCallback; Common::String _uploadUrl; - + void start(); void uploadNextPart(); void partUploadedCallback(Networking::JsonResponse response); diff --git a/backends/cloud/savessyncrequest.cpp b/backends/cloud/savessyncrequest.cpp index 014e6a0ae6..957b7e655d 100644 --- a/backends/cloud/savessyncrequest.cpp +++ b/backends/cloud/savessyncrequest.cpp @@ -48,7 +48,7 @@ SavesSyncRequest::~SavesSyncRequest() { void SavesSyncRequest::start() { //cleanup _ignoreCallback = true; - if (_workingRequest) _workingRequest->finish(); + if (_workingRequest) _workingRequest->finish(); _currentDownloadingFile = StorageFile(); _currentUploadingFile = ""; _filesToDownload.clear(); @@ -78,7 +78,7 @@ void SavesSyncRequest::directoryListedCallback(Storage::ListDirectoryResponse re if (response.request) _date = response.request->date(); Common::HashMap<Common::String, bool> localFileNotAvailableInCloud; - for (Common::HashMap<Common::String, uint32>::iterator i = _localFilesTimestamps.begin(); i != _localFilesTimestamps.end(); ++i) { + for (Common::HashMap<Common::String, uint32>::iterator i = _localFilesTimestamps.begin(); i != _localFilesTimestamps.end(); ++i) { localFileNotAvailableInCloud[i->_key] = true; } @@ -96,7 +96,7 @@ void SavesSyncRequest::directoryListedCallback(Storage::ListDirectoryResponse re _filesToDownload.push_back(file); else { localFileNotAvailableInCloud[name] = false; - + if (_localFilesTimestamps[name] == file.timestamp()) continue; @@ -145,7 +145,7 @@ void SavesSyncRequest::directoryListedErrorCallback(Networking::ErrorResponse er //Dropbox-related error: if (object.contains("error_summary")) { Common::String summary = object.getVal("error_summary")->asString(); - if (summary.contains("not_found")) { + if (summary.contains("not_found")) { irrecoverable = false; } } @@ -223,7 +223,7 @@ void SavesSyncRequest::downloadNextFile() { _filesToDownload.pop_back(); sendCommand(GUI::kSavesSyncProgressCmd, (int)(getDownloadingProgress() * 100)); - + debug(9, "downloading %s (%d %%)", _currentDownloadingFile.name().c_str(), (int)(getProgress() * 100)); _workingRequest = _storage->downloadById(_currentDownloadingFile.id(), DefaultSaveFileManager::concatWithSavesPath(_currentDownloadingFile.name()), new Common::Callback<SavesSyncRequest, Storage::BoolResponse>(this, &SavesSyncRequest::fileDownloadedCallback), @@ -258,7 +258,7 @@ void SavesSyncRequest::fileDownloadedErrorCallback(Networking::ErrorResponse err if (_ignoreCallback) return; //stop syncing if download failed - finishError(error); + finishError(error); } void SavesSyncRequest::uploadNextFile() { @@ -269,8 +269,8 @@ void SavesSyncRequest::uploadNextFile() { _currentUploadingFile = _filesToUpload.back(); _filesToUpload.pop_back(); - - debug(9, "uploading %s (%d %%)", _currentUploadingFile.c_str(), (int)(getProgress()*100)); + + debug(9, "uploading %s (%d %%)", _currentUploadingFile.c_str(), (int)(getProgress()*100)); if (_storage->uploadStreamSupported()) { _workingRequest = _storage->upload(_storage->savesDirectoryPath() + _currentUploadingFile, g_system->getSavefileManager()->openRawFile(_currentUploadingFile), new Common::Callback<SavesSyncRequest, Storage::UploadResponse>(this, &SavesSyncRequest::fileUploadedCallback), @@ -288,7 +288,7 @@ void SavesSyncRequest::uploadNextFile() { void SavesSyncRequest::fileUploadedCallback(Storage::UploadResponse response) { _workingRequest = nullptr; if (_ignoreCallback) return; - + //update local timestamp for the uploaded file _localFilesTimestamps = DefaultSaveFileManager::loadTimestamps(); _localFilesTimestamps[_currentUploadingFile] = response.value.timestamp(); @@ -345,7 +345,7 @@ void SavesSyncRequest::finishError(Networking::ErrorResponse error) { debug("SavesSync::finishError"); //if we were downloading a file - remember the name //and make the Request close() it, so we can delete it - Common::String name = _currentDownloadingFile.name(); + Common::String name = _currentDownloadingFile.name(); if (_workingRequest) { _ignoreCallback = true; _workingRequest->finish(); diff --git a/backends/cloud/savessyncrequest.h b/backends/cloud/savessyncrequest.h index 304c44407c..e891e93969 100644 --- a/backends/cloud/savessyncrequest.h +++ b/backends/cloud/savessyncrequest.h @@ -57,7 +57,7 @@ class SavesSyncRequest: public Networking::Request, public GUI::CommandSender { void uploadNextFile(); virtual void finishError(Networking::ErrorResponse error); void finishSync(bool success); - + public: SavesSyncRequest(Storage *storage, Storage::BoolCallback callback, Networking::ErrorCallback ecb); virtual ~SavesSyncRequest(); diff --git a/backends/cloud/storage.cpp b/backends/cloud/storage.cpp index 100d72b5be..dc403dfb30 100644 --- a/backends/cloud/storage.cpp +++ b/backends/cloud/storage.cpp @@ -132,7 +132,7 @@ SavesSyncRequest *Storage::syncSaves(BoolCallback callback, Networking::ErrorCal if (!errorCallback) errorCallback = new Common::Callback<Storage, Networking::ErrorResponse>(this, &Storage::savesSyncDefaultErrorCallback); _savesSyncRequest = new SavesSyncRequest(this, callback, errorCallback); _syncRestartRequestsed = false; - _runningRequestsMutex.unlock(); + _runningRequestsMutex.unlock(); return (SavesSyncRequest *)addRequest(_savesSyncRequest); //who knows what that ConnMan could return in the future } diff --git a/backends/cloud/storage.h b/backends/cloud/storage.h index eaa6e9cea0..8582a7575a 100644 --- a/backends/cloud/storage.h +++ b/backends/cloud/storage.h @@ -110,7 +110,7 @@ public: virtual void saveConfig(Common::String keyPrefix) = 0; /** - * Return unique storage name. + * Return unique storage name. * @returns some unique storage name (for example, "Dropbox (user@example.com)") */ virtual Common::String name() const = 0; @@ -125,7 +125,7 @@ public: /** Returns ListDirectoryResponse with list of files. */ virtual Networking::Request *listDirectory(Common::String path, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback, bool recursive = false) = 0; - + /** Returns StorageFile with info about uploaded file. */ virtual Networking::Request *upload(Common::String path, Common::SeekableReadStream *contents, UploadCallback callback, Networking::ErrorCallback errorCallback) = 0; virtual Networking::Request *upload(Common::String remotePath, Common::String localPath, UploadCallback callback, Networking::ErrorCallback errorCallback); diff --git a/backends/cloud/storageinfo.h b/backends/cloud/storageinfo.h index e0666bc190..469f0402c0 100644 --- a/backends/cloud/storageinfo.h +++ b/backends/cloud/storageinfo.h @@ -32,7 +32,7 @@ namespace Cloud { * It's disk quota usage, owner name, and such. */ -class StorageInfo { +class StorageInfo { Common::String _uid, _name, _email; uint64 _usedBytes, _allocatedBytes; |