summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <[email protected]>2018-12-09 18:52:26 +0100
committerDavid Faure <[email protected]>2018-12-09 18:52:26 +0100
commit22105f451647cb62dfc6eeb1a5f4a5efc0ffd723 (patch)
tree2200080eb23f16157b18c1b55aa15675183b90f0
parent8910f893563fcd379aa720ea9c6c8ec7cccf3f43 (diff)
Fix compilation with -DQT_NO_URL_CAST_FROM_STRING and enable it.v18.12.1
-rw-r--r--CMakeLists.txt1
-rw-r--r--src/kamoso.cpp8
2 files changed, 5 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 67b4c56..f8f487d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,6 +36,7 @@ include(KDECMakeSettings)
include(ECMInstallIcons)
include(ECMAddTests)
include(FeatureSummary)
+add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_subdirectory(src)
add_subdirectory(icons)
diff --git a/src/kamoso.cpp b/src/kamoso.cpp
index 82cb4c9..22b4df6 100644
--- a/src/kamoso.cpp
+++ b/src/kamoso.cpp
@@ -70,13 +70,13 @@ QUrl Kamoso::fileNameSuggestion(const QUrl &saveUrl, const QString &name, const
const QString date = QDateTime::currentDateTime().toString(QStringLiteral("yyyy-MM-dd_hh-mm-ss"));
const QString initialName = QStringLiteral("%1_%2.%3").arg(name, date, extension);
- QUrl path(saveUrl.toString() + '/' + initialName);
+ QUrl url(saveUrl.toString() + '/' + initialName);
- if (path.isLocalFile() && QFile::exists(path.toLocalFile())) {
- path = saveUrl.toString() + '/' + KIO::suggestName(saveUrl, initialName);
+ if (url.isLocalFile() && QFile::exists(url.toLocalFile())) {
+ url.setPath(saveUrl.path() + '/' + KIO::suggestName(saveUrl, initialName));
}
- return path;
+ return url;
}
const QString Kamoso::takePhoto()