[kdeconnect-kde] /: Make sure we're not automatically casting QString directly into QUrl

Aleix Pol aleixpol at kde.org
Wed Apr 1 21:41:10 UTC 2015


Git commit 90f5a221fb3ab9bd9001381adf7bcf8073ba9f5d by Aleix Pol.
Committed on 01/04/2015 at 21:40.
Pushed by apol into branch 'master'.

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 at kde.org

M  +2    -0    CMakeLists.txt
M  +2    -2    plugins/share/share_config.cpp

http://commits.kde.org/kdeconnect-kde/90f5a221fb3ab9bd9001381adf7bcf8073ba9f5d

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 516f517..dbaa039 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 c418534..818748b 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);
 }


More information about the KDEConnect mailing list