diff options
author | Eugene Sandulenko | 2016-07-22 15:48:46 +0300 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 53aa0c46f1a5d6aefe3f2a087c60d9a59439aedf (patch) | |
tree | bd50f6a35c34737537887ba4a067bf846706466e /gui/downloaddialog.cpp | |
parent | eb268cd14ff936b5afa2c39ca51acfaea51a8a90 (diff) | |
download | scummvm-rg350-53aa0c46f1a5d6aefe3f2a087c60d9a59439aedf.tar.gz scummvm-rg350-53aa0c46f1a5d6aefe3f2a087c60d9a59439aedf.tar.bz2 scummvm-rg350-53aa0c46f1a5d6aefe3f2a087c60d9a59439aedf.zip |
GUI: JANITORIAL: Fix code formatting
Diffstat (limited to 'gui/downloaddialog.cpp')
-rw-r--r-- | gui/downloaddialog.cpp | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/gui/downloaddialog.cpp b/gui/downloaddialog.cpp index 495e9c13f0..ea7ace2f2a 100644 --- a/gui/downloaddialog.cpp +++ b/gui/downloaddialog.cpp @@ -92,12 +92,12 @@ void DownloadDialog::close() { void DownloadDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { switch (cmd) { case kDownloadDialogButtonCmd: - { - CloudMan.setDownloadTarget(nullptr); - CloudMan.cancelDownload(); - close(); - break; - } + { + CloudMan.setDownloadTarget(nullptr); + CloudMan.cancelDownload(); + close(); + break; + } case kDownloadProgressCmd: if (!_close) { refreshWidgets(); @@ -116,16 +116,19 @@ bool DownloadDialog::selectDirectories() { if (Networking::Connection::isLimited()) { MessageDialog alert(_("It looks like your connection is limited. " "Do you really want to download files with it?"), _("Yes"), _("No")); - if (alert.runModal() != GUI::kMessageOK) return false; + if (alert.runModal() != GUI::kMessageOK) + return false; } //first user should select remote directory to download - if (_remoteBrowser->runModal() <= 0) return false; + if (_remoteBrowser->runModal() <= 0) + return false; Cloud::StorageFile remoteDirectory = _remoteBrowser->getResult(); //now user should select local directory to download into - if (_browser->runModal() <= 0) return false; + if (_browser->runModal() <= 0) + return false; Common::FSNode dir(_browser->getResult()); Common::FSList files; @@ -149,7 +152,8 @@ bool DownloadDialog::selectDirectories() { _("Yes"), _("No") ); - if (alert.runModal() != GUI::kMessageOK) return false; + if (alert.runModal() != GUI::kMessageOK) + return false; break; } } @@ -161,12 +165,18 @@ bool DownloadDialog::selectDirectories() { if (localPath.size() && localPath.lastChar() != '/' && localPath.lastChar() != '\\') { int backslashes = 0; for (uint32 i = 0; i < localPath.size(); ++i) - if (localPath[i] == '/') --backslashes; - else if (localPath[i] == '\\') ++backslashes; - - if (backslashes > 0) localPath += '\\' + remoteDirectory.name(); - else localPath += '/' + remoteDirectory.name(); - } else localPath += remoteDirectory.name(); + if (localPath[i] == '/') + --backslashes; + else if (localPath[i] == '\\') + ++backslashes; + + if (backslashes > 0) + localPath += '\\' + remoteDirectory.name(); + else + localPath += '/' + remoteDirectory.name(); + } else { + localPath += remoteDirectory.name(); + } CloudMan.startDownload(remoteDirectory.path(), localPath); CloudMan.setDownloadTarget(this); |