From 20b7e938c504a34e074bb1653204550ec2dbd784 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sat, 21 Mar 2020 15:35:50 +0100 Subject: [PATCH] [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 --- shell_integration/dolphin/ownclouddolphinoverlayplugin.cpp | 6 ++++-- 1 file 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 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; -- 2.30.2