From 95c04b7ee437e89ca7d2e6aa409b43d314ae2106 Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Thu, 4 Feb 2016 10:19:49 +0100 Subject: [PATCH] explicitly construct QUrl for new (local) skipList entries getExistingDirectory returns a string, which we implicitly constructed a QUrl from without using fromLocalFile() resulting in a QUrl that is isValid && !isEmpty, but when converted toLocalFile() it will be "" as it is !isLocal. To resolve this problem simply construct a QUrl::fromLocalFile explicitly to make sure that the resulting url is valid, !empty and local. Otherwise this will attempt to insert empty strings as paths, rendering the feature defunct. REVIEW: 126985 --- src/part/settingsDialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/part/settingsDialog.cpp b/src/part/settingsDialog.cpp index bddd0c3..6ee180c 100644 --- a/src/part/settingsDialog.cpp +++ b/src/part/settingsDialog.cpp @@ -169,7 +169,8 @@ void SettingsDialog::toggleDontScanRemovableMedia(bool b) void SettingsDialog::addFolder() { - const QUrl url = QFileDialog::getExistingDirectory(this, i18n("Select path to ignore"), QDir::rootPath()); + const QString urlString = QFileDialog::getExistingDirectory(this, i18n("Select path to ignore"), QDir::rootPath()); + const QUrl url = QUrl::fromLocalFile(urlString); //TODO error handling! //TODO wrong protocol handling!