aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud
diff options
context:
space:
mode:
authorAlexander Tkachev2016-05-25 16:32:22 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commitae8e7f39f5b3e4f647a29d39d19cce7626528bb1 (patch)
treebf1031fbf6bedd96056b8a427f2bf647499b44e6 /backends/cloud
parentd014b5bf3826d78de269891ccf6722e58d7a5bcd (diff)
downloadscummvm-rg350-ae8e7f39f5b3e4f647a29d39d19cce7626528bb1.tar.gz
scummvm-rg350-ae8e7f39f5b3e4f647a29d39d19cce7626528bb1.tar.bz2
scummvm-rg350-ae8e7f39f5b3e4f647a29d39d19cce7626528bb1.zip
CLOUD: Make download() create necessary directories
DumpFile::open() with createPath=true create would create the missing directories from the path before opening a file. Thus, one can easily create a file and avoid "can't open a file" error.
Diffstat (limited to 'backends/cloud')
-rw-r--r--backends/cloud/dropbox/dropboxstorage.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/backends/cloud/dropbox/dropboxstorage.cpp b/backends/cloud/dropbox/dropboxstorage.cpp
index 38ad12d94b..e5041466e9 100644
--- a/backends/cloud/dropbox/dropboxstorage.cpp
+++ b/backends/cloud/dropbox/dropboxstorage.cpp
@@ -103,7 +103,7 @@ Networking::NetworkReadStream *DropboxStorage::streamFile(Common::String path) {
void DropboxStorage::download(Common::String remotePath, Common::String localPath, BoolCallback callback) {
Common::DumpFile *f = new Common::DumpFile();
- if (!f->open(localPath)) {
+ if (!f->open(localPath, true)) {
warning("DropboxStorage: unable to open file to download into");
if (callback) (*callback)(false);
delete f;
@@ -116,8 +116,8 @@ void DropboxStorage::download(Common::String remotePath, Common::String localPat
void DropboxStorage::syncSaves(BoolCallback callback) {
//this is not the real syncSaves() implementation
//"" is root in Dropbox, not "/"
- //listDirectory("", new Common::Callback<DropboxStorage, Common::Array<StorageFile> >(this, &DropboxStorage::printFiles), true);
- download("/remote/test.jpg", "local/test.jpg", 0);
+ //this must create all these directories:
+ download("/remote/test.jpg", "local/a/b/c/d/test.jpg", 0);
}
void DropboxStorage::info(StorageInfoCallback outerCallback) {