Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
CloudManager::getStorageConfigName()
|
|
KEY and SECRET should now load before getAccessToken() uses them, so it
should work now.
|
|
|
|
"savessyncrequest.h:35:35: error: use of undeclared identifier 'UINT_MAX'"
|
|
One can enter the code, press 'Connect' button and get a working
Storage!
|
|
Used in SavesSyncRequest to update Storage's last sync date.
|
|
Tried to use it everywhere I should've use it.
|
|
Instead of all these atoull() I've added everywhere.
|
|
Commit changes CloudManager and Storages so they would automatically
refresh the fields when the could.
|
|
It now has methods to update Storage's information.
|
|
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.
|
|
And corresponding stub implementations in CloudManager.
|
|
* Storage::name();
* CloudManager::getStorageName();
* CloudManager::getStorageIndex();
* CloudManager::listStorages();
* CloudManager::switchStorage().
|
|
Just checked that out on cloud sync: Google Drive is officially
supported!
|
|
Includes NetworkReadStream PATCH method and Headers remembering feature.
|
|
GoogleDriveDownloadRequest, which resolves file id and then downloads it
with GoogleDriveStorage::downloadById().
GoogleDriveStreamFileRequest, which resolves file id and then returns
file stream with GoogleDriveStorage::streamFileById().
This commit also adds GoogleDriveStorage::streamFileById() itself.
A minor GoogleDriveResolveIdRequest fix added.
With these one can download files from Google Drive.
|
|
Id should be used everywhere.
|
|
Only two places to update, as others still require id resolving.
|
|
Because of the Google Drive StorageFile now contains yet another field,
`id`. For other storages `id` == `path`, and thus all common Requests
(such as SavesSyncRequest, DownloadFolderRequest, etc) must be using
id() instead of path(). That way these Requests won't cause id resolving
which could be quite slow (when you call it for all files in the folder,
for example).
|
|
Now it also creates the "base" ScummVM directory if there is no such
directory yet. This way SavesSyncRequest works fine when no "ScummVM" or
"ScummVM/Saves" folder exist in the Google Drive.
|
|
|
|
Now it needs another scope and uses "root" instead of "appDataFolder".
|
|
When listing directories, you get a list of StorageFiles, which path()
is actually Google Drive id. Thus, if you list a directory recursively,
you won't be able to determine whether all files are within one
directory or have some hierarchy. I'd fix that as soon as it would be
needed.
|
|
Now we can create directories in Google Drive by path, not parent id +
directory name!
|
|
GoogleDriveResolveIdRequest gets a lowercase path and searches for the
specified file's id. To do that it lists path's subdirectories one by
one with GoogleDriveListDirectoryByIdRequest.
GoogleDriveListDirectoryByIdRequest gets a Google Drive id and lists
that directory (not recursively).
|
|
|
|
It's common for Save/Load dialogs and SavesSyncRequest.
|
|
MetaEngines don't get "locked" files in the list, so won't try to open
these.
Save/Load dialog updates save list every time SavesSyncRequest tells it
to.
|
|
|
|
It's shown by SaveLoadChooserDialog when files are downloaded and some
save slots are locked. One can hide that dialog to interact with
non-locked slots or cancel saves sync completely. Dialog's label shows
current sync progress.
Dialog automatically hides itself when all files are downloaded.
WARNING: right now that results in a crash!
|
|
It also shows a "sync disabled" icon in case it has a savepath override.
|
|
So other classes could use that information without casting.
|
|
CloudIcon can easily use CloudMan.isWorking()
|
|
Files we need are files to be downloaded, because that's what blocks us
from reading/writing in those.
|
|
Now one can learn whether SavesSyncRequest is running, its progress and
which files are being synced.
|
|
Now it would finish with error if spawned Request is nullptr.
|
|
It has its own GoogleDriveTokenRefresher and knows how to do info().
This commit also contains JSON int -> long long int fix and
CurlJsonRequest '\n' -> ' ' fix.
|
|
|
|
It's needed to ::destroy() it in main().
|
|
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.
|
|
touch() and isSyncing() are not needed.
remove() is not needed too, but it could be used in the future.
|
|
|
|
|
|
Also add CloudManager::testFeature(), because syncSaves() now works fine
and I don't want to break it again and again with my testing requests.
|
|
DownloadRequest and FolderDownloadRequest are using other Storage's
methods. Thus, download() and downloadFolder() could be implemented in
base Storage class.
|
|
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).
|