From aa5d3055be1c339fdd5c8acdfbbe795f529d0fa3 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 15 Sep 2016 14:56:37 +0200 Subject: [PATCH] Folder/Watcher: Fix up #5174 #5153 (#5186) 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 b1112e13ab..87f600bc14 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('/'); }