summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeslie Zhai <xiangzhai83@gmail.com>2016-07-19 09:19:15 (GMT)
committerLeslie Zhai <xiangzhai83@gmail.com>2016-07-19 09:19:15 (GMT)
commitae9a47e5435fc25334f63aaac437ed1dcda7df73 (patch)
tree1fcff2ad4c7a0d24b3eede1ffb4f13873dc3195e
parent87f302543f08c7b355a5085fcf2e92629fef84d0 (diff)
Port to KF5 and test pass.
-rw-r--r--CMakeLists.txt90
-rw-r--r--audiocd.cpp18
-rw-r--r--audiocd.h10
-rw-r--r--cmake/FindFLAC.cmake35
-rw-r--r--cmake/FindOggVorbis.cmake89
-rw-r--r--data/CMakeLists.txt1
-rw-r--r--doc/CMakeLists.txt2
-rw-r--r--kcmaudiocd/CMakeLists.txt26
-rw-r--r--kcmaudiocd/kcmaudiocd.cpp19
-rw-r--r--kcmaudiocd/kcmaudiocd.h3
-rw-r--r--plugins/CMakeLists.txt48
-rw-r--r--plugins/audiocdencoder.h6
-rw-r--r--plugins/flac/CMakeLists.txt21
-rw-r--r--plugins/flac/encoderflac.cpp5
-rw-r--r--plugins/lame/CMakeLists.txt26
-rw-r--r--plugins/lame/encoderlame.cpp4
-rw-r--r--plugins/vorbis/CMakeLists.txt27
-rw-r--r--plugins/vorbis/encodervorbis.cpp2
-rw-r--r--plugins/wav/CMakeLists.txt18
-rw-r--r--plugins/wav/encoderwav.cpp2
20 files changed, 295 insertions, 157 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 17a9433..71f81aa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,59 +1,71 @@
project(audiocd)
-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
-
-find_package(KDE4 REQUIRED)
-include(KDE4Defaults)
-include(MacroLibrary)
-include(CheckStructMember)
-
-find_package(Libkcddb)
-find_package(Libkcompactdisc)
-
-find_package(Cdparanoia)
-
-MACRO_PUSH_REQUIRED_VARS()
-SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${CDPARANOIA_INCLUDE_DIR})
-check_struct_member("struct cdrom_drive" "ioctl_device_name" "cdda_interface.h" CDDA_IOCTL_DEVICE_EXISTS)
-MACRO_POP_REQUIRED_VARS()
-macro_bool_to_01(CDDA_IOCTL_DEVICE_EXISTS HAVE_CDDA_IOCTL_DEVICE)
-
-
-configure_file (config-audiocd.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-audiocd.h )
+cmake_minimum_required(VERSION 2.8.12)
+
+# ECM setup
+include(FeatureSummary)
+find_package(ECM 5.24.0 NO_MODULE)
+set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules")
+feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
+set(CMAKE_MODULE_PATH "${ECM_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+
+set(KF5_VERSION "5.25.0") # handled by release scripts
+set(KF5_DEP_VERSION "5.24.0") # handled by release scripts
+
+find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS
+ Config
+ KDELibs4Support
+ DocTools
+ KIO
+ CompactDisc
+ Cddb
+)
+
+include(KDEInstallDirs)
+include(KDECompilerSettings)
+include(KDECMakeSettings)
+include(GenerateExportHeader)
+include(ECMSetupVersion)
+
+ecm_setup_version(${KF5_VERSION}
+ VARIABLE_PREFIX AUDIOCDPLUGINS
+ VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/audiocdplugins_version.h"
+ PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/AudioCDPluginsConfigVersion.cmake"
+ SOVERSION 5
+)
+
+find_package(Cdparanoia REQUIRED)
+
+configure_file(config-audiocd.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-audiocd.h)
#############################
include_directories(
- ${KDE4_INCLUDES}
- ${CDPARANOIA_INCLUDE_DIR}
+ ${CDPARANOIA_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
- ${LIBKCDDB_INCLUDE_DIRS}
- ${LIBKCOMPACTDISC_INCLUDE_DIRS}
- )
-
-
-add_subdirectory( plugins )
-add_subdirectory( kcmaudiocd )
-add_subdirectory( data )
-add_subdirectory( doc )
+)
+add_subdirectory(plugins)
+add_subdirectory(kcmaudiocd)
+add_subdirectory(data)
+add_subdirectory(doc)
########### next target ###############
set(kio_audiocd_PART_SRCS audiocd.cpp )
+add_library(kio_audiocd ${kio_audiocd_PART_SRCS})
-kde4_add_plugin(kio_audiocd ${kio_audiocd_PART_SRCS})
-
-
-
-target_link_libraries(kio_audiocd ${CDPARANOIA_LIBRARIES} ${KDE4_KIO_LIBS} ${LIBKCDDB_LIBRARIES} ${LIBKCOMPACTDISC_LIBRARIES} audiocdplugins)
-
-install(TARGETS kio_audiocd DESTINATION ${PLUGIN_INSTALL_DIR} )
+target_link_libraries(kio_audiocd
+ ${CDPARANOIA_LIBRARIES}
+ KF5::CompactDisc
+ audiocdplugins
+)
+install(TARGETS kio_audiocd DESTINATION ${PLUGIN_INSTALL_DIR})
########### install files ###############
-install( FILES audiocd.protocol DESTINATION ${SERVICES_INSTALL_DIR} )
+install(FILES audiocd.protocol DESTINATION ${SERVICES_INSTALL_DIR})
diff --git a/audiocd.cpp b/audiocd.cpp
index 4f0fee2..4e8cad8 100644
--- a/audiocd.cpp
+++ b/audiocd.cpp
@@ -56,8 +56,8 @@ extern "C"
#include <QRegExp>
#include <QHash>
// CDDB
-#include <libkcddb/client.h>
-#include <libkcompactdisc/kcompactdisc.h>
+#include <KCddb/Client>
+#include <KCompactDisc/KCompactDisc>
using namespace KIO;
@@ -263,9 +263,9 @@ static void setDeviceToCd(KCompactDisc *cd, struct cdrom_drive *drive)
#endif
}
-struct cdrom_drive * AudioCDProtocol::initRequest(const KUrl & url)
+struct cdrom_drive * AudioCDProtocol::initRequest(const QUrl & url)
{
- if (url.hasHost())
+ if (!url.host().isEmpty())
{
error(KIO::ERR_UNSUPPORTED_ACTION,
i18n("You cannot specify a host with this protocol. "
@@ -444,7 +444,7 @@ bool AudioCDProtocol::getSectorsForRequest(struct cdrom_drive * drive, long & fi
return true;
}
-void AudioCDProtocol::get(const KUrl & url)
+void AudioCDProtocol::get(const QUrl & url)
{
struct cdrom_drive * drive = initRequest(url);
if (!drive) {
@@ -534,7 +534,7 @@ void AudioCDProtocol::get(const KUrl & url)
finished();
}
-void AudioCDProtocol::stat(const KUrl & url)
+void AudioCDProtocol::stat(const QUrl & url)
{
struct cdrom_drive * drive = initRequest(url);
@@ -627,7 +627,7 @@ static void app_file(UDSEntry& e, const QString & n, size_t s, const QString &mi
e.insert( KIO::UDSEntry::UDS_MIME_TYPE, mimetype);
}
-void AudioCDProtocol::listDir(const KUrl & url)
+void AudioCDProtocol::listDir(const QUrl & url)
{
struct cdrom_drive * drive = initRequest(url);
@@ -637,7 +637,7 @@ void AudioCDProtocol::listDir(const KUrl & url)
const QStringList &deviceNames = KCompactDisc::cdromDeviceNames();
foreach (const QString &deviceName, deviceNames) {
const QString &device = KCompactDisc::urlToDevice(KCompactDisc::cdromDeviceUrl(deviceName));
- KUrl targetUrl = url;
+ QUrl targetUrl = url;
targetUrl.addEncodedQueryItem("device", device.toUtf8());
app_dir(entry, device, 2+encoders.count());
entry.insert(KIO::UDSEntry::UDS_TARGET_URL, targetUrl.url());
@@ -1000,7 +1000,7 @@ void AudioCDProtocol::paranoiaRead(
* Read the settings from the URL
* @see loadSettings()
*/
-void AudioCDProtocol::parseURLArgs(const KUrl & url)
+void AudioCDProtocol::parseURLArgs(const QUrl & url)
{
d->clearURLargs();
diff --git a/audiocd.h b/audiocd.h
index 71e88c0..322c363 100644
--- a/audiocd.h
+++ b/audiocd.h
@@ -45,16 +45,16 @@ class AudioCDProtocol : public KIO::SlaveBase
AudioCDProtocol(const QByteArray & protocol, const QByteArray & pool, const QByteArray & app);
virtual ~AudioCDProtocol();
- virtual void get(const KUrl &);
- virtual void stat(const KUrl &);
- virtual void listDir(const KUrl &);
+ virtual void get(const QUrl &);
+ virtual void stat(const QUrl &);
+ virtual void listDir(const QUrl &);
protected:
AudioCDEncoder *encoderFromExtension(const QString& extension);
AudioCDEncoder *determineEncoder(const QString & filename);
struct cdrom_drive *findDrive(bool &noPermission);
- void parseURLArgs(const KUrl &);
+ void parseURLArgs(const QUrl &);
void loadSettings();
@@ -86,7 +86,7 @@ class AudioCDProtocol : public KIO::SlaveBase
unsigned long size
);
- struct cdrom_drive *initRequest(const KUrl &);
+ struct cdrom_drive *initRequest(const QUrl &);
/**
* Add an entry in the KIO directory, using the title you give,
diff --git a/cmake/FindFLAC.cmake b/cmake/FindFLAC.cmake
new file mode 100644
index 0000000..7de8a06
--- /dev/null
+++ b/cmake/FindFLAC.cmake
@@ -0,0 +1,35 @@
+# - Find FLAC
+# Find the native FLAC includes and libraries
+#
+# FLAC_INCLUDE_DIR - where to find FLAC headers.
+# FLAC_LIBRARIES - List of libraries when using libFLAC.
+# FLAC_FOUND - True if libFLAC found.
+
+if(FLAC_INCLUDE_DIR)
+ # Already in cache, be silent
+ set(FLAC_FIND_QUIETLY TRUE)
+endif(FLAC_INCLUDE_DIR)
+
+find_path(FLAC_INCLUDE_DIR FLAC/stream_decoder.h)
+
+# MSVC built libraries can name them *_static, which is good as it
+# distinguishes import libraries from static libraries with the same extension.
+find_library(FLAC_LIBRARY NAMES FLAC libFLAC libFLAC_dynamic libFLAC_static)
+find_library(OGG_LIBRARY NAMES ogg ogg_static libogg libogg_static)
+
+# Handle the QUIETLY and REQUIRED arguments and set FLAC_FOUND to TRUE if
+# all listed variables are TRUE.
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(FLAC DEFAULT_MSG
+ FLAC_INCLUDE_DIR OGG_LIBRARY FLAC_LIBRARY)
+
+if(FLAC_FOUND)
+ set(FLAC_LIBRARIES ${FLAC_LIBRARY} ${OGG_LIBRARY})
+ if(WIN32)
+ set(FLAC_LIBRARIES ${FLAC_LIBRARIES} wsock32)
+ endif(WIN32)
+else(FLAC_FOUND)
+ set(FLAC_LIBRARIES)
+endif(FLAC_FOUND)
+
+mark_as_advanced(FLAC_INCLUDE_DIR FLAC_LIBRARY)
diff --git a/cmake/FindOggVorbis.cmake b/cmake/FindOggVorbis.cmake
new file mode 100644
index 0000000..e72d849
--- /dev/null
+++ b/cmake/FindOggVorbis.cmake
@@ -0,0 +1,89 @@
+# - Try to find the OggVorbis libraries
+# Once done this will define
+#
+# OGGVORBIS_FOUND - system has OggVorbis
+# OGGVORBIS_VERSION - set either to 1 or 2
+# OGGVORBIS_INCLUDE_DIR - the OggVorbis include directory
+# OGGVORBIS_LIBRARIES - The libraries needed to use OggVorbis
+# OGG_LIBRARY - The Ogg library
+# VORBIS_LIBRARY - The Vorbis library
+# VORBISFILE_LIBRARY - The VorbisFile library
+# VORBISENC_LIBRARY - The VorbisEnc library
+
+# Copyright (c) 2006, Richard Laerkaeng, <richard@goteborg.utfors.se>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+include (CheckLibraryExists)
+
+find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
+find_path(OGG_INCLUDE_DIR ogg/ogg.h)
+
+find_library(OGG_LIBRARY NAMES ogg)
+find_library(VORBIS_LIBRARY NAMES vorbis)
+find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
+find_library(VORBISENC_LIBRARY NAMES vorbisenc)
+
+mark_as_advanced(VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR
+ OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY)
+
+
+if (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
+ set(OGGVORBIS_FOUND TRUE)
+
+ set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBISENC_LIBRARY})
+
+ set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES})
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OGGVORBIS_LIBRARIES})
+ check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
+ set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_TMP})
+
+ if (HAVE_LIBVORBISENC2)
+ set (OGGVORBIS_VERSION 2)
+ else (HAVE_LIBVORBISENC2)
+ set (OGGVORBIS_VERSION 1)
+ endif (HAVE_LIBVORBISENC2)
+
+else (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
+ set (OGGVORBIS_VERSION)
+ set(OGGVORBIS_FOUND FALSE)
+endif (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
+
+
+if (OGGVORBIS_FOUND)
+ if (NOT OggVorbis_FIND_QUIETLY)
+ message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}")
+ endif (NOT OggVorbis_FIND_QUIETLY)
+else (OGGVORBIS_FOUND)
+ if (OggVorbis_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find OggVorbis libraries")
+ endif (OggVorbis_FIND_REQUIRED)
+ if (NOT OggVorbis_FIND_QUITELY)
+ message(STATUS "Could NOT find OggVorbis libraries")
+ endif (NOT OggVorbis_FIND_QUITELY)
+endif (OGGVORBIS_FOUND)
+
+#check_include_files(vorbis/vorbisfile.h HAVE_VORBISFILE_H)
+#check_library_exists(ogg ogg_page_version "" HAVE_LIBOGG)
+#check_library_exists(vorbis vorbis_info_init "" HAVE_LIBVORBIS)
+#check_library_exists(vorbisfile ov_open "" HAVE_LIBVORBISFILE)
+#check_library_exists(vorbisenc vorbis_info_clear "" HAVE_LIBVORBISENC)
+#check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
+
+#if (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
+# message(STATUS "Ogg/Vorbis found")
+# set (VORBIS_LIBS "-lvorbis -logg")
+# set (VORBISFILE_LIBS "-lvorbisfile")
+# set (VORBISENC_LIBS "-lvorbisenc")
+# set (OGGVORBIS_FOUND TRUE)
+# if (HAVE_LIBVORBISENC2)
+# set (HAVE_VORBIS 2)
+# else (HAVE_LIBVORBISENC2)
+# set (HAVE_VORBIS 1)
+# endif (HAVE_LIBVORBISENC2)
+#else (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
+# message(STATUS "Ogg/Vorbis not found")
+#endif (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
+
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index f583a2a..b0276bf 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -1,4 +1,3 @@
-
install(FILES
audiocd.desktop
DESTINATION ${DATA_INSTALL_DIR}/konqsidebartng/virtual_folders/services)
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 12819c6..6bca803 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,2 +1,2 @@
########### install files ###############
-kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kioslave/audiocd)
+kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kioslave/audiocd)
diff --git a/kcmaudiocd/CMakeLists.txt b/kcmaudiocd/CMakeLists.txt
index 35b8be3..de7caeb 100644
--- a/kcmaudiocd/CMakeLists.txt
+++ b/kcmaudiocd/CMakeLists.txt
@@ -1,26 +1,24 @@
-
include_directories(
- ${CMAKE_SOURCE_DIR}/libkcddb
- ${CMAKE_CURRENT_SOURCE_DIR}/../plugins
- ${CMAKE_BINARY_DIR}/kioslave/audiocd/kcmaudiocd )
+ ${CMAKE_CURRENT_SOURCE_DIR}/../plugins
+ ${CMAKE_BINARY_DIR}/kioslave/audiocd/kcmaudiocd
+)
########### next target ###############
-set(kcm_audiocd_PART_SRCS kcmaudiocd.cpp )
-
-
-kde4_add_ui_files(kcm_audiocd_PART_SRCS audiocdconfig.ui )
-
-kde4_add_plugin(kcm_audiocd ${kcm_audiocd_PART_SRCS})
-
+set(kcm_audiocd_PART_SRCS kcmaudiocd.cpp)
+qt5_wrap_ui(kcm_audiocd_PART_SRCS audiocdconfig.ui)
-target_link_libraries(kcm_audiocd audiocdplugins ${KDE4_KDEUI_LIBS} )
+add_library(kcm_audiocd ${kcm_audiocd_PART_SRCS})
-install(TARGETS kcm_audiocd DESTINATION ${PLUGIN_INSTALL_DIR} )
+target_link_libraries(kcm_audiocd
+ KF5::KDELibs4Support
+ audiocdplugins
+)
+install(TARGETS kcm_audiocd DESTINATION ${PLUGIN_INSTALL_DIR})
########### install files ###############
-install( FILES audiocd.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+install(FILES audiocd.desktop DESTINATION ${SERVICES_INSTALL_DIR})
diff --git a/kcmaudiocd/kcmaudiocd.cpp b/kcmaudiocd/kcmaudiocd.cpp
index 3277112..923f4f9 100644
--- a/kcmaudiocd/kcmaudiocd.cpp
+++ b/kcmaudiocd/kcmaudiocd.cpp
@@ -17,6 +17,9 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include "kcmaudiocd.h"
+#include "audiocdplugins_version.h"
+
#include <kconfig.h>
#include <klineedit.h>
#include <klocale.h>
@@ -32,19 +35,18 @@
#include <kdialog.h>
#include <audiocdencoder.h>
-#include "kcmaudiocd.moc"
#include <kconfigdialogmanager.h>
#include <kconfiggroup.h>
#include <KPluginFactory>
#include <KPluginLoader>
-K_PLUGIN_FACTORY(KAudiocdFactory,
+K_PLUGIN_FACTORY(Factory,
registerPlugin<KAudiocdModule>();
)
-K_EXPORT_PLUGIN(KAudiocdFactory("kcmaudiocd"))
+K_EXPORT_PLUGIN(Factory("kcmaudiocd"))
KAudiocdModule::KAudiocdModule(QWidget *parent, const QVariantList &lst)
- : KCModule(KAudiocdFactory::componentData(), parent, lst), configChanged(false)
+ : KCModule(parent), configChanged(false)
{
QVBoxLayout *box = new QVBoxLayout(this);
@@ -96,12 +98,10 @@ KAudiocdModule::KAudiocdModule(QWidget *parent, const QVariantList &lst)
KAboutData *about =
- new KAboutData(I18N_NOOP("kcmaudiocd"), 0, ki18n("KDE Audio CD IO Slave"),
- 0, KLocalizedString(), KAboutData::License_GPL,
- ki18n("(c) 2000 - 2005 Audio CD developers"));
+ new KAboutData("kcmaudiocd", i18n("KDE Audio CD IO Slave"), AUDIOCDPLUGINS_VERSION_STRING);
- about->addAuthor(ki18n("Benjamin C. Meyer"), ki18n("Former Maintainer"), "ben@meyerhome.net");
- about->addAuthor(ki18n("Carsten Duvenhorst"), KLocalizedString(), "duvenhorst@duvnet.de");
+ about->addAuthor(i18n("Benjamin C. Meyer"), i18n("Former Maintainer"), "ben@meyerhome.net");
+ about->addAuthor(i18n("Carsten Duvenhorst"), i18n("Original Author"), "duvenhorst@duvnet.de");
setAboutData(about);
}
@@ -271,3 +271,4 @@ QString KAudiocdModule::quickHelp() const
" version of the LAME or Ogg Vorbis libraries.");
}
+#include "kcmaudiocd.moc"
diff --git a/kcmaudiocd/kcmaudiocd.h b/kcmaudiocd/kcmaudiocd.h
index b0768f9..0535bb9 100644
--- a/kcmaudiocd/kcmaudiocd.h
+++ b/kcmaudiocd/kcmaudiocd.h
@@ -26,9 +26,10 @@
#ifndef KCMAUDIOCD_H
#define KCMAUDIOCD_H
-//Added by qt3to4:
#include <QList>
#include <kcmodule.h>
+#include <KConfigCore/KConfig>
+
class KConfigDialogManager;
#include "ui_audiocdconfig.h"
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index 93cee46..4bbe3f8 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -1,38 +1,42 @@
-
-macro_optional_find_package(Flac)
-macro_log_feature(FLAC_FOUND "FLAC" "An encoder/decoder for the Free Lossless Audio Codec" "http://flac.sourceforge.net" FALSE "" "Required to build the AudioCD FLAC plugin.")
-
-if (FLAC_FOUND)
- add_subdirectory( flac )
+find_package(FLAC)
+if(FLAC_FOUND)
+ add_subdirectory(flac)
endif(FLAC_FOUND)
-macro_optional_find_package(OggVorbis)
-macro_log_feature(OGGVORBIS_FOUND "OggVorbis" "Libraries for Ogg Vorbis general audio compression codec" "http://www.xiph.org" FALSE "" "Required for the AudioCD Ogg Vorbis plugin.")
-
-if (OGGVORBIS_FOUND AND HAVE_LIBVORBISENC2)
- add_subdirectory( vorbis )
+find_package(OggVorbis)
+if(OGGVORBIS_FOUND AND HAVE_LIBVORBISENC2)
+ add_subdirectory(vorbis)
endif(OGGVORBIS_FOUND AND HAVE_LIBVORBISENC2)
-add_subdirectory( wav )
-add_subdirectory( lame )
-
-include_directories( ${LIBKCDDB_INCLUDE_DIRS} )
-
+add_subdirectory(wav)
+add_subdirectory(lame)
########### next target ###############
-set(audiocdplugins_LIB_SRCS audiocdencoder.cpp )
+set(audiocdplugins_LIB_SRCS audiocdencoder.cpp)
+add_library(audiocdplugins SHARED ${audiocdplugins_LIB_SRCS})
-kde4_add_library(audiocdplugins SHARED ${audiocdplugins_LIB_SRCS})
+target_link_libraries(audiocdplugins
+ KF5::KDELibs4Support
+ KF5::Cddb
+ KF5::KIOCore
+)
-target_link_libraries(audiocdplugins ${KDE4_KDECORE_LIBS} ${LIBKCDDB_LIBRARIES} )
+generate_export_header(audiocdplugins
+ EXPORT_MACRO_NAME AUDIOCDPLUGINS_EXPORT
+ DEPRECATED_MACRO_NAME AUDIOCDPLUGINS_EXPORT_DEPRECATED
+ EXPORT_FILE_NAME audiocdplugins_export.h
+)
-set_target_properties(audiocdplugins PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
-install(TARGETS audiocdplugins ${INSTALL_TARGETS_DEFAULT_ARGS} )
+set_target_properties(audiocdplugins
+ PROPERTIES VERSION ${AUDIOCDPLUGINS_VERSION_STRING}
+ SOVERSION ${AUDIOCDPLUGINS_SOVERSION}
+)
+install(TARGETS audiocdplugins ${INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
-install( FILES audiocdencoder.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/audiocdplugins_export.h audiocdencoder.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)
diff --git a/plugins/audiocdencoder.h b/plugins/audiocdencoder.h
index 1d5fab1..9e0c5b1 100644
--- a/plugins/audiocdencoder.h
+++ b/plugins/audiocdencoder.h
@@ -19,16 +19,18 @@
#ifndef AUDIOCD_ENCODER_H
#define AUDIOCD_ENCODER_H
+#include "audiocdplugins_export.h"
+
#include <sys/types.h>
#include <kio/slavebase.h>
#include <QtCore/QList>
-#include <libkcddb/cdinfo.h>
+#include <KCddb/Cdinfo>
class KConfigSkeleton;
using namespace KCDDB;
-class KDE_EXPORT AudioCDEncoder {
+class AUDIOCDPLUGINS_EXPORT AudioCDEncoder {
public:
/**
diff --git a/plugins/flac/CMakeLists.txt b/plugins/flac/CMakeLists.txt
index 100f191..73bfc9e 100644
--- a/plugins/flac/CMakeLists.txt
+++ b/plugins/flac/CMakeLists.txt
@@ -1,6 +1,4 @@
-
-include_directories( ${LIBKCDDB_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/.. ${FLAC_INCLUDE_DIR} )
-
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/.. ${FLAC_INCLUDE_DIR} )
########### next target ###############
@@ -9,17 +7,20 @@ add_definitions(-DHAVE_LIBFLAC)
set(audiocd_encoder_flac_PART_SRCS encoderflac.cpp )
-kde4_add_ui_files(audiocd_encoder_flac_PART_SRCS encoderflacconfig.ui)
-
-kde4_add_kcfg_files(audiocd_encoder_flac_PART_SRCS audiocd_flac_encoder.kcfgc)
-
-kde4_add_plugin(audiocd_encoder_flac WITH_PREFIX ${audiocd_encoder_flac_PART_SRCS})
+qt5_wrap_ui(audiocd_encoder_flac_PART_SRCS encoderflacconfig.ui)
+kconfig_add_kcfg_files(audiocd_encoder_flac_PART_SRCS audiocd_flac_encoder.kcfgc)
+add_library(audiocd_encoder_flac ${audiocd_encoder_flac_PART_SRCS})
+set_target_properties(audiocd_encoder_flac PROPERTIES PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
-target_link_libraries(audiocd_encoder_flac ${FLAC_LIBRARIES} ${KDE4_KIO_LIBS} ${LIBKCDDB_LIBRARIES} audiocdplugins)
+target_link_libraries(audiocd_encoder_flac
+ ${FLAC_LIBRARIES}
+ KF5::Cddb
+ audiocdplugins
+)
-install(TARGETS audiocd_encoder_flac DESTINATION ${PLUGIN_INSTALL_DIR} )
+install(TARGETS audiocd_encoder_flac DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES audiocd_flac_encoder.kcfg DESTINATION ${KCFG_INSTALL_DIR})
diff --git a/plugins/flac/encoderflac.cpp b/plugins/flac/encoderflac.cpp
index 88588a2..f04cea2 100644
--- a/plugins/flac/encoderflac.cpp
+++ b/plugins/flac/encoderflac.cpp
@@ -37,7 +37,7 @@
extern "C"
{
- KDE_EXPORT void create_audiocd_encoders(KIO::SlaveBase *slave, QList<AudioCDEncoder*> &encoders)
+ AUDIOCDPLUGINS_EXPORT void create_audiocd_encoders(KIO::SlaveBase *slave, QList<AudioCDEncoder*> &encoders)
{
encoders.append(new EncoderFLAC(slave));
}
@@ -120,7 +120,8 @@ QWidget* EncoderFLAC::getConfigureWidget(KConfigSkeleton** manager) const {
return NULL;
#else
(*manager) = Settings::self();
- KGlobal::locale()->insertCatalog( QLatin1String( "audiocd_encoder_flac" ));
+ // TODO: https://community.kde.org/Frameworks/Porting_Notes
+ //KGlobal::locale()->insertCatalog( QLatin1String( "audiocd_encoder_flac" ));
return new EncoderFLACConfig();
#endif
}
diff --git a/plugins/lame/CMakeLists.txt b/plugins/lame/CMakeLists.txt
index 09ccf83..b378423 100644
--- a/plugins/lame/CMakeLists.txt
+++ b/plugins/lame/CMakeLists.txt
@@ -1,8 +1,6 @@
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
-include_directories( ${LIBKCDDB_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/.. )
-
-FIND_PROGRAM(LAME_EXECUTABLE NAMES lame
-)
+FIND_PROGRAM(LAME_EXECUTABLE NAMES lame)
if(NOT LAME_EXECUTABLE)
MESSAGE(STATUS "\"lame\" binary not found. Plugins will be compile but install it under your system to using this plugins")
@@ -12,21 +10,21 @@ endif(NOT LAME_EXECUTABLE)
set(audiocd_encoder_lame_PART_SRCS encoderlame.cpp )
+qt5_wrap_ui(audiocd_encoder_lame_PART_SRCS encoderlameconfig.ui)
-kde4_add_ui_files(audiocd_encoder_lame_PART_SRCS encoderlameconfig.ui )
-
-kde4_add_kcfg_files(audiocd_encoder_lame_PART_SRCS audiocd_lame_encoder.kcfgc )
-
-kde4_add_plugin(audiocd_encoder_lame WITH_PREFIX ${audiocd_encoder_lame_PART_SRCS})
+kconfig_add_kcfg_files(audiocd_encoder_lame_PART_SRCS audiocd_lame_encoder.kcfgc)
+add_library(audiocd_encoder_lame ${audiocd_encoder_lame_PART_SRCS})
+set_target_properties(audiocd_encoder_lame PROPERTIES PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
+target_link_libraries(audiocd_encoder_lame
+ KF5::Cddb
+ audiocdplugins
+)
-target_link_libraries(audiocd_encoder_lame ${KDE4_KIO_LIBS} ${LIBKCDDB_LIBRARIES} audiocdplugins)
-
-install(TARGETS audiocd_encoder_lame DESTINATION ${PLUGIN_INSTALL_DIR} )
-
+install(TARGETS audiocd_encoder_lame DESTINATION ${PLUGIN_INSTALL_DIR})
########### install files ###############
-install( FILES audiocd_lame_encoder.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
+install(FILES audiocd_lame_encoder.kcfg DESTINATION ${KCFG_INSTALL_DIR})
diff --git a/plugins/lame/encoderlame.cpp b/plugins/lame/encoderlame.cpp
index 48d1614..7b93bc9 100644
--- a/plugins/lame/encoderlame.cpp
+++ b/plugins/lame/encoderlame.cpp
@@ -34,7 +34,7 @@
extern "C"
{
- KDE_EXPORT void create_audiocd_encoders(KIO::SlaveBase *slave, QList<AudioCDEncoder*> &encoders) {
+ AUDIOCDPLUGINS_EXPORT void create_audiocd_encoders(KIO::SlaveBase *slave, QList<AudioCDEncoder*> &encoders) {
encoders.append(new EncoderLame(slave));
}
}
@@ -87,7 +87,7 @@ bool EncoderLame::init(){
proc.execute();
if(proc.exitStatus() != QProcess::NormalExit)
- return FALSE;
+ return false;
QByteArray array = proc.readAll();
QString str = QString::fromLocal8Bit( array );
diff --git a/plugins/vorbis/CMakeLists.txt b/plugins/vorbis/CMakeLists.txt
index a4f9a70..fad3845 100644
--- a/plugins/vorbis/CMakeLists.txt
+++ b/plugins/vorbis/CMakeLists.txt
@@ -1,26 +1,25 @@
-
-include_directories( ${LIBKCDDB_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/.. ${OGGVORBIS_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR})
-
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/.. ${OGGVORBIS_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR})
########### next target ###############
-set(audiocd_encoder_vorbis_PART_SRCS encodervorbis.cpp )
-
-
-kde4_add_ui_files(audiocd_encoder_vorbis_PART_SRCS encodervorbisconfig.ui )
-
-kde4_add_kcfg_files(audiocd_encoder_vorbis_PART_SRCS audiocd_vorbis_encoder.kcfgc )
-
-kde4_add_plugin(audiocd_encoder_vorbis WITH_PREFIX ${audiocd_encoder_vorbis_PART_SRCS})
+set(audiocd_encoder_vorbis_PART_SRCS encodervorbis.cpp)
+qt5_wrap_ui(audiocd_encoder_vorbis_PART_SRCS encodervorbisconfig.ui)
+kconfig_add_kcfg_files(audiocd_encoder_vorbis_PART_SRCS audiocd_vorbis_encoder.kcfgc)
-target_link_libraries(audiocd_encoder_vorbis ${OGGVORBIS_LIBRARIES} ${KDE4_KIO_LIBS} ${LIBKCDDB_LIBRARIES} audiocdplugins)
+add_library(audiocd_encoder_vorbis ${audiocd_encoder_vorbis_PART_SRCS})
+set_target_properties(audiocd_encoder_vorbis PROPERTIES PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
-install(TARGETS audiocd_encoder_vorbis DESTINATION ${PLUGIN_INSTALL_DIR} )
+target_link_libraries(audiocd_encoder_vorbis
+ ${OGGVORBIS_LIBRARIES}
+ KF5::Cddb
+ audiocdplugins
+)
+install(TARGETS audiocd_encoder_vorbis DESTINATION ${PLUGIN_INSTALL_DIR})
########### install files ###############
-install( FILES audiocd_vorbis_encoder.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
+install(FILES audiocd_vorbis_encoder.kcfg DESTINATION ${KCFG_INSTALL_DIR})
diff --git a/plugins/vorbis/encodervorbis.cpp b/plugins/vorbis/encodervorbis.cpp
index b293485..5e02eb9 100644
--- a/plugins/vorbis/encodervorbis.cpp
+++ b/plugins/vorbis/encodervorbis.cpp
@@ -37,7 +37,7 @@
extern "C"
{
- KDE_EXPORT void create_audiocd_encoders(KIO::SlaveBase *slave, QList<AudioCDEncoder*> &encoders)
+ AUDIOCDPLUGINS_EXPORT void create_audiocd_encoders(KIO::SlaveBase *slave, QList<AudioCDEncoder*> &encoders)
{
encoders.append(new EncoderVorbis(slave));
}
diff --git a/plugins/wav/CMakeLists.txt b/plugins/wav/CMakeLists.txt
index c4729b2..9a71f32 100644
--- a/plugins/wav/CMakeLists.txt
+++ b/plugins/wav/CMakeLists.txt
@@ -1,17 +1,15 @@
-
-include_directories( ${LIBKCDDB_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CDPARANOIA_INCLUDE_DIR} )
-
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CDPARANOIA_INCLUDE_DIR})
########### next target ###############
-set(audiocd_encoder_wav_PART_SRCS encoderwav.cpp encodercda.cpp )
-
-
-kde4_add_plugin(audiocd_encoder_wav WITH_PREFIX ${audiocd_encoder_wav_PART_SRCS})
-
+set(audiocd_encoder_wav_PART_SRCS encoderwav.cpp encodercda.cpp)
+add_library(audiocd_encoder_wav ${audiocd_encoder_wav_PART_SRCS})
+set_target_properties(audiocd_encoder_wav PROPERTIES PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
-target_link_libraries(audiocd_encoder_wav ${KDE4_KIO_LIBS} audiocdplugins )
+target_link_libraries(audiocd_encoder_wav
+ audiocdplugins
+)
-install(TARGETS audiocd_encoder_wav DESTINATION ${PLUGIN_INSTALL_DIR} )
+install(TARGETS audiocd_encoder_wav DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/plugins/wav/encoderwav.cpp b/plugins/wav/encoderwav.cpp
index ecf01ed..5394c6e 100644
--- a/plugins/wav/encoderwav.cpp
+++ b/plugins/wav/encoderwav.cpp
@@ -27,7 +27,7 @@
extern "C"
{
- KDE_EXPORT void create_audiocd_encoders(KIO::SlaveBase *slave, QList<AudioCDEncoder*> &encoders)
+ AUDIOCDPLUGINS_EXPORT void create_audiocd_encoders(KIO::SlaveBase *slave, QList<AudioCDEncoder*> &encoders)
{
encoders.append( new EncoderWav(slave));
encoders.append( new EncoderCda(slave));