From 90f5a221fb3ab9bd9001381adf7bcf8073ba9f5d Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Wed, 1 Apr 2015 23:40:29 +0200 Subject: [PATCH] Make sure we're not automatically casting QString directly into QUrl Otherwise we often turn paths into URLs, a fix I pushed previously today and the ones I detected when adding -DQT_NO_URL_CAST_FROM_STRING. CCMAIL: kdeconnect@kde.org --- CMakeLists.txt | 2 ++ plugins/share/share_config.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 516f5179b..dbaa03953 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,8 @@ include(FeatureSummary) include(KDEConnectMacros.cmake) +add_definitions(-DQT_NO_URL_CAST_FROM_STRING) + include(GenerateExportHeader) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/plugins/share/share_config.cpp b/plugins/share/share_config.cpp index c41853420..818748b69 100644 --- a/plugins/share/share_config.cpp +++ b/plugins/share/share_config.cpp @@ -46,7 +46,7 @@ void ShareConfig::defaults() { KCModule::defaults(); - m_ui->kurlrequester->setUrl(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)); + m_ui->kurlrequester->setUrl(QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation))); Q_EMIT changed(true); } @@ -55,7 +55,7 @@ void ShareConfig::load() { KCModule::load(); - m_ui->kurlrequester->setUrl(config()->get("incoming_path", QStandardPaths::writableLocation(QStandardPaths::DownloadLocation))); + m_ui->kurlrequester->setUrl(config()->get("incoming_path", QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)))); Q_EMIT changed(false); }