Commit 5b8e2d0f authored by Andreas Cord-Landwehr's avatar Andreas Cord-Landwehr

Avoid accidential QString to QUrl casts.

parent e2192ff1
......@@ -61,6 +61,10 @@ find_package(KF5 REQUIRED COMPONENTS
XmlGui
)
add_definitions(
-DQT_NO_URL_CAST_FROM_STRING
)
# subdirectories to build
ecm_optional_add_subdirectory(data)
ecm_optional_add_subdirectory(schemes)
......
......@@ -157,11 +157,11 @@ int ProfileManager::profileCount() const
void ProfileManager::openImageFileDialog()
{
QUrl imageUrl = QFileDialog::getOpenFileName(0,
QString imageUrl = QFileDialog::getOpenFileName(0,
i18n("Open Image"),
"",
i18n("Image Files (*.png *.jpg *.bmp)"));
d->m_activeProfile->importImage(imageUrl.toLocalFile());
d->m_activeProfile->importImage(imageUrl);
}
Learner * ProfileManager::addProfile(const QString &name)
......
......@@ -258,7 +258,7 @@ void MainWindow::downloadNewStuff()
if (!path.endsWith(QLatin1String(".xml"))) {
continue;
}
CourseResource *resource = new CourseResource(m_resourceManager, path);
CourseResource *resource = new CourseResource(m_resourceManager, QUrl::fromLocalFile(path));
foreach (LearningGoal *goal, m_profileManager->goals()) {
if (goal->category() == LearningGoal::Language
&& goal->identifier() == resource->language()
......
......@@ -45,7 +45,7 @@ ResourcesDialogPage::~ResourcesDialogPage()
void ResourcesDialogPage::loadSettings()
{
// setup Ui with stored settings
ui->kcfg_CourseRepositoryPath->setUrl(QUrl::fromLocalFile(Settings::courseRepositoryPath()).toLocalFile());
ui->kcfg_CourseRepositoryPath->setUrl(QUrl(Settings::courseRepositoryPath()));
ui->kcfg_UseCourseRepository->setChecked(Settings::useCourseRepository());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment