diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp
index 350e5c3084..8d0c2e8816 100644
--- a/src/gui/folderstatusmodel.cpp
+++ b/src/gui/folderstatusmodel.cpp
@@ -158,6 +158,8 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const
case Qt::DecorationRole:
if (_accountState->account()->e2e()->isFolderEncrypted(x._path)) {
return QIcon(QLatin1String(":/client/theme/lock-https.svg"));
+ } else if (x._size > 0 && _accountState->account()->e2e()->isAnyParentFolderEncrypted(x._path)) {
+ return QIcon(QLatin1String(":/client/theme/lock-broken.svg"));
}
return QFileIconProvider().icon(x._isExternal ? QFileIconProvider::Network : QFileIconProvider::Folder);
case Qt::ForegroundRole:
diff --git a/src/libsync/clientsideencryption.cpp b/src/libsync/clientsideencryption.cpp
index 83f6cbb03c..6401a22695 100644
--- a/src/libsync/clientsideencryption.cpp
+++ b/src/libsync/clientsideencryption.cpp
@@ -1482,6 +1482,22 @@ bool ClientSideEncryption::isFolderEncrypted(const QString& path) const {
return (*it);
}
+bool ClientSideEncryption::isAnyParentFolderEncrypted(const QString &path) const
+{
+ int slashPosition = 0;
+
+ while ((slashPosition = path.indexOf("/", slashPosition + 1)) != -1) {
+ // Ignore the last slash
+ if (slashPosition == path.length() - 1) break;
+
+ if (isFolderEncrypted(path.left(slashPosition + 1))) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
bool EncryptionHelper::fileEncryption(const QByteArray &key, const QByteArray &iv, QFile *input, QFile *output, QByteArray& returnTag)
{
if (!input->open(QIODevice::ReadOnly)) {
diff --git a/src/libsync/clientsideencryption.h b/src/libsync/clientsideencryption.h
index 05425a26f0..0c92ffa1c2 100644
--- a/src/libsync/clientsideencryption.h
+++ b/src/libsync/clientsideencryption.h
@@ -83,6 +83,7 @@ public:
// to be used together with FolderStatusModel::FolderInfo::_path.
bool isFolderEncrypted(const QString& path) const;
+ bool isAnyParentFolderEncrypted(const QString &path) const;
void setFolderEncryptedStatus(const QString& path, bool status);
void forgetSensitiveData();
diff --git a/theme.qrc b/theme.qrc
index 8ec17e8b34..6adcfdc460 100644
--- a/theme.qrc
+++ b/theme.qrc
@@ -153,6 +153,7 @@
theme/change.svg
theme/lock-http.svg
theme/lock-https.svg
+ theme/lock-broken.svg
theme/network.svg
theme/account.svg
theme/colored/add.svg
diff --git a/theme/lock-broken.svg b/theme/lock-broken.svg
new file mode 100644
index 0000000000..c6cfce6060
--- /dev/null
+++ b/theme/lock-broken.svg
@@ -0,0 +1 @@
+