Commit ae9a47e5 authored by Leslie Zhai's avatar Leslie Zhai
Browse files

Port to KF5 and test pass.

parent 87f30254
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})
......@@ -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();
......
......@@ -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,
......
# - 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)
# - 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)
install(FILES
audiocd.desktop
DESTINATION ${DATA_INSTALL_DIR}/konqsidebartng/virtual_folders/services)
......
########### 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)
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})
......@@ -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"
......@@ -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"
......
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)
......@@ -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:
/**
......
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})
......@@ -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
}
......
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 ###############