Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Fella <nicolas.fella@gmx.de>2020-03-21 17:35:50 +0300
committerNicolas Fella <nicolas.fella@gmx.de>2020-03-21 17:38:27 +0300
commit20b7e938c504a34e074bb1653204550ec2dbd784 (patch)
tree5af587292ef36a9b91be38aa5d92cca7d80233ef /shell_integration
parent3ca586c464af9acd9506ad39232fd75251ee1636 (diff)
[dolphin] Fix overlays when filename has a colon
When the filename contains a ':' it gets split too much and tokens[2] does not contain the full filename any more. Read the name from the original line instead. Fixes #686 Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
Diffstat (limited to 'shell_integration')
-rw-r--r--shell_integration/dolphin/ownclouddolphinoverlayplugin.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/shell_integration/dolphin/ownclouddolphinoverlayplugin.cpp b/shell_integration/dolphin/ownclouddolphinoverlayplugin.cpp
index 56300f4df..d89aa9174 100644
--- a/shell_integration/dolphin/ownclouddolphinoverlayplugin.cpp
+++ b/shell_integration/dolphin/ownclouddolphinoverlayplugin.cpp
@@ -83,14 +83,16 @@ private:
void slotCommandRecieved(const QByteArray &line) {
QList<QByteArray> tokens = line.split(':');
- if (tokens.count() != 3)
+ if (tokens.count() < 3)
return;
if (tokens[0] != "STATUS" && tokens[0] != "BROADCAST")
return;
if (tokens[2].isEmpty())
return;
- const QByteArray name = tokens[2];
+ // We can't use tokens[2] because the filename might contain ':'
+ int secondColon = line.indexOf(":", line.indexOf(":") + 1);
+ const QByteArray name = line.mid(secondColon + 1);
QByteArray &status = m_status[name]; // reference to the item in the hash
if (status == tokens[1])
return;