From 8f4e649c68436a0899aebbd11b5cfc9d86d1f8c6 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 17 Jul 2016 12:27:01 +0900 Subject: If cloud storage is offline, show that in title bar Not sure if "local cache" is the best text, but it's accurate. Signed-off-by: Dirk Hohndel --- desktop-widgets/mainwindow.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index d4c2317f1..22c57e2fc 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -1679,12 +1679,18 @@ QString MainWindow::displayedFilename(QString fullFilename) QFileInfo fileInfo(f); QString fileName(fileInfo.fileName()); - if (fullFilename.contains(prefs.cloud_git_url)) - return tr("[cloud storage for] %1").arg(fileName.left(fileName.indexOf('['))); - else + if (fullFilename.contains(prefs.cloud_git_url)) { + QString email = fileName.left(fileName.indexOf('[')); + if (prefs.git_local_only) + return tr("[local cache for] %1").arg(email); + else + return tr("[cloud storage for] %1").arg(email); + } else { return fileName; + } } + void MainWindow::setAutomaticTitle() { setTitle(); -- cgit v1.2.3-70-g09d2