summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWeng Xuetian <wengxt@gmail.com>2016-10-17 03:18:29 (GMT)
committerWeng Xuetian <wengxt@gmail.com>2016-10-17 03:18:29 (GMT)
commited8c2ae2c0f16bf76fea1e0f4eac5121707d52d4 (patch)
tree1afb60f9f8f51ed615ae5f425821d7074471c39a
parentad922e0bf985a30e8ef91bf7a6906955fc44795e (diff)
Fix KF5 port.
Summary: check of HAVE_CDDA_IOCTL_DEVICE is wrongly removed during port, restore it and replace usages of deprecated cmake macro with new one. Also QUrl::query() and KUrl::query() behaves differently, while QUrl::query() will not return '?' in return value. Test Plan: Test with a real CD localily. Reviewers: whiting, lesliezhai Reviewed By: lesliezhai Differential Revision: https://phabricator.kde.org/D3063
-rw-r--r--CMakeLists.txt12
-rw-r--r--audiocd.cpp4
2 files changed, 13 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5348e7d..5c59a75 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,6 +32,8 @@ include(KDECompilerSettings)
include(KDECMakeSettings)
include(GenerateExportHeader)
include(ECMSetupVersion)
+include(CMakePushCheckState)
+include(CheckStructHasMember)
ecm_setup_version(${PROJECT_VERSION}
VARIABLE_PREFIX AUDIOCDPLUGINS
@@ -42,6 +44,16 @@ ecm_setup_version(${PROJECT_VERSION}
find_package(Cdparanoia REQUIRED)
+cmake_push_check_state()
+set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${CDPARANOIA_INCLUDE_DIR})
+check_struct_has_member("struct cdrom_drive" "ioctl_device_name" "cdda_interface.h" CDDA_IOCTL_DEVICE_EXISTS)
+cmake_pop_check_state()
+if(CDDA_IOCTL_DEVICE_EXISTS)
+ set(HAVE_CDDA_IOCTL_DEVICE 1)
+else()
+ set(HAVE_CDDA_IOCTL_DEVICE 0)
+endif()
+
configure_file(config-audiocd.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-audiocd.h)
#############################
diff --git a/audiocd.cpp b/audiocd.cpp
index 4e8cad8..a20e79f 100644
--- a/audiocd.cpp
+++ b/audiocd.cpp
@@ -1006,11 +1006,9 @@ void AudioCDProtocol::parseURLArgs(const QUrl & url)
QString query(QUrl::fromPercentEncoding(url.query().toAscii()));
- if (query.isEmpty() || query[0] != QLatin1Char( '?' ))
+ if (query.isEmpty())
return;
- query = query.mid(1); // Strip leading '?'.
-
const QStringList tokens(query.split(QLatin1Char( '&' ),QString::SkipEmptyParts));
for (QStringList::ConstIterator it(tokens.constBegin()); it != tokens.constEnd(); ++it)