summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-10 06:30:01 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-10 16:26:49 -0700
commitae653703a5d3ff1da84053d4542420fc70325c5f (patch)
tree3c93c581dc3d7a2209b7dc021d14515c34b75c04 /desktop-widgets/mainwindow.cpp
parent6e4a2538968d945d471489270136c4891b47b270 (diff)
downloadsubsurface-ae653703a5d3ff1da84053d4542420fc70325c5f.tar.gz
prefs: git_local_only is not a preference
It's the current state of the app, so it should be a global variable, not a preference. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r--desktop-widgets/mainwindow.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 0623af50b..9547afacf 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -660,7 +660,7 @@ void MainWindow::on_actionCloudstoragesave_triggered()
void MainWindow::on_actionCloudOnline_triggered()
{
bool isOffline = !ui.actionCloudOnline->isChecked();
- if (isOffline == prefs.git_local_only)
+ if (isOffline == git_local_only)
return;
// Refuse to go online if there is an edit in progress
@@ -673,7 +673,7 @@ void MainWindow::on_actionCloudOnline_triggered()
return;
}
- prefs.git_local_only = isOffline;
+ git_local_only = isOffline;
if (!isOffline) {
// User requests to go online. Try to sync cloud storage
if (unsaved_changes()) {
@@ -689,7 +689,7 @@ void MainWindow::on_actionCloudOnline_triggered()
// If there are no unsaved changes, let's just try to load the remote cloud
on_actionCloudstorageopen_triggered();
}
- if (prefs.git_local_only)
+ if (git_local_only)
report_error(qPrintable(tr("Failure taking cloud storage online")));
}
@@ -747,7 +747,7 @@ void MainWindow::updateCloudOnlineStatus()
bool is_cloud = existing_filename && prefs.cloud_git_url && prefs.cloud_verification_status == qPref::CS_VERIFIED &&
strstr(existing_filename, prefs.cloud_git_url);
ui.actionCloudOnline->setEnabled(is_cloud);
- ui.actionCloudOnline->setChecked(is_cloud && !prefs.git_local_only);
+ ui.actionCloudOnline->setChecked(is_cloud && !git_local_only);
}
void MainWindow::setCurrentFile(const char *f)
@@ -1729,7 +1729,7 @@ QString MainWindow::displayedFilename(QString fullFilename)
if (fullFilename.contains(prefs.cloud_git_url)) {
QString email = fileName.left(fileName.indexOf('['));
- if (prefs.git_local_only)
+ if (git_local_only)
return tr("[local cache for] %1").arg(email);
else
return tr("[cloud storage for] %1").arg(email);