Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 1e5a3a62 authored by Alexander Potashev's avatar Alexander Potashev

Start KF5-only branch

Get rid of variable KMIX_KF5_BUILD/X_KMIX_KF5_BUILD.
parent 38ff599c
......@@ -3,7 +3,7 @@ project(kmix)
# CMake build file for KMix. It supports both KDE4 and KF5.
#
# KDE4 support: complete
# KF5 support is in work. A build will be triggered by adding "-DKMIX_KF5_BUILD=1" to the cmake call.
# KF5 support is in work.
# Status: Build fails on kmixdevicemanager.cpp , which does #include <solid/audiointerface.h>
# Unfortunately Solid currently has no Audiointerface in KF5, thus it pulls the #include from
# KDE4, which leads to error: ‘AudioInterface’ is not a member of ‘Solid::DeviceInterface’
......@@ -15,13 +15,8 @@ if(POLICY CMP0046)
endif()
# Your project should require at least CMake 2.8.12 to use FindKF5.cmake
if (KMIX_KF5_BUILD)
cmake_minimum_required(VERSION 2.8.12)
add_definitions( -DX_KMIX_KF5_BUILD )
add_definitions( -DTRANSLATION_DOMAIN=\"kmix\" )
else ()
cmake_minimum_required(VERSION 2.8.11)
endif()
cmake_minimum_required(VERSION 2.8.12)
add_definitions( -DTRANSLATION_DOMAIN=\"kmix\" )
if(POLICY CMP0046)
cmake_policy (SET CMP0046 NEW)
......@@ -29,29 +24,24 @@ endif()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if (KMIX_KF5_BUILD)
find_package(ECM 5.10.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
include(ECMPackageConfigHelpers)
find_package(KF5 REQUIRED COMPONENTS
GlobalAccel
I18n
XmlGui
DBusAddons
KCMUtils
KDELibs4Support)
find_package(KF5ConfigWidgets)
find_package(KF5IconThemes)
else()
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
endif()
find_package(ECM 5.10.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
include(ECMPackageConfigHelpers)
find_package(KF5 REQUIRED COMPONENTS
GlobalAccel
I18n
XmlGui
DBusAddons
KCMUtils
KDELibs4Support
)
find_package(KF5ConfigWidgets)
find_package(KF5IconThemes)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
......@@ -59,24 +49,14 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
# Do not yet REQUIRE Phonon. Hint: As long as we do not find_package(), ${KDE4_PHONON_LIBS} will be empty below, but that should not hurt.
#find_package(Phonon REQUIRED)
# PulseAudio is an optional dependency
set(PA_VER "0.9.16")
if (KMIX_KF5_BUILD)
find_package(PulseAudio "${PA_VER}")
else()
macro_optional_find_package(PulseAudio "${PA_VER}")
macro_log_feature(PULSEAUDIO_FOUND "PulseAudio" "PulseAudio Audio Server"
"http://www.pulseaudio.org/" FALSE "${PA_VER}" "libpulse is needed to let KMix control PulseAudio")
endif()
find_package(PulseAudio "${PA_VER}")
find_package(GLIB2)
if (KMIX_KF5_BUILD)
find_package(Canberra)
else()
macro_optional_find_package(Canberra)
macro_log_feature(CANBERRA_FOUND "libcanberra" "libcanberra audio library"
"http://0pointer.de/lennart/projects/libcanberra/" FALSE "" "libcanberra is needed for kmix sound feedback")
endif()
# Canberra is an optional dependency
find_package(Canberra)
find_package(Alsa)
alsa_configure_file(${CMAKE_BINARY_DIR}/config-alsa.h)
......@@ -106,12 +86,7 @@ configure_file (config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
include_directories( ${GLIB2_INCLUDE_DIR} /usr/lib/oss/include)
if (KMIX_KF5_BUILD)
# TODO Add warning about porting kde4_create_handbook
message( WARNING, "Skipping doc directory due to missing kde4_create_handbook" )
else()
add_subdirectory( doc )
endif()
add_subdirectory(doc)
add_subdirectory( pics )
add_subdirectory( profiles )
......@@ -129,9 +104,6 @@ if (CANBERRA_FOUND)
include_directories(${CANBERRA_INCLUDE_DIRS})
endif (CANBERRA_FOUND)
#if (KMIX_KF5_BUILD)
# message( WARNING, "Skipping kmix_adaptor_SRCS due to missing qt4_add_dbus_adaptor ... KMix will NOT compile until this is fixed!!!" )
####################################################################################################
########### definitions: DBUSADAPTOR ###############################################################
......@@ -140,21 +112,12 @@ set(kmix_adaptor_SRCS
dbus/dbusmixerwrapper.cpp
dbus/dbusmixsetwrapper.cpp
dbus/dbuscontrolwrapper.cpp)
if (KMIX_KF5_BUILD)
qt5_add_dbus_adaptor( kmix_adaptor_SRCS dbus/org.kde.kmix.control.xml
dbus/dbuscontrolwrapper.h DBusControlWrapper )
qt5_add_dbus_adaptor( kmix_adaptor_SRCS dbus/org.kde.kmix.mixer.xml
dbus/dbusmixerwrapper.h DBusMixerWrapper )
qt5_add_dbus_adaptor( kmix_adaptor_SRCS dbus/org.kde.kmix.mixset.xml
dbus/dbusmixsetwrapper.h DBusMixSetWrapper )
else()
qt4_add_dbus_adaptor( kmix_adaptor_SRCS dbus/org.kde.kmix.control.xml
dbus/dbuscontrolwrapper.h DBusControlWrapper )
qt4_add_dbus_adaptor( kmix_adaptor_SRCS dbus/org.kde.kmix.mixer.xml
dbus/dbusmixerwrapper.h DBusMixerWrapper )
qt4_add_dbus_adaptor( kmix_adaptor_SRCS dbus/org.kde.kmix.mixset.xml
dbus/dbusmixsetwrapper.h DBusMixSetWrapper )
endif()
####################################################################################################
......@@ -181,10 +144,6 @@ endif (PULSEAUDIO_FOUND)
########### next target : kmix #####################################################################
####################################################################################################
if (NOT KMIX_KF5_BUILD)
set( kmix_OSD_SRCS gui/osdwidget.cpp )
endif()
set(kmix_KDEINIT_SRCS ${kmix_adaptor_SRCS} ${kmix_backend_SRCS}
apps/main.cpp
apps/kmix.cpp
......@@ -223,13 +182,21 @@ set(kmix_KDEINIT_SRCS ${kmix_adaptor_SRCS} ${kmix_backend_SRCS}
core/volume.cpp
)
if (KMIX_KF5_BUILD)
kf5_add_kdeinit_executable( kmix ${kmix_KDEINIT_SRCS})
target_link_libraries(kdeinit_kmix KF5::I18n KF5::ConfigCore KF5::ConfigGui KF5::ConfigWidgets KF5::IconThemes KF5::GlobalAccel KF5::KDELibs4Support Qt5::Core Qt5::Widgets Qt5::DBus Qt5::Xml)
else()
kde4_add_kdeinit_executable( kmix ${kmix_KDEINIT_SRCS})
target_link_libraries(kdeinit_kmix ${KDE4_SOLID_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ${QT_QTXML_LIBRARY} ${KDE4_PHONON_LIBS})
endif()
kf5_add_kdeinit_executable(kmix ${kmix_KDEINIT_SRCS})
target_link_libraries(kdeinit_kmix
KF5::I18n
KF5::ConfigCore
KF5::ConfigGui
KF5::ConfigWidgets
KF5::IconThemes
KF5::GlobalAccel
KF5::KDELibs4Support
Qt5::Core
Qt5::Widgets
Qt5::DBus
Qt5::Xml
)
if (HAVE_LIBASOUND2)
......@@ -273,30 +240,25 @@ install(TARGETS kmix ${INSTALL_TARGETS_DEFAULT_ARGS} )
#qt4_add_dbus_adaptor(kded_kmixd_SRCS org.kde.KMixD.xml kmixd.h Mixer)
if (KMIX_KF5_BUILD)
add_library(kded_kmixd ${kded_kmixd_SRCS})
else()
kde4_add_plugin(kded_kmixd ${kded_kmixd_SRCS})
endif()
add_library(kded_kmixd ${kded_kmixd_SRCS})
if (KMIX_KF5_BUILD)
target_link_libraries(kded_kmixd
KF5::I18n
KF5::ConfigCore
KF5::ConfigGui
KF5::Solid
KF5::KDELibs4Support
KF5::DBusAddons
Qt5::Core
Qt5::Widgets
Qt5::DBus
Qt5::Xml
${KDEx_KDEUI_LIBS}
${KDEx_PHONON_LIBS})
else()
target_link_libraries(kded_kmixd ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ${QT_QTXML_LIBRARY} ${KDE4_PHONON_LIBS})
endif()
target_link_libraries(kded_kmixd
KF5::I18n
KF5::ConfigCore
KF5::ConfigGui
KF5::Solid
KF5::KDELibs4Support
KF5::DBusAddons
Qt5::Core
Qt5::Widgets
Qt5::DBus
Qt5::Xml
${KDEx_KDEUI_LIBS}
${KDEx_PHONON_LIBS}
)
if (HAVE_LIBASOUND2)
......@@ -344,14 +306,15 @@ set(kmixctrl_KDEINIT_SRCS ${kmix_adaptor_SRCS} ${kmix_backend_SRCS}
# gui/guiprofile.cpp
if (KMIX_KF5_BUILD)
KF5_ADD_KDEINIT_EXECUTABLE( kmixctrl ${kmixctrl_KDEINIT_SRCS})
target_link_libraries(kdeinit_kmixctrl KF5::I18n KF5::ConfigCore KF5::KDELibs4Support Qt5::Core )
#Qt5::DBus Qt5::Xml)
else()
kde4_add_kdeinit_executable( kmixctrl ${kmixctrl_KDEINIT_SRCS})
target_link_libraries(kdeinit_kmixctrl ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ${QT_QTXML_LIBRARY} ${KDE4_PHONON_LIBS})
endif()
KF5_ADD_KDEINIT_EXECUTABLE(kmixctrl ${kmixctrl_KDEINIT_SRCS})
target_link_libraries(kdeinit_kmixctrl
KF5::I18n
KF5::ConfigCore
KF5::KDELibs4Support
Qt5::Core
#Qt5::DBus Qt5::Xml
)
target_link_libraries(kdeinit_kmixctrl ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ${QT_QTXML_LIBRARY} ${KDE4_PHONON_LIBS})
......@@ -368,10 +331,7 @@ if (CANBERRA_FOUND)
endif (CANBERRA_FOUND)
########### next target ###############
if (!KMIX_KF5_BUILD)
add_subdirectory( plasma )
endif()
# add_subdirectory( plasma )
####################################################################################################
......@@ -386,18 +346,10 @@ install( PROGRAMS kmix.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( PROGRAMS apps/kmixremote DESTINATION ${BIN_INSTALL_DIR} )
install( FILES restore_kmix_volumes.desktop DESTINATION ${AUTOSTART_INSTALL_DIR})
install( FILES kmix_autostart.desktop DESTINATION ${AUTOSTART_INSTALL_DIR})
if (KMIX_KF5_BUILD)
install( FILES kmixui.rc DESTINATION ${DATA_INSTALL_DIR}/kmix )
else()
install( FILES kmixui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kmix)
endif()
install( FILES kmixui.rc DESTINATION ${DATA_INSTALL_DIR}/kmix )
install( FILES kmixctrl_restore.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES dbus/org.kde.kmix.control.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )
install( FILES dbus/org.kde.kmix.mixer.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )
install( FILES dbus/org.kde.kmix.mixset.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )
if (KMIX_KF5_BUILD)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
else()
macro_display_feature_log()
endif()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -67,22 +67,9 @@
#include "gui/dialogaddview.h"
#include "gui/dialogselectmaster.h"
#include "dbus/dbusmixsetwrapper.h"
#ifdef X_KMIX_KF5_BUILD
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusPendingCall>
#else
#include "gui/osdwidget.h"
#endif
#ifdef X_KMIX_KF5_BUILD
#define CLASS_Action QAction
#include <QKeySequence>
#define CLASS_KShortcut QKeySequence
#else
#define CLASS_Action KAction
#define CLASS_KShortcut KShortcut
#define QStringLiteral QLatin1String
#endif
/* KMixWindow
* Constructs a mixer window (KMix main window)
......@@ -143,9 +130,7 @@ KMixWindow::~KMixWindow()
ControlManager::instance().removeListener(this);
delete m_dsm;
#ifndef X_KMIX_KF5_BUILD
delete osdWidget;
#endif
// -1- Cleanup Memory: clearMixerWidgets
while (m_wsMixers->count() != 0)
{
......@@ -197,7 +182,7 @@ void KMixWindow::initActions()
//actionCollection()->addAction(QStringLiteral( a->objectName()), a );
KStandardAction::preferences(this, SLOT(showSettings()), actionCollection());
KStandardAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), actionCollection());
CLASS_Action* action = actionCollection()->addAction(QStringLiteral("launch_kdesoundsetup"));
QAction* action = actionCollection()->addAction(QStringLiteral("launch_kdesoundsetup"));
action->setText(i18n("Audio Setup"));
connect(action, SIGNAL(triggered(bool)), SLOT(slotKdeAudioSetupExec()));
......@@ -216,49 +201,45 @@ void KMixWindow::initActions()
connect(action, SIGNAL(triggered(bool)), SLOT(slotSelectMaster()));
action = actionCollection()->addAction(QStringLiteral("save_1"));
action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_1));
action->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_1));
action->setText(i18n("Save volume profile 1"));
connect(action, SIGNAL(triggered(bool)), SLOT(saveVolumes1()));
action = actionCollection()->addAction(QStringLiteral("save_2"));
action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_2));
action->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_2));
action->setText(i18n("Save volume profile 2"));
connect(action, SIGNAL(triggered(bool)), SLOT(saveVolumes2()));
action = actionCollection()->addAction(QStringLiteral("save_3"));
action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_3));
action->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_3));
action->setText(i18n("Save volume profile 3"));
connect(action, SIGNAL(triggered(bool)), SLOT(saveVolumes3()));
action = actionCollection()->addAction(QStringLiteral("save_4"));
action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_4));
action->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_4));
action->setText(i18n("Save volume profile 4"));
connect(action, SIGNAL(triggered(bool)), SLOT(saveVolumes4()));
action = actionCollection()->addAction(QStringLiteral("load_1"));
action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::Key_1));
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_1));
action->setText(i18n("Load volume profile 1"));
connect(action, SIGNAL(triggered(bool)), SLOT(loadVolumes1()));
action = actionCollection()->addAction(QStringLiteral("load_2"));
action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::Key_2));
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_2));
action->setText(i18n("Load volume profile 2"));
connect(action, SIGNAL(triggered(bool)), SLOT(loadVolumes2()));
action = actionCollection()->addAction(QStringLiteral("load_3"));
action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::Key_3));
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_3));
action->setText(i18n("Load volume profile 3"));
connect(action, SIGNAL(triggered(bool)), SLOT(loadVolumes3()));
action = actionCollection()->addAction(QStringLiteral("load_4"));
action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::Key_4));
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_4));
action->setText(i18n("Load volume profile 4"));
connect(action, SIGNAL(triggered(bool)), SLOT(loadVolumes4()));
#ifndef X_KMIX_KF5_BUILD
osdWidget = new OSDWidget();
#endif
createGUI(QLatin1String("kmixui.rc"));
}
......@@ -266,33 +247,21 @@ void KMixWindow::initActionsLate()
{
if (m_autouseMultimediaKeys)
{
CLASS_Action* globalAction = actionCollection()->addAction(QStringLiteral("increase_volume"));
QAction* globalAction = actionCollection()->addAction(QStringLiteral("increase_volume"));
globalAction->setText(i18n("Increase Volume"));
#ifdef X_KMIX_KF5_BUILD
KGlobalAccel::setGlobalShortcut(globalAction, Qt::Key_VolumeUp);
#else
globalAction->setGlobalShortcut(CLASS_KShortcut(Qt::Key_VolumeUp));
#endif
connect(globalAction, SIGNAL(triggered(bool)), SLOT(slotIncreaseVolume()));
globalAction = actionCollection()->addAction(QStringLiteral("decrease_volume"));
globalAction->setText(i18n("Decrease Volume"));
#ifdef X_KMIX_KF5_BUILD
KGlobalAccel::setGlobalShortcut(globalAction, Qt::Key_VolumeDown);
#else
globalAction->setGlobalShortcut(CLASS_KShortcut(Qt::Key_VolumeDown));
#endif
connect(globalAction, SIGNAL(triggered(bool)), SLOT(slotDecreaseVolume()));
globalAction = actionCollection()->addAction(QStringLiteral("mute"));
globalAction->setText(i18n("Mute"));
#ifdef X_KMIX_KF5_BUILD
KGlobalAccel::setGlobalShortcut(globalAction, Qt::Key_VolumeMute);
#else
globalAction->setGlobalShortcut(CLASS_KShortcut(Qt::Key_VolumeMute));
#endif
connect(globalAction, SIGNAL(triggered(bool)), SLOT(slotMute()));
}
}
......@@ -338,11 +307,7 @@ void KMixWindow::initWidgets()
void KMixWindow::setInitialSize()
{
#ifdef X_KMIX_KF5_BUILD
KConfigGroup config(KSharedConfig::openConfig(), "Global");
#else
KConfigGroup config(KGlobal::config(), "Global");
#endif
// HACK: QTabWidget will bound its sizeHint to 200x200 unless scrollbuttons
// are disabled, so we disable them, get a decent sizehint and enable them
......@@ -1149,7 +1114,6 @@ void KMixWindow::showVolumeDisplay()
if (md.get() == 0)
return; // shouldn't happen, but lets play safe
#ifdef X_KMIX_KF5_BUILD
if (GlobalConfig::instance().data.showOSD) {
QDBusMessage msg = QDBusMessage::createMethodCall(
"org.kde.plasmashell",
......@@ -1167,20 +1131,6 @@ void KMixWindow::showVolumeDisplay()
QDBusConnection::sessionBus().asyncCall(msg);
}
#else
if (GlobalConfig::instance().data.showOSD) {
// Setting volume not required here anymore, as the OSD updates it by itself
osdWidget->show();
osdWidget->activateOSD(); //Enable the hide timer
}
//Center the OSD
QRect rect = KApplication::kApplication()->desktop()->screenGeometry(QCursor::pos());
QSize size = osdWidget->sizeHint();
int posX = rect.x() + (rect.width() - size.width()) / 2;
int posY = rect.y() + 4 * rect.height() / 5;
osdWidget->setGeometry(posX, posY, size.width(), size.height());
#endif
}
/**
......@@ -1285,14 +1235,7 @@ void KMixWindow::slotHWInfo()
void KMixWindow::slotKdeAudioSetupExec()
{
QStringList args;
#ifdef X_KMIX_KF5_BUILD
args << "kcmshell5"
#else
args << "kcmshell4"
#endif
<< "kcm_phonon";
forkExec(args);
forkExec(QStringList() << "kcmshell5" << "kcm_phonon");
}
void KMixWindow::forkExec(const QStringList& args)
......
......@@ -49,9 +49,6 @@ class KMixWindow;
class Mixer;
#include "core/mixer.h"
#ifndef X_KMIX_KF5_BUILD
class OSDWidget;
#endif
class DialogSelectMaster;
class
......@@ -132,10 +129,6 @@ private:
void showVolumeDisplay();
void increaseOrDecreaseVolume(bool increase);
#ifndef X_KMIX_KF5_BUILD
OSDWidget* osdWidget;
#endif
bool addMixerWidget(const QString& mixer_ID, QString guiprofId, int insertPosition);
void setInitialSize();
......
......@@ -18,21 +18,13 @@
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//#ifndef KDE_VERSION_MAJOR
//#define X_KMIX_KF5_BUILD
//#endif
#include "core/mixertoolbox.h"
#include <kapplication.h>
#include <kcmdlineargs.h>
#ifdef X_KMIX_KF5_BUILD
#include <k4aboutdata.h>
#include <KLocalizedString>
#else
#include <kaboutdata.h>
#endif
#include <klocale.h>
#include <kglobal.h>
......@@ -49,30 +41,14 @@ static const char description[] =
I18N_NOOP("kmixctrl - kmix volume save/restore utility");
extern "C" int
#ifndef X_KMIX_KF5_BUILD
KDE_EXPORT
#else
Q_DECL_EXPORT
#endif
kdemain(int argc, char *argv[])
{
#ifdef X_KMIX_KF5_BUILD
KLocalizedString::setApplicationDomain("kmix");
#else
KLocale::setMainCatalog("kmix");
#endif
#ifdef X_KMIX_KF5_BUILD
#define CLASS_KAboutData K4AboutData
#else
#define CLASS_KAboutData KAboutData
#endif
CLASS_KAboutData aboutData( "kmixctrl", 0, ki18n("KMixCtrl"),
K4AboutData aboutData( "kmixctrl", 0, ki18n("KMixCtrl"),
APP_VERSION, ki18n(description),
CLASS_KAboutData::License_GPL,
K4AboutData::License_GPL,
ki18n("(c) 2000 by Stefan Schimanski"));
aboutData.addAuthor(ki18n("Stefan Schimanski"), KLocalizedString(), "1Stein@gmx.de");
......
......@@ -46,10 +46,6 @@
#include "core/mixer.h"
#include "core/version.h"
#ifndef X_KMIX_KF5_BUILD
#define QStringLiteral QLatin1String
#endif
K_PLUGIN_FACTORY(KMixDFactory,
registerPlugin<KMixD>();
......
......@@ -21,12 +21,8 @@
#include <kcmdlineargs.h>
#ifdef X_KMIX_KF5_BUILD
#include <k4aboutdata.h>
#include <KLocalizedString>
#else
#include <kaboutdata.h>
#endif
#include <kdebug.h>
#include <klocale.h>
......@@ -40,22 +36,12 @@ static const char description[] =
I18N_NOOP("KMix - KDE's full featured mini mixer");
extern "C" int
#ifndef X_KMIX_KF5_BUILD
KDE_EXPORT
#else
Q_DECL_EXPORT
#endif
kdemain(int argc, char *argv[])
{
#ifdef X_KMIX_KF5_BUILD
#define CLASS_KAboutData K4AboutData
#else
#define CLASS_KAboutData KAboutData
#endif
CLASS_KAboutData aboutData( "kmix", 0, ki18n("KMix"),
APP_VERSION, ki18n(description), CLASS_KAboutData::License_GPL,
ki18n("(c) 1996-2013 The KMix Authors"));
K4AboutData aboutData("kmix", 0, ki18n("KMix"),
APP_VERSION, ki18n(description), K4AboutData::License_GPL,
ki18n("(c) 1996-2013 The KMix Authors"));
// Author Policy: Long-term maintainers and backend writers/maintainers go in the Authors list.
aboutData.addAuthor(ki18n("Christian Esken") , ki18n("Original author and current maintainer"), "esken@kde.org");
......
......@@ -35,9 +35,6 @@
// Qt
#include <QList>
#ifndef X_KMIX_KF5_BUILD
#define QStringLiteral QLatin1String
#endif
// STD Headers
#include <stdlib.h>
......
......@@ -21,22 +21,18 @@
#include "core/kmixdevicemanager.h"
#include <kdebug.h>
#ifdef X_KMIX_KF5_BUILD
#ifdef __GNUC__
#warning KMix KF5 build does not support hotplugging yet
#endif
#endif
#include <iostream>
#include <QRegExp>
#include <QString>
#ifndef X_KMIX_KF5_BUILD
#include <solid/device.h>
#include <solid/devicenotifier.h>
#include <solid/audiointerface.h>
#endif
// #include <solid/device.h>
// #include <solid/devicenotifier.h>
// #include <solid/audiointerface.h>
KMixDeviceManager* KMixDeviceManager::s_KMixDeviceManager = 0;
......@@ -58,20 +54,18 @@ KMixDeviceManager* KMixDeviceManager::instance()
void KMixDeviceManager::initHotplug()
{
#ifndef X_KMIX_KF5_BUILD
connect (Solid::DeviceNotifier::instance(), SIGNAL(deviceAdded(QString)), SLOT(pluggedSlot(QString)) );
connect (Solid::DeviceNotifier::instance(), SIGNAL(deviceRemoved(QString)), SLOT(unpluggedSlot(QString)) );
#endif
// connect (Solid::DeviceNotifier::instance(), SIGNAL(deviceAdded(QString)), SLOT(pluggedSlot(QString)) );
// connect (Solid::DeviceNotifier::instance(), SIGNAL(deviceRemoved(QString)), SLOT(unpluggedSlot(QString)) );
}
QString KMixDeviceManager::getUDI_ALSA(int num)
{
#ifdef X_KMIX_KF5_BUILD
QString udi("hw%i");
udi.arg(num);
return udi;
#else
QList<Solid::Device> dl = Solid::Device::listFromType(Solid::DeviceInterface::AudioInterface);
#if 0
QList<Solid::Device> dl = Solid::Device::listFromType(Solid::DeviceInterface::AudioInterface);
QString numString;
numString.setNum(num);
......@@ -134,15 +128,15 @@ QString KMixDeviceManager::getUDI_ALSA(int num)
}
} // foreach
return udi;
#endif
#endif // 0
}
QString KMixDeviceManager::getUDI_OSS(const QString& devname)
{
#ifdef X_KMIX_KF5_BUILD
QString udi(devname);
return udi;
#else
#if 0
QList<Solid::Device> dl = Solid::Device::listFromType(Solid::DeviceInterface::AudioInterface);
bool found = false;
......@@ -170,15 +164,15 @@ QString KMixDeviceManager::getUDI_OSS(const QString& devname)
if ( found) break;
} // foreach
return udi;
#endif
#endif // 0
}
void KMixDeviceManager::pluggedSlot(const QString& udi) {
#ifdef X_KMIX_KF5_BUILD
return;
#else
void KMixDeviceManager::pluggedSlot(const QString& udi)
{
return;
#if 0
// std::cout << "Plugged udi='" << udi.toUtf8().data() << "'\n";
Solid::Device device(udi);
Solid::AudioInterface *audiohw = device.as<Solid::AudioInterface>();
......@@ -209,7 +203,7 @@ return;
break;
}
}
#endif
#endif // 0
}