From c69cd514b8586207df1cb1d38f5f93c0d7efbc3d Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 15 Sep 2016 12:39:37 +0200 Subject: [PATCH] Folder/Watcher: Fix up #5174 #5153 It was surprising to have a broken symlink return empty for canonical path. --- src/gui/folder.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index b1112e13a..87f600bc1 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -123,9 +123,11 @@ Folder::~Folder() void Folder::checkLocalPath() { const QFileInfo fi(_definition.localPath); - _canonicalLocalPath = fi.canonicalFilePath(); - if( !_canonicalLocalPath.endsWith('/') ) { + if (_canonicalLocalPath.isEmpty()) { + qDebug() << "Broken symlink:" << _definition.localPath; + _canonicalLocalPath = _definition.localPath; + } else if( !_canonicalLocalPath.endsWith('/') ) { _canonicalLocalPath.append('/'); }