aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/mainwindow.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 197c54bdd..9a2b9665d 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -628,8 +628,8 @@ void MainWindow::closeCurrentFile()
void MainWindow::updateCloudOnlineStatus()
{
- bool is_cloud = existing_filename && prefs.cloud_git_url && prefs.cloud_verification_status == qPrefCloudStorage::CS_VERIFIED &&
- strstr(existing_filename, prefs.cloud_git_url);
+ bool is_cloud = existing_filename && prefs.cloud_verification_status == qPrefCloudStorage::CS_VERIFIED &&
+ strstr(existing_filename, prefs.cloud_base_url);
ui.actionCloudOnline->setEnabled(is_cloud);
ui.actionCloudOnline->setChecked(is_cloud && !git_local_only);
}
@@ -1174,7 +1174,7 @@ void MainWindow::loadRecentFiles()
QString file = s.value(key).toString();
// never add our cloud URL to the recent files
- if (!same_string(prefs.cloud_git_url, "") && file.startsWith(prefs.cloud_git_url))
+ if (file.startsWith(prefs.cloud_base_url))
continue;
// but allow local git repos
QRegularExpression gitrepo("(.*)\\[[^]]+]");
@@ -1212,7 +1212,7 @@ void MainWindow::updateRecentFilesMenu()
void MainWindow::addRecentFile(const QString &file, bool update)
{
// never add Subsurface cloud file to the recent files - it has its own menu entry
- if (!same_string(prefs.cloud_git_url, "") && file.startsWith(prefs.cloud_git_url))
+ if (file.startsWith(prefs.cloud_base_url))
return;
QString localFile = QDir::toNativeSeparators(file);
int index = recentFiles.indexOf(localFile);
@@ -1262,9 +1262,8 @@ int MainWindow::file_save_as(void)
// if the default is to save to cloud storage, pick something that will work as local file:
// simply extract the branch name which should be the users email address
- if (default_filename && strstr(default_filename, prefs.cloud_git_url)) {
+ if (default_filename && strstr(default_filename, prefs.cloud_base_url)) {
QString filename(default_filename);
- filename.remove(prefs.cloud_git_url);
filename.remove(0, filename.indexOf("[") + 1);
filename.replace("]", ".ssrf");
default_filename = copy_qstring(filename);
@@ -1355,7 +1354,7 @@ QString MainWindow::displayedFilename(QString fullFilename)
QFileInfo fileInfo(f);
QString fileName(fileInfo.fileName());
- if (fullFilename.contains(prefs.cloud_git_url)) {
+ if (fullFilename.contains(prefs.cloud_base_url)) {
QString email = fileName.left(fileName.indexOf('['));
return git_local_only ?
tr("[local cache for] %1").arg(email) :