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
This commit is contained in:
Aleix Pol 2015-04-01 23:40:29 +02:00
parent 9ab7e2356e
commit 90f5a221fb
2 changed files with 4 additions and 2 deletions

View file

@ -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})

View file

@ -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);
}