Cloud storage: show progress bar when using Save with cloud storage open

When you have openend cloud storage, the Save and Save to cloud storage
are basically the same thing... so we need to show the progress bar in
that case, too.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-09-28 13:05:20 -04:00
parent 332cc0a418
commit dc7f6bcfc9

View file

@ -1469,10 +1469,13 @@ int MainWindow::file_save_as(void)
int MainWindow::file_save(void)
{
const char *current_default;
bool is_cloud = false;
if (!existing_filename)
return file_save_as();
is_cloud = (strncmp(existing_filename, "http", 4) == 0);
if (information()->isEditing())
information()->acceptChanges();
@ -1484,10 +1487,16 @@ int MainWindow::file_save(void)
if (!current_def_dir.exists())
current_def_dir.mkpath(current_def_dir.absolutePath());
}
if (is_cloud)
showProgressBar();
if (save_dives(existing_filename)) {
getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error);
if (is_cloud)
hideProgressBar();
return -1;
}
if (is_cloud)
hideProgressBar();
getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error);
mark_divelist_changed(false);
addRecentFile(QStringList() << QString(existing_filename));