aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/onedrive
AgeCommit message (Collapse)Author
2016-08-24CLOUD: Fix finishSuccess() warningAlexander Tkachev
2016-08-24CLOUD: Fix "signed/unsigned integers" warningAlexander Tkachev
The "comparison between signed and unsigned integer expressions" one. Note that in UploadRequests size() and pos() are acutally signed, because they could return -1. This commit implies that Requests are working with such Streams which doesn't.
2016-08-24CLOUD: Use correct redirect_urisAlexander Tkachev
Usage of #ifdef there (and in StorageWizardDialog) means that ScummVM doesn't support both local webserver and scummvm.org paths at the same time. It's either built with SDL_net (thus supporting localhost path) or without it (thus using scummvm.org).
2016-08-24CLOUD: Get rid of CloudConfigHelper, use kCloudDomain where approriatePeter Bozsó
2016-08-24CLOUD: Do saves sync on Storage connectAlexander Tkachev
2016-08-24CLOUD: Introduce CloudConfigHelperPeter Bozsó
2016-08-24CLOUD: Fix getAccessToken()Alexander Tkachev
KEY and SECRET should now load before getAccessToken() uses them, so it should work now.
2016-08-24GUI: Add EditText in StorageWizardDialogAlexander Tkachev
One can enter the code, press 'Connect' button and get a working Storage!
2016-08-24CLOUD: Add Request::date()Alexander Tkachev
Used in SavesSyncRequest to update Storage's last sync date.
2016-08-24CLOUD: Add ConnMan::urlEncode()Alexander Tkachev
Tried to use it everywhere I should've use it.
2016-08-24GUI: Add Refresh button in Options Cloud tabAlexander Tkachev
Commit changes CloudManager and Storages so they would automatically refresh the fields when the could.
2016-08-24CLOUD: Update CloudManagerAlexander Tkachev
It now has methods to update Storage's information.
2016-08-24CLOUD: Update CloudManagerAlexander Tkachev
It now supports only one storage of each type. Only one Storage could be loaded to the memory as well. Options' Cloud tab now changes the Storage only when user pressed OK button, giving the ability to look through the Storages without actually changing them.
2016-08-24CLOUD: Update CloudManager and StorageAlexander Tkachev
* Storage::name(); * CloudManager::getStorageName(); * CloudManager::getStorageIndex(); * CloudManager::listStorages(); * CloudManager::switchStorage().
2016-08-24CLOUD: Update downloading in StoragesAlexander Tkachev
Id should be used everywhere.
2016-08-24CLOUD: Make CloudManager singletonAlexander Tkachev
It's needed to ::destroy() it in main().
2016-08-24CLOUD: Implement Storage's isWorking()Alexander Tkachev
It now keeps track of how many Requests are running. To achieve that, we had to pass a callback to ConnectionManager, so each Request has a callback paired with it. If that's one of Storage's Requests, it has a callback, which would decrease a counter. When Storage adds a Request, it also increases a counter and passes that callback. Callback is called by ConnMan when Request is deleted. isWorking() returns true if there is at least one Request running.
2016-08-24CLOUD: Shorten Cloud APIAlexander Tkachev
touch() and isSyncing() are not needed. remove() is not needed too, but it could be used in the future.
2016-08-24CLOUD: Add OneDriveCreateDirectoryRequestAlexander Tkachev
2016-08-24CLOUD: Add DropboxCreateDirectoryRequestAlexander Tkachev
Also add CloudManager::testFeature(), because syncSaves() now works fine and I don't want to break it again and again with my testing requests.
2016-08-24CLOUD: Move download methods into StorageAlexander Tkachev
DownloadRequest and FolderDownloadRequest are using other Storage's methods. Thus, download() and downloadFolder() could be implemented in base Storage class.
2016-08-24CLOUD: Use uint64 in StorageInfoAlexander Tkachev
There was a warning regarding 25 GB constant. By the way, I'm not sure how to print uint64 (%llu is available in C99 only, and gcc produces a warning about that).
2016-08-24CLOUD: Make syncSaves() common for all StoragesAlexander Tkachev
As it uses SavesSyncRequest and this request is using Storage's upload(), download() and listDirectory(), there is no need to make storage-dependent version of that request and so method could be implemented in base Storage.
2016-08-24CLOUD: Add OneDrive::info()Alexander Tkachev
Unfortunately, OneDrive doesn't share quota information anymore because of some reason. I had to get as much information as I could.
2016-08-24CLOUD: Make SavesSyncRequest work with OneDriveAlexander Tkachev
It actually works fine, but small Storage::savesDirectoryPath() was added, because Dropbox's directories must start with a slash, and OneDrive's directories must not. Saves sync tested and it works fine with OneDrive.
2016-08-24CLOUD: Add OneDriveUploadRequestAlexander Tkachev
Doesn't support server's requested ranges yet. Commit also adds some PUT-related code in NetworkReadStream and CurlRequest.
2016-08-24CLOUD: Refactor RequestAlexander Tkachev
Added ErrorResponse and ErrorCallback. Each Request now has an ErrorCallback, which should be called instead of usual callback in case of failure.
2016-08-24CLOUD: Fix OneDriveTokenRefresherAlexander Tkachev
It was calling finish(), causing stack overflow. Some minor changes are added also.
2016-08-24CLOUD: Add ListDirectoryStatus structAlexander Tkachev
It contains flags to indicate whether Request was interrupted or failed, so dependent Requests may see that list is incomplete.
2016-08-24CLOUD: Add UploadStatus structAlexander Tkachev
It contains not just "success" flag, but also "file" struct, so the caller can find out some information about uploaded file - like timestamp.
2016-08-24CLOUD: Add DropboxUploadRequestAlexander Tkachev
2016-08-24Remove some unnecessary blank linesPeter Bozsó
2016-08-24Fix comment formattingPeter Bozsó
2016-08-24CLOUD: Add OneDriveStorage::downloadFolder()Alexander Tkachev
Just uses FolderDownloadRequest the way DropboxStorage does.
2016-08-24CLOUD: Add OneDriveListDirectoryRequestAlexander Tkachev
Works as charm.
2016-08-24CLOUD: Fix "global destructor" warningAlexander Tkachev
Plain char * is used instead of Common::String in DropboxStorage and OneDriveStorage's KEY and SECRET.
2016-08-24CLOUD: Simplify OneDriveTokenRefresherAlexander Tkachev
It now just extends CurlJsonRequest, not wraps one.
2016-08-24CLOUD: Fix OneDriveTokenRefresherAlexander Tkachev
Failed to update token in header when "Bearer" was used instead of "bearer".
2016-08-24CLOUD: Add access to CurlRequest's StreamAlexander Tkachev
One can access CurlRequest's NetworkReadStream in order to find out HTTP response code or some other Stream-related data. OneDriveTokenRefresher uses it to print some info on that 404 error I'm trying to troubleshoot.
2016-08-24CLOUD: Refactor ConnectionManager/Requests systemAlexander Tkachev
ConnectionManager now storages Request * (not generates ids for it), Requests have control on their RequestState, RequestIdPair is now called Response and storages Request * with some response together. All related classes are changed to use it in more clean and understandable way. Request, RequestState and Response are carefully commented/documented.
2016-08-24CLOUD: Make OneDriveStorage::download() work fineAlexander Tkachev
Well, it takes two API calls instead of one now, but there are no problems with expired token because of it. This commit changes Storage::streamFile() to pass NetworkReadStream * through callback.
2016-08-24CLOUD: Add OneDriveStorage::download()Alexander Tkachev
Doesn't work when token is invalid, though.
2016-08-24CLOUD: Add OneDriveTokenRefresherAlexander Tkachev
OneDriveTokenRefresher is a CurlJsonRequest replacement for OneDriveStorage methods. It behaves very similarly, but checks received JSON before passing it to user. If it contains "error" key, it attempts to refresh the token through OneDriveStorage, and then restarts the original request, so user won't notice that there ever was an error.
2016-08-24CLOUD: Fix CurlJsonRequest to use JsonCallbackAlexander Tkachev
Type safety first.
2016-08-24CLOUD: Add RequestIdPair structAlexander Tkachev
Can be used with Callback<T> (means it's still type safe). It's used to pass not only Request id to user's callback, but also a value user wanted. void *data field is removed from RequestInfo.
2016-08-24CLOUD: Add Requests idAlexander Tkachev
(Upgrading ConnectionManager step by step.)
2016-08-24CLOUD: Add OneDrive refresh_token supportAlexander Tkachev
It might be not that easy to restart the request after new token received, though.
2016-08-24CLOUD: Add OneDrive Storage stubAlexander Tkachev
Knows how to OAuth already. This commit also adds CloudManager::addStorage(), so OneDriveStorage can add newly created Storage and CloudManager can save it in the configuration file.