summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoudhayan Gupta <me@BaloneyGeek.com>2015-09-05 08:50:37 (GMT)
committerBoudhayan Gupta <me@BaloneyGeek.com>2015-09-05 08:50:37 (GMT)
commit4a465e259a62ebd6b1c4993e5821968777aeda6d (patch)
tree6e1bcb0bb036b768844756b56d28feb74a4e703a
parent494ac110a52a64aa7b7913fc75bdfc71b27cdad4 (diff)
ECM-ise CMake. WMLib backend disabled
-rw-r--r--CMakeLists.txt147
-rw-r--r--KF5CompactDiscConfig.cmake.in10
-rw-r--r--LibkcompactdiscConfig.cmake.in13
-rw-r--r--src/CMakeLists.txt104
-rw-r--r--src/kcompactdisc.cpp (renamed from kcompactdisc.cpp)16
-rw-r--r--src/kcompactdisc.h (renamed from kcompactdisc.h)0
-rw-r--r--src/kcompactdisc_p.cpp (renamed from kcompactdisc_p.cpp)16
-rw-r--r--src/kcompactdisc_p.h (renamed from kcompactdisc_p.h)7
-rw-r--r--src/phonon_interface.cpp (renamed from phonon_interface.cpp)15
-rw-r--r--src/phonon_interface.h (renamed from phonon_interface.h)0
-rw-r--r--src/wmlib/README (renamed from wmlib/README)0
-rw-r--r--src/wmlib/audio/audio.c (renamed from wmlib/audio/audio.c)0
-rw-r--r--src/wmlib/audio/audio.h (renamed from wmlib/audio/audio.h)0
-rw-r--r--src/wmlib/audio/audio_alsa.c (renamed from wmlib/audio/audio_alsa.c)0
-rw-r--r--src/wmlib/audio/audio_arts.c (renamed from wmlib/audio/audio_arts.c)0
-rw-r--r--src/wmlib/audio/audio_phonon.cpp (renamed from wmlib/audio/audio_phonon.cpp)0
-rw-r--r--src/wmlib/audio/audio_phonon.h (renamed from wmlib/audio/audio_phonon.h)0
-rw-r--r--src/wmlib/audio/audio_sun.c (renamed from wmlib/audio/audio_sun.c)0
-rw-r--r--src/wmlib/cdda.c (renamed from wmlib/cdda.c)0
-rw-r--r--src/wmlib/cddb.c (renamed from wmlib/cddb.c)0
-rw-r--r--src/wmlib/cdrom.c (renamed from wmlib/cdrom.c)0
-rw-r--r--src/wmlib/cdtext.c (renamed from wmlib/cdtext.c)0
-rw-r--r--src/wmlib/drv_sony.c (renamed from wmlib/drv_sony.c)0
-rw-r--r--src/wmlib/drv_toshiba.c (renamed from wmlib/drv_toshiba.c)0
-rw-r--r--src/wmlib/include/wm_cdda.h (renamed from wmlib/include/wm_cdda.h)0
-rw-r--r--src/wmlib/include/wm_cddb.h (renamed from wmlib/include/wm_cddb.h)0
-rw-r--r--src/wmlib/include/wm_cdinfo.h (renamed from wmlib/include/wm_cdinfo.h)0
-rw-r--r--src/wmlib/include/wm_cdrom.h (renamed from wmlib/include/wm_cdrom.h)0
-rw-r--r--src/wmlib/include/wm_cdtext.h (renamed from wmlib/include/wm_cdtext.h)0
-rw-r--r--src/wmlib/include/wm_config.h (renamed from wmlib/include/wm_config.h)0
-rw-r--r--src/wmlib/include/wm_helpers.h (renamed from wmlib/include/wm_helpers.h)0
-rw-r--r--src/wmlib/include/wm_platform.h (renamed from wmlib/include/wm_platform.h)0
-rw-r--r--src/wmlib/include/wm_scsi.h (renamed from wmlib/include/wm_scsi.h)0
-rw-r--r--src/wmlib/include/wm_struct.h (renamed from wmlib/include/wm_struct.h)0
-rw-r--r--src/wmlib/include/wm_version.h (renamed from wmlib/include/wm_version.h)0
-rw-r--r--src/wmlib/include/workman.h (renamed from wmlib/include/workman.h)0
-rw-r--r--src/wmlib/include/workman_defs.h (renamed from wmlib/include/workman_defs.h)0
-rw-r--r--src/wmlib/plat_aix.c (renamed from wmlib/plat_aix.c)0
-rw-r--r--src/wmlib/plat_bsd386.c (renamed from wmlib/plat_bsd386.c)0
-rw-r--r--src/wmlib/plat_freebsd.c (renamed from wmlib/plat_freebsd.c)0
-rw-r--r--src/wmlib/plat_hpux.c (renamed from wmlib/plat_hpux.c)0
-rw-r--r--src/wmlib/plat_irix.c (renamed from wmlib/plat_irix.c)0
-rw-r--r--src/wmlib/plat_linux.c (renamed from wmlib/plat_linux.c)0
-rw-r--r--src/wmlib/plat_news.c (renamed from wmlib/plat_news.c)0
-rw-r--r--src/wmlib/plat_openbsd.c (renamed from wmlib/plat_openbsd.c)0
-rw-r--r--src/wmlib/plat_osf1.c (renamed from wmlib/plat_osf1.c)0
-rw-r--r--src/wmlib/plat_scor5.c (renamed from wmlib/plat_scor5.c)0
-rw-r--r--src/wmlib/plat_sun.c (renamed from wmlib/plat_sun.c)0
-rw-r--r--src/wmlib/plat_sun_cdda.c (renamed from wmlib/plat_sun_cdda.c)0
-rw-r--r--src/wmlib/plat_svr4.c (renamed from wmlib/plat_svr4.c)0
-rw-r--r--src/wmlib/plat_template.c (renamed from wmlib/plat_template.c)0
-rw-r--r--src/wmlib/plat_ultrix.c (renamed from wmlib/plat_ultrix.c)0
-rw-r--r--src/wmlib/scsi.c (renamed from wmlib/scsi.c)0
-rw-r--r--src/wmlib/wm_helpers.c (renamed from wmlib/wm_helpers.c)0
-rw-r--r--src/wmlib_interface.cpp (renamed from wmlib_interface.cpp)31
-rw-r--r--src/wmlib_interface.h (renamed from wmlib_interface.h)0
56 files changed, 211 insertions, 148 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 414f611..4fae4f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,119 +1,74 @@
-cmake_minimum_required(VERSION 2.8.12)
-
+´╗┐cmake_minimum_required(VERSION 2.8.12)
project(libkcompactdisc)
-set(KSCD_VERSION_MAJOR 5)
-set(KSCD_VERSION_MINOR 0)
-set(KSCD_VERSION_PATCH 0)
-set(KSCD_VERSION ${KSCD_VERSION_MAJOR}.${KSCD_VERSION_MINOR}.${KSCD_VERSION_PATCH})
-include(FeatureSummary)
-find_package(Qt5 REQUIRED COMPONENTS Core)
+set(QT5_REQUIRED_VERSION 5.5.0)
+set(KF5_REQUIRED_VERSION 5.13.0)
-find_package(ECM 1.7.0 NO_MODULE REQUIRED)
+find_package(ECM ${KF5_REQUIRED_VERSION} NO_MODULE REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
-include(ECMAddAppIcon)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
-include(ECMInstallIcons)
-include(ECMAddAppIcon)
-
-find_package(KF5 REQUIRED COMPONENTS
- I18n
- Crash
- CoreAddons
- DocTools
- KIO
- Solid
- KDELibs4Support
-)
-find_package(Phonon4Qt5 CONFIG REQUIRED)
-include_directories (${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
-
-## Compiler flags
-if(CMAKE_COMPILER_IS_GNUCXX)
- set(CMAKE_C_FLAGS "-std=c99") ## ALSA no longer compiles with -std=c90, see https://bugzilla.novell.com/show_bug.cgi?id=817077
-endif()
-
-find_package(Alsa)
-alsa_configure_file(${CMAKE_CURRENT_BINARY_DIR}/config-alsa.h)
-
-include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
+include(ECMPackageConfigHelpers)
+include(ECMGenerateHeaders)
+include(ECMSetupVersion)
+include(ECMGeneratePriFile)
+include(FeatureSummary)
+# Version Setup
-set(wmlib_audio_SRCS
- wmlib/audio/audio.c
- wmlib/audio/audio_arts.c
- wmlib/audio/audio_alsa.c
- wmlib/audio/audio_sun.c
+ecm_setup_version("5.0.0"
+ VARIABLE_PREFIX KCOMPACTDISC
+ VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/kcompactdisc_version.h
+ PACKAGE_VERSION_FILE ${CMAKE_CURRENT_BINARY_DIR}/KF5CompactDiscConfigVersion.cmake
+ SOVERSION 5
)
-set(wmlib_SRCS
- wmlib/cdda.c
- wmlib/cddb.c
- wmlib/cdrom.c
- wmlib/wm_helpers.c
- wmlib/cdtext.c
- wmlib/scsi.c
- wmlib/plat_aix.c
- wmlib/plat_bsd386.c
- wmlib/plat_freebsd.c
- wmlib/plat_hpux.c
- wmlib/plat_irix.c
- wmlib/plat_linux.c
- wmlib/plat_svr4.c
- wmlib/plat_ultrix.c
- wmlib/plat_news.c
- wmlib/plat_openbsd.c
- wmlib/plat_osf1.c
- wmlib/plat_sun.c
- wmlib/plat_scor5.c
- wmlib/drv_sony.c
- wmlib/drv_toshiba.c
-)
+# Qt5, KF5 and Phonon Packages
-if (APPLE OR WIN32 OR CMAKE_SYSTEM_NAME STREQUAL GNU)
- set(USE_WMLIB false)
-else (APPLE OR WIN32 OR CMAKE_SYSTEM_NAME STREQUAL GNU)
- set(USE_WMLIB true)
-endif (APPLE OR WIN32 OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+find_package(Qt5 ${QT5_REQUIRED_VERSION} REQUIRED COMPONENTS Core DBus)
+find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS CoreAddons Solid I18n)
+find_package(Phonon4Qt5 4.8.0 CONFIG REQUIRED)
-set(kcompactdisc_LIB_SRCS kcompactdisc.cpp kcompactdisc_p.cpp phonon_interface.cpp)
-
-if (USE_WMLIB)
- set(kcompactdisc_LIB_SRCS ${kcompactdisc_LIB_SRCS} wmlib_interface.cpp ${wmlib_SRCS} ${wmlib_audio_SRCS})
- add_definitions(-DUSE_WMLIB=1)
-endif (USE_WMLIB)
-
-add_library(KF5CompactDisc SHARED ${kcompactdisc_LIB_SRCS})
-set_target_properties(KF5CompactDisc PROPERTIES VERSION ${KSCD_VERSION} SOVERSION ${KSCD_VERSION_MAJOR} )
+# Sources
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
-target_link_libraries(KF5CompactDisc
- KF5::KDELibs4Support
- Phonon::phonon4qt5 )
-if (HAVE_LIBASOUND2)
- target_link_libraries(KF5CompactDisc ${ASOUND_LIBRARY})
-endif (HAVE_LIBASOUND2)
-if (USE_WMLIB)
- find_package(Threads)
- target_link_libraries(KF5CompactDisc ${CMAKE_THREAD_LIBS_INIT})
-endif (USE_WMLIB)
+add_subdirectory(src)
+# Additional
+set(CMAKECONFIG_INSTALL_DIR ${CMAKECONFIG_INSTALL_PREFIX}/KF5CompactDisc)
-install(TARGETS KF5CompactDisc EXPORT LibkcompactdiscTargets ${INSTALL_TARGETS_DEFAULT_ARGS} )
+ecm_configure_package_config_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/KF5CompactDiscConfig.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/KF5CompactDiscConfig.cmake
+ INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
+)
-########### install files ###############
+install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/KF5CompactDiscConfig.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/KF5CompactDiscConfigVersion.cmake
+ DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
+ COMPONENT Devel
+)
-install( FILES kcompactdisc.h DESTINATION ${INCLUDE_INSTALL_DIR}/libkcompactdisc COMPONENT Devel)
+install(EXPORT
+ KF5CompactDiscTargets
+ DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
+ FILE KF5CompactDiscTargets.cmake
+ NAMESPACE KF5::
+ COMPONENT Devel
+)
-# Figure out the relative path from the installed Config.cmake file to the install prefix (which may be at
-# runtime different from the chosen CMAKE_INSTALL_PREFIX if under Windows the package was installed anywhere)
-# This relative path will be configured into LibkcompactdiscConfig.cmake
-file(RELATIVE_PATH relInstallDir ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/cmake/libkcompactdisc ${CMAKE_INSTALL_PREFIX})
+install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/kcompactdisc_version.h
+ DESTINATION "${KF5_INCLUDE_INSTALL_DIR}"
+ COMPONENT Devel
+)
-configure_file(LibkcompactdiscConfig.cmake.in ${CMAKE_BINARY_DIR}/LibkcompactdiscConfig.cmake @ONLY)
-install(FILES ${CMAKE_BINARY_DIR}/LibkcompactdiscConfig.cmake DESTINATION ${LIB_INSTALL_DIR}/cmake/libkcompactdisc)
-install(EXPORT LibkcompactdiscTargets DESTINATION ${LIB_INSTALL_DIR}/cmake/libkcompactdisc/ FILE LibkcompactdiscTargets.cmake NAMESPACE KDE::Libkcompactdisc::)
+feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/KF5CompactDiscConfig.cmake.in b/KF5CompactDiscConfig.cmake.in
new file mode 100644
index 0000000..0474a82
--- /dev/null
+++ b/KF5CompactDiscConfig.cmake.in
@@ -0,0 +1,10 @@
+@PACKAGE_INIT@
+
+find_dependency(Qt5Core @QT5_REQUIRED_VERSION@)
+find_dependency(Qt5DBus @QT5_REQUIRED_VERSION@)
+find_dependency(KF5CoreAddons @KF5_REQUIRED_VERSION@)
+find_dependency(KF5Solid @KF5_REQUIRED_VERSION@)
+find_dependency(KF5I8n @KF5_REQUIRED_VERSION@)
+find_dependency(Phonon4Qt5 4.8.0)
+
+include(${CMAKE_CURRENT_LIST_DIR}/KF5CompactDiscTargets.cmake)
diff --git a/LibkcompactdiscConfig.cmake.in b/LibkcompactdiscConfig.cmake.in
deleted file mode 100644
index c5d1d8c..0000000
--- a/LibkcompactdiscConfig.cmake.in
+++ /dev/null
@@ -1,13 +0,0 @@
-# LibkcompactdiscConfig.cmake is generated by CMake from LibkcompactdiscConfig.cmake.in.
-# Any changed value in this file will be overwritten by CMake.
-
-get_filename_component(currentDir ${CMAKE_CURRENT_LIST_FILE} PATH) # get the directory where I myself am
-get_filename_component(rootDir ${currentDir}/@relInstallDir@ ABSOLUTE) # get the chosen install prefix
-
-if (NOT _libkcompactdisc_targets_included)
- set(_libkcompactdisc_targets_included TRUE)
- include(${currentDir}/LibkcompactdiscTargets.cmake)
-endif (NOT _libkcompactdisc_targets_included)
-
-set(LIBKCOMPACTDISC_INCLUDE_DIRS "${rootDir}/@INCLUDE_INSTALL_DIR@")
-set(LIBKCOMPACTDISC_LIBRARIES KDE::Libkcompactdisc::kcompactdisc)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..7c7d720
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,104 @@
+include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${QT_INCLUDES})
+
+## Compiler flags
+
+if(CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_C_FLAGS "-std=c99") ## ALSA no longer compiles with -std=c90, see https://bugzilla.novell.com/show_bug.cgi?id=817077
+endif()
+
+find_package(ALSA)
+
+set(wmlib_audio_SRCS
+ wmlib/audio/audio.c
+ wmlib/audio/audio_arts.c
+ wmlib/audio/audio_alsa.c
+ wmlib/audio/audio_sun.c
+)
+
+set(wmlib_SRCS
+ wmlib/cdda.c
+ wmlib/cddb.c
+ wmlib/cdrom.c
+ wmlib/wm_helpers.c
+ wmlib/cdtext.c
+ wmlib/scsi.c
+ wmlib/plat_aix.c
+ wmlib/plat_bsd386.c
+ wmlib/plat_freebsd.c
+ wmlib/plat_hpux.c
+ wmlib/plat_irix.c
+ wmlib/plat_linux.c
+ wmlib/plat_svr4.c
+ wmlib/plat_ultrix.c
+ wmlib/plat_news.c
+ wmlib/plat_openbsd.c
+ wmlib/plat_osf1.c
+ wmlib/plat_sun.c
+ wmlib/plat_scor5.c
+ wmlib/drv_sony.c
+ wmlib/drv_toshiba.c
+)
+
+if (APPLE OR WIN32 OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+ set(USE_WMLIB false)
+else (APPLE OR WIN32 OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+ set(USE_WMLIB true)
+endif (APPLE OR WIN32 OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+
+# Disable WMLib temporarily
+
+set(USE_WMLIB false)
+
+set(KCD_LIB_SRCS
+ kcompactdisc.cpp
+ kcompactdisc_p.cpp
+ phonon_interface.cpp
+)
+
+if (USE_WMLIB)
+ set(KCD_LIB_SRCS ${KCD_LIB_SRCS} wmlib_interface.cpp ${wmlib_SRCS} ${wmlib_audio_SRCS})
+ add_definitions(-DUSE_WMLIB=1)
+endif (USE_WMLIB)
+
+add_library(KF5CompactDisc SHARED ${KCD_LIB_SRCS})
+add_library(KF5::CompactDisc ALIAS KF5CompactDisc)
+set_target_properties(KF5CompactDisc PROPERTIES
+ VERSION ${KCOMPACTDISC_VERSION}
+ SOVERSION ${KCOMPACTDISC_SOVERSION}
+)
+
+target_link_libraries(KF5CompactDisc
+ Qt5::DBus
+ KF5::CoreAddons
+ KF5::Solid
+ KF5::I18n
+ Phonon::phonon4qt5
+)
+
+if (HAVE_LIBASOUND2)
+ target_link_libraries(KF5CompactDisc ${ASOUND_LIBRARY})
+endif (HAVE_LIBASOUND2)
+
+if (USE_WMLIB)
+ find_package(Threads)
+ target_link_libraries(KF5CompactDisc ${CMAKE_THREAD_LIBS_INIT})
+endif (USE_WMLIB)
+
+target_include_directories(KF5CompactDisc PUBLIC $<INSTALL_INTERFACE:${KF5_INCLUDE_INSTALL_DIR}/KCompactDisc>)
+ecm_generate_headers(KCOMPACTDISC_HEADERS
+ HEADER_NAMES KCompactDisc
+ PREFIX KCompactDisc
+ REQUIRED_HEADERS KCOMPACTDISC_REQ_HEADERS
+)
+
+ecm_generate_pri_file(
+ BASE_NAME KCompactDisc
+ LIB_NAME KF5CompactDisc
+ DEPS "core dbus phonon4qt5 KCoreAddons KI18n Solid"
+ FILENAME_VAR PRI_FILENAME
+)
+
+install(TARGETS KF5CompactDisc EXPORT KF5CompactDiscTargets ${INSTALL_TARGETS_DEFAULT_ARGS})
+install(FILES ${KCOMPACTDISC_HEADERS} DESTINATION ${KF5_INCLUDE_INSTALL_DIR}/KCompactDisc/KCompactDisc COMPONENT Devel)
+install(FILES ${KCOMPACTDISC_REQ_HEADERS} DESTINATION ${KF5_INCLUDE_INSTALL_DIR}/KCompactDisc/kcompactdisc COMPONENT Devel)
+install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
diff --git a/kcompactdisc.cpp b/src/kcompactdisc.cpp
index cc934db..aeb5e8c 100644
--- a/kcompactdisc.cpp
+++ b/src/kcompactdisc.cpp
@@ -24,8 +24,8 @@
#include <QtDBus>
#include <QUrl>
+#include <QtGlobal>
-#include <kdebug.h>
#include <klocale.h>
#include <solid/device.h>
@@ -45,7 +45,7 @@ static void refreshListOfCdromDevices()
//get a list of all devices that are Cdrom
foreach(const Solid::Device &device, Solid::Device::listFromType(Solid::DeviceInterface::OpticalDrive)) {
- kDebug() << device.udi().toLatin1().constData();
+ qDebug() << device.udi().toLatin1().constData();
const Solid::Block *b = device.as<Solid::Block>();
if(!b) {
@@ -105,17 +105,17 @@ static QMap<QString, QString> &getListOfCdromDevicesNamesAndUdi()
QString KCompactDisc::urlToDevice(const QUrl &deviceUrl)
{
if(deviceUrl.scheme() == QLatin1String( "media" ) || deviceUrl.scheme() == QLatin1String( "system" )) {
- kDebug() << "Asking mediamanager for " << deviceUrl.fileName();
+ qDebug() << "Asking mediamanager for " << deviceUrl.fileName();
QDBusInterface mediamanager( QLatin1String( "org.kde.kded" ), QLatin1String( "/modules/mediamanager" ), QLatin1String( "org.kde.MediaManager" ) );
QDBusReply<QStringList> reply = mediamanager.call(QLatin1String( "properties" ), deviceUrl.fileName());
QStringList properties = reply;
if(!reply.isValid() || properties.count() < 6) {
- kError() << "Invalid reply from mediamanager" << endl;
+ qCritical() << "Invalid reply from mediamanager" << endl;
return deviceUrl.path();
} else {
- kDebug() << "Reply from mediamanager " << properties[5];
+ qDebug() << "Reply from mediamanager " << properties[5];
return properties[5];
}
} else if(deviceUrl.scheme() == QLatin1String( "file" )) {
@@ -530,7 +530,7 @@ bool KCompactDisc::setDevice(const QString &deviceName, unsigned volume,
{
const QString as = digitalPlayback ? audioSystem : QLatin1String("cdin");
const QString ad = digitalPlayback ? audioDevice : QString();
- kDebug() << "Device init: " << deviceName << ", " << as << ", " << ad;
+ qDebug() << "Device init: " << deviceName << ", " << as << ", " << ad;
if(d_ptr->moveInterface(deviceName, as, ad)) {
setVolume(volume);
@@ -544,14 +544,14 @@ bool KCompactDisc::setDevice(const QString &deviceName, unsigned volume,
void KCompactDisc::setVolume(unsigned volume)
{
Q_D(KCompactDisc);
- kDebug() << "change volume: " << volume;
+ qDebug() << "change volume: " << volume;
d->setVolume(volume);
}
void KCompactDisc::setBalance(unsigned balance)
{
Q_D(KCompactDisc);
- kDebug() << "change balance: " << balance;
+ qDebug() << "change balance: " << balance;
d->setBalance(balance);
}
diff --git a/kcompactdisc.h b/src/kcompactdisc.h
index 0a0b8b0..0a0b8b0 100644
--- a/kcompactdisc.h
+++ b/src/kcompactdisc.h
diff --git a/kcompactdisc_p.cpp b/src/kcompactdisc_p.cpp
index 739e957..a39e769 100644
--- a/kcompactdisc_p.cpp
+++ b/src/kcompactdisc_p.cpp
@@ -23,9 +23,11 @@
#include "wmlib_interface.h"
#include "phonon_interface.h"
-#include <kdebug.h>
+#include <QtGlobal>
#include <klocale.h>
+Q_LOGGING_CATEGORY(CD_PLAYLIST, "cd.playlist")
+
KCompactDiscPrivate::KCompactDiscPrivate(KCompactDisc *p, const QString& dev) :
m_infoMode(KCompactDisc::Synchronous),
m_deviceName(dev),
@@ -66,8 +68,8 @@ bool KCompactDiscPrivate::moveInterface(const QString &deviceName,
KCompactDiscPrivate *pOld, *pNew;
- kDebug() << "switch from " << q->d_ptr->m_interface << " on " << q->d_ptr->m_deviceName;
- kDebug() << " to " << audioSystem << " on " << deviceName;
+ qDebug() << "switch from " << q->d_ptr->m_interface << " on " << q->d_ptr->m_deviceName;
+ qDebug() << " to " << audioSystem << " on " << deviceName;
/* switch temporary to dummy implementation */
if(q->d_ptr != this) {
@@ -111,7 +113,7 @@ void KCompactDiscPrivate::make_playlist()
unsigned selected = 0, size = m_tracks;
bool rejected = false;
- kDebug(67000) << "Playlist has " << size << " entries\n";
+ qCDebug(CD_PLAYLIST) << "Playlist has " << size << " entries\n";
m_playlist.clear();
for(unsigned i = 0; i < size; i++) {
if(m_randomPlaylist) {
@@ -125,12 +127,12 @@ void KCompactDiscPrivate::make_playlist()
m_playlist.append(selected);
}
- kDebug(67000) << "dump playlist";
+ qCDebug(CD_PLAYLIST) << "dump playlist";
QList<unsigned>::const_iterator it;
for(it = m_playlist.constBegin(); it != m_playlist.constEnd(); it++) {
- kDebug(67000) << " " << *it;
+ qCDebug(CD_PLAYLIST) << " " << *it;
}
- kDebug(67000) << "dump playlist end";
+ qCDebug(CD_PLAYLIST) << "dump playlist end";
}
unsigned KCompactDiscPrivate::getNextTrackInPlaylist()
diff --git a/kcompactdisc_p.h b/src/kcompactdisc_p.h
index 7355cb5..db7eb19 100644
--- a/kcompactdisc_p.h
+++ b/src/kcompactdisc_p.h
@@ -23,18 +23,21 @@
#include <QString>
#include <QList>
+#include <QLoggingCategory>
+#include <QtGlobal>
#include <krandomsequence.h>
-#include <kurl.h>
#include "kcompactdisc.h"
+Q_DECLARE_LOGGING_CATEGORY(CD_PLAYLIST)
+
class KCompactDiscPrivate : public QObject
{
Q_OBJECT
public:
KCompactDiscPrivate(KCompactDisc *, const QString&);
- virtual ~KCompactDiscPrivate() { };
+ virtual ~KCompactDiscPrivate() { }
bool moveInterface(const QString &, const QString &, const QString &);
virtual bool createInterface();
diff --git a/phonon_interface.cpp b/src/phonon_interface.cpp
index 5bda8df..440b416 100644
--- a/phonon_interface.cpp
+++ b/src/phonon_interface.cpp
@@ -23,7 +23,8 @@
#include "phonon_interface.h"
-#include <kdebug.h>
+#include <QtGlobal>
+
#include <klocale.h>
#include <phonon/Global>
@@ -127,7 +128,7 @@ ProducerWidget *KPhononCompactDiscPrivate::producer()
if(opticalDrive) {
Solid::OpticalDisc *opticalDisc = opticalDevice.as<Solid::OpticalDisc>();
- kDebug() << "opticalDisc " << opticalDisc;
+ qDebug() << "opticalDisc " << opticalDisc;
//if(opticalDisc && (opticalDisc->availableContent() == Solid::OpticalDisc::Audio)) {
m_producerWidget = new ProducerWidget(this, m_udi);
//}
@@ -155,7 +156,7 @@ void KPhononCompactDiscPrivate::playTrackPosition(unsigned track, unsigned posit
if(!producer())
return;
- kDebug() << "play track " << track << " position " << position;
+ qDebug() << "play track " << track << " position " << position;
m_producerWidget->m_mediaController->setCurrentTitle(track);
m_producerWidget->m_media->seek(SEC2MS(position));
@@ -236,8 +237,8 @@ void KPhononCompactDiscPrivate::queryMetadata()
return;
QMultiMap<QString, QString> data = m_producerWidget->m_media->metaData();
- kDebug() << "METADATA";
- //kDebug() << data;
+ qDebug() << "METADATA";
+ //qDebug() << data;
m_trackArtists[0] = data.take(QLatin1String( "ARTIST" ));
m_trackTitles[0] = data.take(QLatin1String( "ALBUM" ));
@@ -287,7 +288,7 @@ void KPhononCompactDiscPrivate::tick(qint64 t)
m_discPosition = m_trackPosition;
// Update the current playing position.
if(m_seek) {
- kDebug() << "seek: " << m_seek << " trackPosition " << m_trackPosition;
+ qDebug() << "seek: " << m_seek << " trackPosition " << m_trackPosition;
if(abs((long)(m_trackExpectedPosition - m_trackPosition)) > m_seek)
m_seek = 0;
else
@@ -321,7 +322,7 @@ void KPhononCompactDiscPrivate::stateChanged(Phonon::State newstate, Phonon::Sta
if(m_tracks == 0) {
m_tracks = m_producerWidget->m_mediaController->availableTitles();
if(m_tracks > 0) {
- kDebug() << "New disc with " << m_tracks << " tracks";
+ qDebug() << "New disc with " << m_tracks << " tracks";
make_playlist();
diff --git a/phonon_interface.h b/src/phonon_interface.h
index f587a3c..f587a3c 100644
--- a/phonon_interface.h
+++ b/src/phonon_interface.h
diff --git a/wmlib/README b/src/wmlib/README
index d3ee905..d3ee905 100644
--- a/wmlib/README
+++ b/src/wmlib/README
diff --git a/wmlib/audio/audio.c b/src/wmlib/audio/audio.c
index 7101d23..7101d23 100644
--- a/wmlib/audio/audio.c
+++ b/src/wmlib/audio/audio.c
diff --git a/wmlib/audio/audio.h b/src/wmlib/audio/audio.h
index e821e7d..e821e7d 100644
--- a/wmlib/audio/audio.h
+++ b/src/wmlib/audio/audio.h
diff --git a/wmlib/audio/audio_alsa.c b/src/wmlib/audio/audio_alsa.c
index de5dbe1..de5dbe1 100644
--- a/wmlib/audio/audio_alsa.c
+++ b/src/wmlib/audio/audio_alsa.c
diff --git a/wmlib/audio/audio_arts.c b/src/wmlib/audio/audio_arts.c
index 23b5a63..23b5a63 100644
--- a/wmlib/audio/audio_arts.c
+++ b/src/wmlib/audio/audio_arts.c
diff --git a/wmlib/audio/audio_phonon.cpp b/src/wmlib/audio/audio_phonon.cpp
index 36fc77b..36fc77b 100644
--- a/wmlib/audio/audio_phonon.cpp
+++ b/src/wmlib/audio/audio_phonon.cpp
diff --git a/wmlib/audio/audio_phonon.h b/src/wmlib/audio/audio_phonon.h
index f7d27b6..f7d27b6 100644
--- a/wmlib/audio/audio_phonon.h
+++ b/src/wmlib/audio/audio_phonon.h
diff --git a/wmlib/audio/audio_sun.c b/src/wmlib/audio/audio_sun.c
index 97744de..97744de 100644
--- a/wmlib/audio/audio_sun.c
+++ b/src/wmlib/audio/audio_sun.c
diff --git a/wmlib/cdda.c b/src/wmlib/cdda.c
index 560e8bd..560e8bd 100644
--- a/wmlib/cdda.c
+++ b/src/wmlib/cdda.c
diff --git a/wmlib/cddb.c b/src/wmlib/cddb.c
index f8af715..f8af715 100644
--- a/wmlib/cddb.c
+++ b/src/wmlib/cddb.c
diff --git a/wmlib/cdrom.c b/src/wmlib/cdrom.c
index 4d99585..4d99585 100644
--- a/wmlib/cdrom.c
+++ b/src/wmlib/cdrom.c
diff --git a/wmlib/cdtext.c b/src/wmlib/cdtext.c
index 3a045be..3a045be 100644
--- a/wmlib/cdtext.c
+++ b/src/wmlib/cdtext.c
diff --git a/wmlib/drv_sony.c b/src/wmlib/drv_sony.c
index 7d6a33a..7d6a33a 100644
--- a/wmlib/drv_sony.c
+++ b/src/wmlib/drv_sony.c
diff --git a/wmlib/drv_toshiba.c b/src/wmlib/drv_toshiba.c
index 78323c2..78323c2 100644
--- a/wmlib/drv_toshiba.c
+++ b/src/wmlib/drv_toshiba.c
diff --git a/wmlib/include/wm_cdda.h b/src/wmlib/include/wm_cdda.h
index 5603311..5603311 100644
--- a/wmlib/include/wm_cdda.h
+++ b/src/wmlib/include/wm_cdda.h
diff --git a/wmlib/include/wm_cddb.h b/src/wmlib/include/wm_cddb.h
index 292896f..292896f 100644
--- a/wmlib/include/wm_cddb.h
+++ b/src/wmlib/include/wm_cddb.h
diff --git a/wmlib/include/wm_cdinfo.h b/src/wmlib/include/wm_cdinfo.h
index a001bb8..a001bb8 100644
--- a/wmlib/include/wm_cdinfo.h
+++ b/src/wmlib/include/wm_cdinfo.h
diff --git a/wmlib/include/wm_cdrom.h b/src/wmlib/include/wm_cdrom.h
index 03a53cb..03a53cb 100644
--- a/wmlib/include/wm_cdrom.h
+++ b/src/wmlib/include/wm_cdrom.h
diff --git a/wmlib/include/wm_cdtext.h b/src/wmlib/include/wm_cdtext.h
index bf97caa..bf97caa 100644
--- a/wmlib/include/wm_cdtext.h
+++ b/src/wmlib/include/wm_cdtext.h
diff --git a/wmlib/include/wm_config.h b/src/wmlib/include/wm_config.h
index b1e47b8..b1e47b8 100644
--- a/wmlib/include/wm_config.h
+++ b/src/wmlib/include/wm_config.h
diff --git a/wmlib/include/wm_helpers.h b/src/wmlib/include/wm_helpers.h
index ca8d22f..ca8d22f 100644
--- a/wmlib/include/wm_helpers.h
+++ b/src/wmlib/include/wm_helpers.h
diff --git a/wmlib/include/wm_platform.h b/src/wmlib/include/wm_platform.h
index d8ca5e1..d8ca5e1 100644
--- a/wmlib/include/wm_platform.h
+++ b/src/wmlib/include/wm_platform.h
diff --git a/wmlib/include/wm_scsi.h b/src/wmlib/include/wm_scsi.h
index 652a9a7..652a9a7 100644
--- a/wmlib/include/wm_scsi.h
+++ b/src/wmlib/include/wm_scsi.h
diff --git a/wmlib/include/wm_struct.h b/src/wmlib/include/wm_struct.h
index 2f94755..2f94755 100644
--- a/wmlib/include/wm_struct.h
+++ b/src/wmlib/include/wm_struct.h
diff --git a/wmlib/include/wm_version.h b/src/wmlib/include/wm_version.h
index 4c5459a..4c5459a 100644
--- a/wmlib/include/wm_version.h
+++ b/src/wmlib/include/wm_version.h
diff --git a/wmlib/include/workman.h b/src/wmlib/include/workman.h
index c6c5fe3..c6c5fe3 100644
--- a/wmlib/include/workman.h
+++ b/src/wmlib/include/workman.h
diff --git a/wmlib/include/workman_defs.h b/src/wmlib/include/workman_defs.h
index 00a8620..00a8620 100644
--- a/wmlib/include/workman_defs.h
+++ b/src/wmlib/include/workman_defs.h
diff --git a/wmlib/plat_aix.c b/src/wmlib/plat_aix.c
index 7ea25d3..7ea25d3 100644
--- a/wmlib/plat_aix.c
+++ b/src/wmlib/plat_aix.c
diff --git a/wmlib/plat_bsd386.c b/src/wmlib/plat_bsd386.c
index 6f9fd0e..6f9fd0e 100644
--- a/wmlib/plat_bsd386.c
+++ b/src/wmlib/plat_bsd386.c
diff --git a/wmlib/plat_freebsd.c b/src/wmlib/plat_freebsd.c
index 7cc31e6..7cc31e6 100644
--- a/wmlib/plat_freebsd.c
+++ b/src/wmlib/plat_freebsd.c
diff --git a/wmlib/plat_hpux.c b/src/wmlib/plat_hpux.c
index 9b98148..9b98148 100644
--- a/wmlib/plat_hpux.c
+++ b/src/wmlib/plat_hpux.c
diff --git a/wmlib/plat_irix.c b/src/wmlib/plat_irix.c
index e3b667c..e3b667c 100644
--- a/wmlib/plat_irix.c
+++ b/src/wmlib/plat_irix.c
diff --git a/wmlib/plat_linux.c b/src/wmlib/plat_linux.c
index 2a7a178..2a7a178 100644
--- a/wmlib/plat_linux.c
+++ b/src/wmlib/plat_linux.c
diff --git a/wmlib/plat_news.c b/src/wmlib/plat_news.c
index e9227c8..e9227c8 100644
--- a/wmlib/plat_news.c
+++ b/src/wmlib/plat_news.c
diff --git a/wmlib/plat_openbsd.c b/src/wmlib/plat_openbsd.c
index f6c4caf..f6c4caf 100644
--- a/wmlib/plat_openbsd.c
+++ b/src/wmlib/plat_openbsd.c
diff --git a/wmlib/plat_osf1.c b/src/wmlib/plat_osf1.c
index 63efb91..63efb91 100644
--- a/wmlib/plat_osf1.c
+++ b/src/wmlib/plat_osf1.c
diff --git a/wmlib/plat_scor5.c b/src/wmlib/plat_scor5.c
index 206dc47..206dc47 100644
--- a/wmlib/plat_scor5.c
+++ b/src/wmlib/plat_scor5.c
diff --git a/wmlib/plat_sun.c b/src/wmlib/plat_sun.c
index 22a1ff2..22a1ff2 100644
--- a/wmlib/plat_sun.c
+++ b/src/wmlib/plat_sun.c
diff --git a/wmlib/plat_sun_cdda.c b/src/wmlib/plat_sun_cdda.c
index 4f34d6a..4f34d6a 100644
--- a/wmlib/plat_sun_cdda.c
+++ b/src/wmlib/plat_sun_cdda.c
diff --git a/wmlib/plat_svr4.c b/src/wmlib/plat_svr4.c
index 56d7f41..56d7f41 100644
--- a/wmlib/plat_svr4.c
+++ b/src/wmlib/plat_svr4.c
diff --git a/wmlib/plat_template.c b/src/wmlib/plat_template.c
index d4bd9eb..d4bd9eb 100644
--- a/wmlib/plat_template.c
+++ b/src/wmlib/plat_template.c
diff --git a/wmlib/plat_ultrix.c b/src/wmlib/plat_ultrix.c
index 51c791b..51c791b 100644
--- a/wmlib/plat_ultrix.c
+++ b/src/wmlib/plat_ultrix.c
diff --git a/wmlib/scsi.c b/src/wmlib/scsi.c
index 91595ee..91595ee 100644
--- a/wmlib/scsi.c
+++ b/src/wmlib/scsi.c
diff --git a/wmlib/wm_helpers.c b/src/wmlib/wm_helpers.c
index 5179920..5179920 100644
--- a/wmlib/wm_helpers.c
+++ b/src/wmlib/wm_helpers.c
diff --git a/wmlib_interface.cpp b/src/wmlib_interface.cpp
index 2debd11..b26c514 100644
--- a/wmlib_interface.cpp
+++ b/src/wmlib_interface.cpp
@@ -20,7 +20,8 @@
#include "wmlib_interface.h"
-#include <kdebug.h>
+#include <QtGlobal>
+
#include <klocale.h>
extern "C"
@@ -61,9 +62,9 @@ bool KWMLibCompactDiscPrivate::createInterface()
//wm_cd_set_verbosity(WM_MSG_LEVEL_DEBUG | WM_MSG_CLASS_ALL);
int status = wm_cd_init(
- devicePath.toAscii().data(),
- m_audioSystem.toAscii().data(),
- m_audioDevice.toAscii().data(),
+ devicePath.toLatin1().data(),
+ m_audioSystem.toLatin1().data(),
+ m_audioDevice.toLatin1().data(),
NULL,
&m_handle);
@@ -105,7 +106,7 @@ void KWMLibCompactDiscPrivate::playTrackPosition(unsigned track, unsigned positi
lastTrack = firstTrack + 1;
lastTrack = TRACK_VALID(lastTrack) ? lastTrack : WM_ENDTRACK;
- kDebug() << "play track " << firstTrack << " position "
+ qDebug() << "play track " << firstTrack << " position "
<< position << endl;
wm_cd_play(m_handle, firstTrack, position, lastTrack);
@@ -220,7 +221,7 @@ void KWMLibCompactDiscPrivate::timerExpired()
if(m_tracks == 0) {
m_tracks = wm_cd_getcountoftracks(m_handle);
if(m_tracks > 0) {
- kDebug() << "New disc with " << m_tracks << " tracks";
+ qDebug() << "New disc with " << m_tracks << " tracks";
m_discId = wm_cddb_discid(m_handle);
for(i = 1; i <= m_tracks; i++) {
@@ -240,10 +241,10 @@ void KWMLibCompactDiscPrivate::timerExpired()
m_trackTitles.append(ki18n("Track %1").subs(i, 2).toString());
}
-kDebug() << "m_tracks " << m_tracks;
-kDebug() << "m_trackStartFrames " << m_trackStartFrames;
-kDebug() << "m_trackArtists " << m_trackArtists;
-kDebug() << "m_trackTitles " << m_trackTitles;
+qDebug() << "m_tracks " << m_tracks;
+qDebug() << "m_trackStartFrames " << m_trackStartFrames;
+qDebug() << "m_trackArtists " << m_trackArtists;
+qDebug() << "m_trackTitles " << m_trackTitles;
emit q->discChanged(m_tracks);
@@ -261,7 +262,7 @@ kDebug() << "m_trackTitles " << m_trackTitles;
m_discPosition = wm_get_cur_pos_abs(m_handle) - FRAMES2SEC(m_trackStartFrames[0]);
// Update the current playing position.
if(m_seek) {
- kDebug() << "seek: " << m_seek << " trackPosition " << m_trackPosition;
+ qDebug() << "seek: " << m_seek << " trackPosition " << m_trackPosition;
if(abs((long)(m_trackExpectedPosition - m_trackPosition)) > m_seek)
m_seek = 0;
else
@@ -305,7 +306,7 @@ void KWMLibCompactDiscPrivate::cdtext()
info = wm_cd_get_cdtext(m_handle);
if(!info || !info->valid || (unsigned)info->count_of_entries != (m_tracks + 1)) {
- kDebug() << "no or invalid CDTEXT";
+ qDebug() << "no or invalid CDTEXT";
return;
}
@@ -317,9 +318,9 @@ void KWMLibCompactDiscPrivate::cdtext()
m_trackTitles[i] =QLatin1String( reinterpret_cast<char*>(info->blocks[0]->name[i]) );
}
- kDebug() << "CDTEXT";
- kDebug() << "m_trackArtists " << m_trackArtists;
- kDebug() << "m_trackTitles " << m_trackTitles;
+ qDebug() << "CDTEXT";
+ qDebug() << "m_trackArtists " << m_trackArtists;
+ qDebug() << "m_trackTitles " << m_trackTitles;
emit q->discInformation(KCompactDisc::Cdtext);
}
diff --git a/wmlib_interface.h b/src/wmlib_interface.h
index 0125453..0125453 100644
--- a/wmlib_interface.h
+++ b/src/wmlib_interface.h