Hello community, here is the log from the commit of package kmix for openSUSE:Factory checked in at 2015-05-15 10:05:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kmix (Old) and /work/SRC/openSUSE:Factory/.kmix.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kmix" Changes: -------- --- /work/SRC/openSUSE:Factory/kmix/kmix.changes 2015-03-11 09:50:14.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.kmix.new/kmix.changes 2015-05-15 10:05:58.000000000 +0200 @@ -2,1962 +2 @@ -Tue Mar 3 10:40:40 UTC 2015 - [email protected] - -- Update to KDE Applications 14.12.3 - * KDE Applications 14.12.3 - * See https://www.kde.org/announcements/announce-applications-14.12.3.php - -------------------------------------------------------------------- -Fri Feb 6 08:47:26 UTC 2015 - [email protected] - -- Update to KDE Applications 14.12.2 - * KDE Applications 14.12.2 - * See https://www.kde.org/announcements/announce-applications-14.12.2.php - -------------------------------------------------------------------- -Sun Nov 23 04:49:00 UTC 2014 - Led <[email protected]> - -- fix bashisms in kmixremote script -- add patches: - * kmix-4.14.3-fix-bashisms.patch - -------------------------------------------------------------------- -Sun Nov 9 20:39:19 UTC 2014 - [email protected] - -- Update to 4.14.3 - * KDE 4.14.3 SC Bugfix Release - * See http://www.kde.org/announcements/announce-4.14.3.php - -------------------------------------------------------------------- -Sun Oct 12 12:08:43 UTC 2014 - [email protected] - -- Update to 4.14.2 - * KDE 4.14.2 SC Bugfix Release - * See http://www.kde.org/announcements/announce-4.14.2.php - -------------------------------------------------------------------- -Sat Sep 13 16:35:30 UTC 2014 - [email protected] - -- Update to 4.14.1 - * KDE 4.14.1 SC Bugfix Release - * See http://www.kde.org/announcements/announce-4.14.1.php - -------------------------------------------------------------------- -Fri Aug 15 08:36:30 UTC 2014 - [email protected] - -- Update to 4.14.0 - * KDE 4.14.0 SC Final Release - * See http://www.kde.org/announcements/4.14/ - -------------------------------------------------------------------- -Thu Jul 17 16:51:56 UTC 2014 - [email protected] - -- Update to 4.13.90 - * KDE 4.14 Beta 2 release - * See http://www.kde.org/announcements/announce-4.14-beta2.php - -------------------------------------------------------------------- -Thu Jul 10 22:19:34 UTC 2014 - [email protected] - -- Update to 4.13.80 - * KDE 4.14 Beta 1 release - * See http://www.kde.org/announcements/announce-4.14-beta1.php - -------------------------------------------------------------------- -Sun Jun 8 18:37:36 UTC 2014 - [email protected] - -- Update to 4.13.2 - * KDE 4.13 release - * See http://www.kde.org/announcements/announce-4.13.2.php - -------------------------------------------------------------------- -Fri May 9 16:49:43 UTC 2014 - [email protected] - -- Update to 4.13.1 - * KDE 4.13.1 bug fix release - * See http://www.kde.org/announcements/announce-4.13.1.php - -------------------------------------------------------------------- -Fri Apr 11 16:52:54 UTC 2014 - [email protected] - -- Update to 4.13.0 - * KDE 4.13 release - * See http://www.kde.org/announcements/4.13/ - -------------------------------------------------------------------- -Thu Mar 27 17:51:18 UTC 2014 - [email protected] - -- Update to 4.12.97 - * KDE 4.13 RC release - * See http://www.kde.org/announcements/announce-4.13-rc.php - -------------------------------------------------------------------- -Thu Mar 20 18:13:09 UTC 2014 - [email protected] - -- Update to 4.12.95 - * KDE 4.13 Beta 3 release - * See http://www.kde.org/announcements/announce-4.13-beta3.php - -------------------------------------------------------------------- -Thu Mar 13 20:19:55 UTC 2014 - [email protected] - -- Update to 4.12.90 - * KDE 4.13 Beta 2 release - * See http://www.kde.org/announcements/announce-4.13-beta2.php - -------------------------------------------------------------------- -Fri Mar 7 10:12:12 UTC 2014 - [email protected] - -- Update to 4.12.80 - * KDE 4.13 Beta 1 release - * See http://www.kde.org/announcements/announce-4.13-beta1.php - -------------------------------------------------------------------- -Sat Feb 1 10:16:36 UTC 2014 - [email protected] - -- Update to 4.12.2 - * KDE 4.12.2 release - * See http://www.kde.org/announcements/announce-4.12.2.php - -------------------------------------------------------------------- -Sat Jan 11 15:42:18 UTC 2014 - [email protected] - -- Update to 4.12.1 - * KDE 4.12.1 release - * See http://www.kde.org/announcements/announce-4.12.1.php - -------------------------------------------------------------------- -Sat Dec 14 18:09:33 UTC 2013 - [email protected] - -- Update to 4.12.0 - * KDE 4.12.0 release - * See http://www.kde.org/announcements/4.12.php - -------------------------------------------------------------------- -Fri Nov 29 07:13:26 UTC 2013 - [email protected] - -- Update to 4.11.97 - * KDE 4.12 RC 1 release - * See http://www.kde.org/announcements/announce-4.12-rc.php - -------------------------------------------------------------------- -Sat Nov 23 22:27:31 UTC 2013 - [email protected] - -- Update to 4.11.95 - * KDE 4.12 Beta 3 release - * See http://www.kde.org/announcements/announce-4.12-beta3.php - -------------------------------------------------------------------- -Sat Nov 16 18:00:10 UTC 2013 - [email protected] - -- Update to 4.11.90 - * KDE 4.12 Beta 2 release - * See http://www.kde.org/announcements/announce-4.12-beta2.php - -------------------------------------------------------------------- -Sat Nov 9 23:01:34 UTC 2013 - [email protected] - -- Update to 4.11.80 - * KDE 4.12 Beta 1 release - * See http://www.kde.org/announcements/announce-4.12-beta1.php - -------------------------------------------------------------------- -Sat Nov 2 15:14:56 UTC 2013 - [email protected] - -- Update to 4.11.3 - * KDE 4.11.3 bugfix release - * See http://www.kde.org/announcements/announce-4.11.3.php - -------------------------------------------------------------------- -Sat Nov 2 02:36:35 UTC 2013 - [email protected] - -- Only apply Who-needs-event-slider.patch for openSUSE >= 13.1 - -------------------------------------------------------------------- -Sat Sep 28 15:14:43 UTC 2013 - [email protected] - -- Update to 4.11.2 - * KDE 4.11.2 bugfix release - * See http://www.kde.org/announcements/announce-4.11.2.php - -------------------------------------------------------------------- -Tue Sep 24 20:33:44 UTC 2013 - [email protected] - -- Added Who-needs-event-slider.patch -- since KNotify will no longer - be able pretending it can control volume, also remove the Event - slider within KMix - -------------------------------------------------------------------- -Sun Sep 1 10:06:38 UTC 2013 - [email protected] - -- Update to 4.11.1 - * KDE 4.11.1 bugfix release - * See http://www.kde.org/announcements/announce-4.11.1.php - -------------------------------------------------------------------- -Thu Aug 8 15:11:58 UTC 2013 - [email protected] - -- Update to 4.11.0 ++++ 2029 more lines (skipped) ++++ between /work/SRC/openSUSE:Factory/kmix/kmix.changes ++++ and /work/SRC/openSUSE:Factory/.kmix.new/kmix.changes Old: ---- Who-needs-event-slider.patch kmix-14.12.3.tar.xz kmix-4.14.3-fix-bashisms.patch kmix5.changes kmix5.spec New: ---- kmix-15.04.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kmix.spec ++++++ --- /var/tmp/diff_new_pack.ournYc/_old 2015-05-15 10:05:59.000000000 +0200 +++ /var/tmp/diff_new_pack.ournYc/_new 2015-05-15 10:05:59.000000000 +0200 @@ -17,66 +17,69 @@ Name: kmix -BuildRequires: alsa-devel -BuildRequires: glib2-devel -BuildRequires: libcanberra-devel -BuildRequires: libkde4-devel -BuildRequires: libpulse-devel -BuildRequires: xz +Version: 15.04.1 +Release: 0 Summary: Sound Mixer License: GPL-2.0+ Group: Productivity/Multimedia/Sound/Mixers Url: http://www.kde.org -Version: 14.12.3 -Release: 0 -Source0: %{name}-%{version}.tar.xz -# PATCH-FIX-OPENSUSE Who-needs-event-slider.patch -- since KNotify will no longer be able pretending it can -# control volume, also remove the Event slider within KMix -Patch0: Who-needs-event-slider.patch -Patch1: kmix-4.14.3-fix-bashisms.patch +Source: %{name}-%{version}.tar.xz +BuildRequires: alsa-devel +BuildRequires: extra-cmake-modules +BuildRequires: glib2-devel +BuildRequires: kcmutils-devel +BuildRequires: kconfigwidgets-devel +BuildRequires: kdbusaddons-devel +BuildRequires: kdelibs4support-devel +BuildRequires: kf5-filesystem +BuildRequires: kglobalaccel-devel +BuildRequires: ki18n-devel +BuildRequires: kiconthemes-devel +BuildRequires: kxmlgui-devel +BuildRequires: libcanberra-devel +BuildRequires: libpulse-devel +BuildRequires: phonon4qt5-devel +BuildRequires: update-desktop-files +BuildRequires: pkgconfig(Qt5Core) >= 5.2.0 +BuildRequires: pkgconfig(Qt5DBus) >= 5.2.0 +BuildRequires: pkgconfig(Qt5Gui) >= 5.2.0 +BuildRequires: pkgconfig(Qt5Widgets) >= 5.2.0 +Obsoletes: kmix5 < %{version} +Obsoletes: %{name}5 < %{version} +Provides: %{name}5 = %{version} BuildRoot: %{_tmppath}/%{name}-%{version}-build -%kde4_runtime_requires %description KDE's full featured mini mixer %prep %setup -q -%if 0%{?suse_version} >= 1310 -%patch0 -p1 -%endif -%patch1 -p1 %build - %cmake_kde4 -d build + %cmake_kf5 -d build -- -DKMIX_KF5_BUILD=ON %make_jobs %install - pushd build - %kde4_makeinstall - popd + %kf5_makeinstall -C build + %suse_update_desktop_file kmix AudioVideo Mixer - %kde_post_install %post -p /sbin/ldconfig + %postun -p /sbin/ldconfig %files %defattr(-,root,root) -%{_kde4_applicationsdir}/kmix.desktop -%{_kde4_appsdir}/kmix/ -%{_kde4_bindir}/kmix -%{_kde4_bindir}/kmixctrl -%{_kde4_bindir}/kmixremote -%{_kde4_datadir}/autostart/kmix_autostart.desktop -%{_kde4_datadir}/autostart/restore_kmix_volumes.desktop -%{_kde4_datadir}/dbus-1/interfaces/org.kde.kmix.* -%{_kde4_htmldir}/en/kmix/ -%{_kde4_iconsdir}/hicolor/*/apps/kmix.* -%{_kde4_libdir}/libkdeinit4_kmix.so -%{_kde4_libdir}/libkdeinit4_kmixctrl.so -%{_kde4_modulesdir}/kded_kmixd.so -%{_kde4_servicesdir}/kded/kmixd.desktop -%{_kde4_servicesdir}/kmixctrl_restore.desktop +%doc COPYING* +%{_kf5_bindir}/kmix* +%{_kf5_libdir}/libkdeinit5_kmix.so +%{_kf5_libdir}/libkdeinit5_kmixctrl.so +%{_kf5_applicationsdir}/*kmix*.desktop +%{_kf5_plugindir}/ +%{_kf5_configdir}/autostart/*kmix*.desktop +%{_kf5_sharedir}/dbus-1/interfaces/org.kde.kmix.* +%{_kf5_servicesdir}/ +%{_kf5_iconsdir}/hicolor/*/*/* +%{_kf5_sharedir}/kmix/ %changelog ++++++ kmix-14.12.3.tar.xz -> kmix-15.04.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/.reviewboardrc new/kmix-15.04.1/.reviewboardrc --- old/kmix-14.12.3/.reviewboardrc 1970-01-01 01:00:00.000000000 +0100 +++ new/kmix-15.04.1/.reviewboardrc 2015-01-29 01:44:03.000000000 +0100 @@ -0,0 +1,3 @@ +REVIEWBOARD_URL = "https://git.reviewboard.kde.org" +REPOSITORY = 'git://anongit.kde.org/kmix' +TARGET_GROUPS = 'kdemultimedia' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/CMakeLists.txt new/kmix-15.04.1/CMakeLists.txt --- old/kmix-14.12.3/CMakeLists.txt 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/CMakeLists.txt 2015-01-29 01:44:03.000000000 +0100 @@ -26,6 +26,7 @@ cmake_policy (SET CMP0046 NEW) endif() +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") if (KMIX_KF5_BUILD) find_package(ECM 0.0.11 REQUIRED NO_MODULE) @@ -46,12 +47,12 @@ find_package(KF5ConfigWidgets) find_package(KF5IconThemes) else() - set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH}) find_package(KDE4 REQUIRED) include(KDE4Defaults) include(MacroLibrary) endif() +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. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/apps/KMixApp.cpp new/kmix-15.04.1/apps/KMixApp.cpp --- old/kmix-14.12.3/apps/KMixApp.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/apps/KMixApp.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -28,9 +28,10 @@ #include "core/ControlManager.h" #include "core/GlobalConfig.h" +bool KMixApp::firstCaller = true; KMixApp::KMixApp() : - KUniqueApplication(), m_kmix(0) + KUniqueApplication(), m_kmix(0), creationLock(QMutex::Recursive) { GlobalConfig::init(); @@ -45,108 +46,171 @@ KMixApp::~KMixApp() { + kDebug() << "Deleting KMixApp"; ControlManager::instance().shutdownNow(); delete m_kmix; + m_kmix = 0; + GlobalConfig::shutdown(); } -bool KMixApp::restoreSessionIfApplicable() +void KMixApp::createWindowOnce(bool hasArgKeepvisibility, bool reset) { - bool restore = isSessionRestored() && KMainWindow::canBeRestored(0); + // Create window, if it was not yet created (e.g. via autostart or manually) + if (m_kmix == 0) + { + kDebug() << "Creating new KMix window"; + m_kmix = new KMixWindow(hasArgKeepvisibility, reset); + } +} + +bool KMixApp::restoreSessionIfApplicable(bool hasArgKeepvisibility, bool reset) +{ + /** + * We should lock session creation. Rationale: + * KMix can be started multiple times during session start. By "autostart" and "session restore". The order is + * undetermined, as KMix will initialize in the background of KDE session startup (Hint: As a + * KUniqueApplication it decouples from the startkde process!). + * + * Now we must make sure that window creation is definitely done, before the "other" process comes, as it might + * want to restore the session. Working on a half-created window would not be smart! Why can this happen? It + * depends on implementation details insinde Qt, which COULD potentially lead to the following scenarios: + * 1) "Autostart" and "session restore" run concurrenty in 2 differnent Threads. + * 2) The current "main/gui" thread "pops up" a "session restore" message from the Qt event dispatcher. + * This means that "Autostart" and "session restore" run interleaved in a single Thread. + */ + creationLock.lock(); + + bool restore = isSessionRestored(); // && KMainWindow::canBeRestored(0); + kDebug() << "Starting KMix using kepvisibility=" << hasArgKeepvisibility << ", failsafe=" << reset << ", sessionRestore=" << restore; + int createCount = 0; if (restore) { - m_kmix->restore(0, false); + if (reset) + { + kWarning() << "Reset cannot be performed while KMix is running. Please quit KMix and retry then."; + } + int n = 1; + while (KMainWindow::canBeRestored(n)) + { + kDebug() << "Restoring window " << n; + if (n > 1) + { + // This code path is "impossible". It is here only for analyzing possible issues with session resoring. + // KMix is a single-instance app. If more than one instance is craeated we have a bug. + kWarning() << "KDE session management wants to restore multiple instances of KMix. Please report this as a bug."; + break; + } + else + { + // Create window, if it was not yet created (e.g. via autostart or manually) + createWindowOnce(hasArgKeepvisibility, reset); + // #restore() is called with the parameter of "show == false", as KMixWindow iteself decides on it. + m_kmix->restore(n, false); + createCount++; + n++; + } + } + } + + if (createCount == 0) + { + // Normal start, or if nothing could be restored + createWindowOnce(hasArgKeepvisibility, reset); } + creationLock.unlock(); return restore; } int KMixApp::newInstance() { - // There are 3 cases for a new instance + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + bool hasArgKeepvisibility = args->isSet("keepvisibility"); + bool reset = args->isSet("failsafe"); + + /** + * There are 3 cases when starting KMix: + * Autostart : Cases 1) or 3) below + * Session restore : Cases 1) or 2a) below + * Manual start by user : Cases 1) or 2b) below + * + * Each may be the creator a new instance, but only if the instance did not exist yet. + */ + //kDebug(67100) << "KMixApp::newInstance() isRestored()=" << isRestored() << "_keepVisibility=" << _keepVisibility; - static bool first = true; - if (!first) + /** + * NB See https://qa.mandriva.com/show_bug.cgi?id=56893#c3 + * + * It is important to track this via a separate variable and not + * based on m_kmix to handle this race condition. + * Specific protection for the activation-prior-to-full-construction + * case exists above in the 'already running case' + */ + creationLock.lock(); // Guard a complete construction + bool first = firstCaller; + firstCaller = false; + + if (first) { - // There already exists an instance/window - kDebug(67100) - << "KMixApp::newInstance() Instance exists"; - - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - bool hasArgKeepvisibility = args->isSet("keepvisibility"); - bool reset = args->isSet("failsafe"); - if (reset) - { - kWarning() << "Reset cannot be performed while KMix is running. Please quit KMix and retry then."; - } + /** CASE 1 ******************************************************* + * + * Typical case: Normal start. KMix was not running yet => create a new KMixWindow + */ + GlobalConfig::init(); + restoreSessionIfApplicable(hasArgKeepvisibility, reset); + } + else + { if (!hasArgKeepvisibility) { - // *** CASE 1 ****************************************************** - /* - * KMix is running, AND the *USER* starts it again (w/o --keepvisibilty), the KMix main window will be shown. + /** CASE 2 ****************************************************** + * + * KMix is running, AND the *USER* starts it again (w/o --keepvisibilty) + * 2a) Restored the KMix main window will be shown. + * 2b) Not restored */ - kDebug(67100) - << "KMixApp::newInstance() SHOW WINDOW (_keepVisibility=" - << hasArgKeepvisibility << ", isSessionRestored=" - << isSessionRestored(); /* * Restore Session. This may look strange to you, as the instance already exists. But the following * sequence might happen: - * 1) Autostart (no restore) => create m_kmix instance (via CASE 3) - * 2) Session restore => we are here at this line of code (CASE 1). m_kmix exists, but still must be restored + * 1) Autostart (no restore) => create m_kmix instance (via CASE 1) + * 2) Session restore => we are here at this line of code (CASE 2). m_kmix exists, but still must be restored * */ - bool wasRestored = restoreSessionIfApplicable(); + bool wasRestored = restoreSessionIfApplicable(hasArgKeepvisibility, reset); - // Use standard newInstances(), which shows and activates the main window. But skip it for the - // special "restored" case, as we should not override the session rules. if (!wasRestored) { + // + // Use standard newInstances(), which shows and activates the main window. But skip it for the + // special "restored" case, as we should not override the session rules. KUniqueApplication::newInstance(); } + // else: Do nothing, as session restore has done it. } else { - // *** CASE 2 ****************************************************** - /* - * If KMix is running, AND launched again with --keepvisibilty + /** CASE 3 ****************************************************** * - * => We don't want to change the visibiliy, thus we don't call show() here. + * KMix is running, AND launched again with --keepvisibilty + * + * Typical use case: Autostart * - * Hint: --keepVisibility is a special (legacy) option for applications that want to start - * a mixer service, but don't need to show the KMix GUI (like KMilo , KAlarm, ...). - * See Bug 58901. + * => We don't want to change the visibiliy, thus we don't call show() here. * - * Nowadays this switch can be considered legacy, as applications should use KMixD instead. + * Hint: --keepVisibility is used in kmix_autostart.desktop. It was used in history by KMilo + * (see BKO 58901), but nowadays Mixer Applets nmight want to use it, though they should + * use KMixD instead. */ - kDebug(67100) + kDebug() << "KMixApp::newInstance() REGULAR_START _keepVisibility=" << hasArgKeepvisibility; } } - else - { - // *** CASE 3 ****************************************************** - /* - * Regular case: KMix was not running yet => create a new KMixWindow - */ - first = false;// NB See https://qa.mandriva.com/show_bug.cgi?id=56893#c3 - // It is important to track this via a separate variable and not - // based on m_kmix to handle this race condition. - // Specific protection for the activation-prior-to-full-construction - // case exists above in the 'already running case' - GlobalConfig::init(); - - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - bool hasArgKeepvisibility = args->isSet("keepvisibility"); - bool reset = args->isSet("failsafe"); - m_kmix = new KMixWindow(hasArgKeepvisibility, reset); - - restoreSessionIfApplicable(); - } + creationLock.unlock(); return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/apps/KMixApp.h new/kmix-15.04.1/apps/KMixApp.h --- old/kmix-14.12.3/apps/KMixApp.h 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/apps/KMixApp.h 2015-01-29 01:44:03.000000000 +0100 @@ -21,6 +21,7 @@ #ifndef KMixApp_h #define KMixApp_h +#include <QMutex> #include <kuniqueapplication.h> class KMixWindow; @@ -28,23 +29,19 @@ class KMixApp : public KUniqueApplication { Q_OBJECT - bool restoreSessionIfApplicable(); + bool restoreSessionIfApplicable(bool hasArgKeepvisibility, bool reset); + void createWindowOnce(bool hasArgKeepvisibility, bool reset); public: KMixApp(); ~KMixApp(); - int newInstance (); + int newInstance() override; - public slots: - //void quitExtended(); // For a hack on visibility() -// static void keepVisibility(bool); -/* - signals: - void stopUpdatesOnVisibility(); -*/ private: KMixWindow *m_kmix; -// static bool _keepVisibility; + QMutex creationLock; + static bool firstCaller; + }; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/apps/kmix.cpp new/kmix-15.04.1/apps/kmix.cpp --- old/kmix-14.12.3/apps/kmix.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/apps/kmix.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -82,6 +82,7 @@ #else #define CLASS_Action KAction #define CLASS_KShortcut KShortcut +#define QStringLiteral QLatin1String #endif /* KMixWindow @@ -94,7 +95,7 @@ m_autouseMultimediaKeys(true), m_dockWidget(), m_dsm(0), m_dontSetDefaultCardOnStart(false) { - setObjectName(QLatin1String("KMixWindow")); + setObjectName(QStringLiteral("KMixWindow")); // disable delete-on-close because KMix might just sit in the background waiting for cards to be plugged in setAttribute(Qt::WA_DeleteOnClose, false); @@ -104,7 +105,7 @@ KGlobal::locale()->insertCatalog(QLatin1String("kmix-controls")); initWidgets(); initPrefDlg(); - DBusMixSetWrapper::initialize(this, "/Mixers"); + DBusMixSetWrapper::initialize(this, QStringLiteral("/Mixers")); MixerToolBox::instance()->initMixer(m_multiDriverMode, m_backendFilter, m_hwInfoString, true); KMixDeviceManager *theKMixDeviceManager = KMixDeviceManager::instance(); initActionsAfterInitMixer(); // init actions that require initialized mixer backend(s). @@ -132,10 +133,10 @@ ControlManager::instance().addListener( QString(), // All mixers (as the Global master Mixer might change) (ControlChangeType::Type) (ControlChangeType::ControlList | ControlChangeType::MasterChanged), this, - QString("KMixWindow")); + "KMixWindow"); // Send an initial volume refresh (otherwise all volumes are 0 until the next change) - ControlManager::instance().announce(QString(), ControlChangeType::Volume, QString("Startup")); + ControlManager::instance().announce(QString(), ControlChangeType::Volume, "Startup"); } KMixWindow::~KMixWindow() @@ -194,63 +195,63 @@ // settings menu _actionShowMenubar = KStandardAction::showMenubar(this, SLOT(toggleMenuBar()), actionCollection()); - //actionCollection()->addAction( a->objectName(), a ); + //actionCollection()->addAction(QStringLiteral( a->objectName()), a ); KStandardAction::preferences(this, SLOT(showSettings()), actionCollection()); KStandardAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), actionCollection()); - CLASS_Action* action = actionCollection()->addAction("launch_kdesoundsetup"); + CLASS_Action* action = actionCollection()->addAction(QStringLiteral("launch_kdesoundsetup")); action->setText(i18n("Audio Setup")); connect(action, SIGNAL(triggered(bool)), SLOT(slotKdeAudioSetupExec())); - action = actionCollection()->addAction("hwinfo"); + action = actionCollection()->addAction(QStringLiteral("hwinfo")); action->setText(i18n("Hardware &Information")); connect(action, SIGNAL(triggered(bool)), SLOT(slotHWInfo())); - action = actionCollection()->addAction("hide_kmixwindow"); + action = actionCollection()->addAction(QStringLiteral("hide_kmixwindow")); action->setText(i18n("Hide Mixer Window")); connect(action, SIGNAL(triggered(bool)), SLOT(hideOrClose())); action->setShortcut(QKeySequence(Qt::Key_Escape)); - action = actionCollection()->addAction("toggle_channels_currentview"); + action = actionCollection()->addAction(QStringLiteral("toggle_channels_currentview")); action->setText(i18n("Configure &Channels...")); connect(action, SIGNAL(triggered(bool)), SLOT(slotConfigureCurrentView())); - action = actionCollection()->addAction("select_master"); + action = actionCollection()->addAction(QStringLiteral("select_master")); action->setText(i18n("Select Master Channel...")); connect(action, SIGNAL(triggered(bool)), SLOT(slotSelectMaster())); - action = actionCollection()->addAction("save_1"); + action = actionCollection()->addAction(QStringLiteral("save_1")); action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_1)); action->setText(i18n("Save volume profile 1")); connect(action, SIGNAL(triggered(bool)), SLOT(saveVolumes1())); - action = actionCollection()->addAction("save_2"); + action = actionCollection()->addAction(QStringLiteral("save_2")); action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_2)); action->setText(i18n("Save volume profile 2")); connect(action, SIGNAL(triggered(bool)), SLOT(saveVolumes2())); - action = actionCollection()->addAction("save_3"); + action = actionCollection()->addAction(QStringLiteral("save_3")); action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_3)); action->setText(i18n("Save volume profile 3")); connect(action, SIGNAL(triggered(bool)), SLOT(saveVolumes3())); - action = actionCollection()->addAction("save_4"); + action = actionCollection()->addAction(QStringLiteral("save_4")); action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_4)); action->setText(i18n("Save volume profile 4")); connect(action, SIGNAL(triggered(bool)), SLOT(saveVolumes4())); - action = actionCollection()->addAction("load_1"); + action = actionCollection()->addAction(QStringLiteral("load_1")); action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::Key_1)); action->setText(i18n("Load volume profile 1")); connect(action, SIGNAL(triggered(bool)), SLOT(loadVolumes1())); - action = actionCollection()->addAction("load_2"); + action = actionCollection()->addAction(QStringLiteral("load_2")); action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::Key_2)); action->setText(i18n("Load volume profile 2")); connect(action, SIGNAL(triggered(bool)), SLOT(loadVolumes2())); - action = actionCollection()->addAction("load_3"); + action = actionCollection()->addAction(QStringLiteral("load_3")); action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::Key_3)); action->setText(i18n("Load volume profile 3")); connect(action, SIGNAL(triggered(bool)), SLOT(loadVolumes3())); - action = actionCollection()->addAction("load_4"); + action = actionCollection()->addAction(QStringLiteral("load_4")); action->setShortcut(CLASS_KShortcut(Qt::CTRL + Qt::Key_4)); action->setText(i18n("Load volume profile 4")); connect(action, SIGNAL(triggered(bool)), SLOT(loadVolumes4())); @@ -266,7 +267,7 @@ { if (m_autouseMultimediaKeys) { - CLASS_Action* globalAction = actionCollection()->addAction("increase_volume"); + CLASS_Action* globalAction = actionCollection()->addAction(QStringLiteral("increase_volume")); globalAction->setText(i18n("Increase Volume")); #ifdef X_KMIX_KF5_BUILD @@ -277,7 +278,7 @@ connect(globalAction, SIGNAL(triggered(bool)), SLOT(slotIncreaseVolume())); - globalAction = actionCollection()->addAction("decrease_volume"); + globalAction = actionCollection()->addAction(QStringLiteral("decrease_volume")); globalAction->setText(i18n("Decrease Volume")); #ifdef X_KMIX_KF5_BUILD KGlobalAccel::setGlobalShortcut(globalAction, Qt::Key_VolumeDown); @@ -286,7 +287,7 @@ #endif connect(globalAction, SIGNAL(triggered(bool)), SLOT(slotDecreaseVolume())); - globalAction = actionCollection()->addAction("mute"); + globalAction = actionCollection()->addAction(QStringLiteral("mute")); globalAction->setText(i18n("Mute")); #ifdef X_KMIX_KF5_BUILD KGlobalAccel::setGlobalShortcut(globalAction, Qt::Key_VolumeMute); @@ -566,6 +567,7 @@ // --- Advanced options, without GUI: END ------------------------------------- + // The following log is very helpful in bug reports. Please keep it. m_backendFilter = config.readEntry<>("Backends", QList<QString>()); kDebug() << "Backends: " << m_backendFilter; @@ -686,17 +688,11 @@ { GUIProfile* guiprof = 0; -// if (mixer->isDynamic()) -// { -// // Dynamic will ALWAYS get the fallbackProfile. Actually user can not disable it -// guiprof = GUIProfile::fallbackProfile(mixer); -// } -// else if (reset) { guiprof = GUIProfile::find(mixer, QString("default"), false, true); // ### Card unspecific profile ### } -// else + if ( guiprof != 0 ) { guiprof->setDirty(); // All fallback => dirty diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/apps/kmixd.cpp new/kmix-15.04.1/apps/kmixd.cpp --- old/kmix-14.12.3/apps/kmixd.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/apps/kmixd.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -43,8 +43,14 @@ #include "core/GlobalConfig.h" #include "core/mixertoolbox.h" #include "core/kmixdevicemanager.h" +#include "core/mixer.h" #include "core/version.h" +#ifndef X_KMIX_KF5_BUILD +#define QStringLiteral QLatin1String +#endif + + K_PLUGIN_FACTORY(KMixDFactory, registerPlugin<KMixD>(); ) @@ -80,7 +86,7 @@ KDEDModule(parent), m_multiDriverMode (false) // -<- I never-ever want the multi-drivermode to be activated by accident { - setObjectName( QLatin1String("KMixD" )); + setObjectName( QStringLiteral("KMixD" )); GlobalConfig::init(); kWarning() << "kmixd: Triggering delayed initialization"; QTimer::singleShot( 3000, this, SLOT(delayedInitialization())); @@ -161,14 +167,9 @@ KConfigGroup config(KGlobal::config(), "Global"); m_multiDriverMode = config.readEntry("MultiDriver", false); - m_configVersion = config.readEntry( "ConfigVersion", 0 ); - // WARNING Don't overwrite m_configVersion with the "correct" value, before having it - // evaluated. Better only write that in saveBaseConfig() QString mixerMasterCard = config.readEntry( "MasterMixer", "" ); QString masterDev = config.readEntry( "MasterMixerDevice", "" ); - //if ( ! mixerMasterCard.isEmpty() && ! masterDev.isEmpty() ) { - Mixer::setGlobalMaster(mixerMasterCard, masterDev, true); - //} + Mixer::setGlobalMaster(mixerMasterCard, masterDev, true); QString mixerIgnoreExpression = config.readEntry( "MixerIgnoreExpression", "Modem" ); m_backendFilter = config.readEntry<>( "Backends", QList<QString>() ); MixerToolBox::instance()->setMixerIgnoreExpression(mixerIgnoreExpression); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/apps/kmixd.h new/kmix-15.04.1/apps/kmixd.h --- old/kmix-14.12.3/apps/kmixd.h 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/apps/kmixd.h 2015-01-29 01:44:03.000000000 +0100 @@ -32,19 +32,7 @@ #include <QTimer> // KDE -//class KAccel; -class KAction; -//#include <kxmlguiwindow.h> #include <kdedmodule.h> - -// KMix -//class KMixPrefDlg; -//class KMixDockWidget; -//class KMixWindow; -//class ViewDockAreaPopup; -#include "core/mixer.h" - -//class OSDWidget; class KMixD : public KDEDModule, protected QDBusContext @@ -67,8 +55,6 @@ bool m_multiDriverMode; QString m_hwInfoString; - QString m_defaultCardOnStart; - unsigned int m_configVersion; QList<QString> m_backendFilter; private slots: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/apps/kmixremote new/kmix-15.04.1/apps/kmixremote --- old/kmix-14.12.3/apps/kmixremote 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/apps/kmixremote 2015-01-29 01:44:03.000000000 +0100 @@ -7,7 +7,7 @@ # Mute ################################################################################# -function usage +usage() { echo "Usage:" echo "List mixers # $0 list" @@ -15,19 +15,19 @@ echo "Get Volume # $0 get [--master | <mixer> <control>]" echo "Set Volume # $0 set [--master | <mixer> <control>] <0..100>" echo "Mute/Unmute # $0 mute [--master | <mixer> <control>] true|false" - echo + echo } -function exit_with_error +exit_with_error() { echo "Error: $1" - echo + echo usage exit 1 } # Prints the mixer DBUS ID's on the console. leaving out the "/Mixers/" prefix -function listMixers +listMixers() { qdbus org.kde.kmix /Mixers org.freedesktop.DBus.Properties.Get org.kde.KMix.MixSet mixers | cut -f3 -d/ errorCode=$? @@ -37,7 +37,7 @@ } # Prints the mixer control DBUS ID's of the given mixer on the console. leaving out the "/Mixers/" prefix -function listControls +listControls() { qdbus org.kde.kmix $1 org.freedesktop.DBus.Properties.Get org.kde.KMix.Mixer controls | cut -f4 -d/ errorCode=$? @@ -55,10 +55,11 @@ # Read args while true; do arg=$1 - shift if test -z "$arg"; then break - elif test "x--master" = "x$arg"; then + fi + shift + if test "x--master" = "x$arg"; then mixer=`qdbus org.kde.kmix /Mixers org.kde.KMix.MixSet.currentMasterMixer` control=`qdbus org.kde.kmix /Mixers org.kde.KMix.MixSet.currentMasterControl` elif test "x--help" = "x$arg" -o "x-h" = "x$arg"; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/apps/main.cpp new/kmix-15.04.1/apps/main.cpp --- old/kmix-14.12.3/apps/main.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/apps/main.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -90,5 +90,6 @@ KMixApp *app = new KMixApp(); int ret = app->exec(); delete app; + kDebug() << "KMix is now exiting, status=" << ret; return ret; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/backends/mixer_alsa9.cpp new/kmix-15.04.1/backends/mixer_alsa9.cpp --- old/kmix-14.12.3/backends/mixer_alsa9.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/backends/mixer_alsa9.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -35,6 +35,9 @@ // Qt #include <QList> +#ifndef X_KMIX_KF5_BUILD +#define QStringLiteral QLatin1String +#endif // STD Headers #include <stdlib.h> @@ -75,38 +78,39 @@ int Mixer_ALSA::identify( snd_mixer_selem_id_t *sid ) { - QString name = snd_mixer_selem_id_get_name( sid ); - if (name.contains("master" , Qt::CaseInsensitive)) return MixDevice::VOLUME; - if (name.contains("master mono", Qt::CaseInsensitive)) return MixDevice::VOLUME; - if (name.contains("front" , Qt::CaseInsensitive) && - !name.contains("mic" , Qt::CaseInsensitive)) return MixDevice::VOLUME; - if (name.contains("pc speaker" , Qt::CaseInsensitive)) return MixDevice::SPEAKER; - if (name.contains("capture" , Qt::CaseInsensitive)) return MixDevice::RECMONITOR; - if (name.contains("music" , Qt::CaseInsensitive)) return MixDevice::MIDI; - if (name.contains("Synth" , Qt::CaseInsensitive)) return MixDevice::MIDI; - if (name.contains("FM" , Qt::CaseInsensitive)) return MixDevice::MIDI; - if (name.contains("headphone" , Qt::CaseInsensitive)) return MixDevice::HEADPHONE; - if (name.contains("bass" , Qt::CaseInsensitive)) return MixDevice::BASS; - if (name.contains("treble" , Qt::CaseInsensitive)) return MixDevice::TREBLE; - if (name.contains("cd" , Qt::CaseInsensitive)) return MixDevice::CD; - if (name.contains("video" , Qt::CaseInsensitive)) return MixDevice::VIDEO; - if (name.contains("pcm" , Qt::CaseInsensitive)) return MixDevice::AUDIO; - if (name.contains("Wave" , Qt::CaseInsensitive)) return MixDevice::AUDIO; - if (name.contains("surround" , Qt::CaseInsensitive)) return MixDevice::SURROUND_BACK; - if (name.contains("center" , Qt::CaseInsensitive)) return MixDevice::SURROUND_CENTERFRONT; - if (name.contains("ac97" , Qt::CaseInsensitive)) return MixDevice::AC97; - if (name.contains("coaxial" , Qt::CaseInsensitive)) return MixDevice::DIGITAL; - if (name.contains("optical" , Qt::CaseInsensitive)) return MixDevice::DIGITAL; - if (name.contains("iec958" , Qt::CaseInsensitive)) return MixDevice::DIGITAL; - if (name.contains("digital" , Qt::CaseInsensitive)) return MixDevice::DIGITAL; - if (name.contains("mic boost" , Qt::CaseInsensitive)) return MixDevice::MICROPHONE_BOOST; - if (name.contains("Mic Front" , Qt::CaseInsensitive)) return MixDevice::MICROPHONE_FRONT; - if (name.contains("Front Mic" , Qt::CaseInsensitive)) return MixDevice::MICROPHONE_FRONT; - if (name.contains("mic" , Qt::CaseInsensitive)) return MixDevice::MICROPHONE; - if (name.contains("lfe" , Qt::CaseInsensitive)) return MixDevice::SURROUND_LFE; - if (name.contains("monitor" , Qt::CaseInsensitive)) return MixDevice::RECMONITOR; - if (name.contains("3d" , Qt::CaseInsensitive)) return MixDevice::SURROUND; - if (name.contains("side" , Qt::CaseInsensitive)) return MixDevice::SURROUND_BACK; + const char * cname = snd_mixer_selem_id_get_name( sid ); + QByteArray name = QByteArray::fromRawData( cname, qstrlen(cname) ).toLower(); + if (name.contains("master" )) return MixDevice::VOLUME; + if (name.contains("master mono")) return MixDevice::VOLUME; + if (name.contains("front" ) && + !name.contains("mic" )) return MixDevice::VOLUME; + if (name.contains("pc speaker" )) return MixDevice::SPEAKER; + if (name.contains("capture" )) return MixDevice::RECMONITOR; + if (name.contains("music" )) return MixDevice::MIDI; + if (name.contains("synth" )) return MixDevice::MIDI; + if (name.contains("fm" )) return MixDevice::MIDI; + if (name.contains("headphone" )) return MixDevice::HEADPHONE; + if (name.contains("bass" )) return MixDevice::BASS; + if (name.contains("treble" )) return MixDevice::TREBLE; + if (name.contains("cd" )) return MixDevice::CD; + if (name.contains("video" )) return MixDevice::VIDEO; + if (name.contains("pcm" )) return MixDevice::AUDIO; + if (name.contains("wave" )) return MixDevice::AUDIO; + if (name.contains("surround" )) return MixDevice::SURROUND_BACK; + if (name.contains("center" )) return MixDevice::SURROUND_CENTERFRONT; + if (name.contains("ac97" )) return MixDevice::AC97; + if (name.contains("coaxial" )) return MixDevice::DIGITAL; + if (name.contains("optical" )) return MixDevice::DIGITAL; + if (name.contains("iec958" )) return MixDevice::DIGITAL; + if (name.contains("digital" )) return MixDevice::DIGITAL; + if (name.contains("mic boost" )) return MixDevice::MICROPHONE_BOOST; + if (name.contains("mic front" )) return MixDevice::MICROPHONE_FRONT; + if (name.contains("front mic" )) return MixDevice::MICROPHONE_FRONT; + if (name.contains("mic" )) return MixDevice::MICROPHONE; + if (name.contains("lfe" )) return MixDevice::SURROUND_LFE; + if (name.contains("monitor" )) return MixDevice::RECMONITOR; + if (name.contains("3d" )) return MixDevice::SURROUND; + if (name.contains("side" )) return MixDevice::SURROUND_BACK; return MixDevice::EXTERNAL; } @@ -996,12 +1000,12 @@ QString ALSA_getDriverName() { - return "ALSA"; + return QStringLiteral("ALSA"); } QString Mixer_ALSA::getDriverName() { - return "ALSA"; + return QStringLiteral("ALSA"); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/backends/mixer_mpris2.cpp new/kmix-15.04.1/backends/mixer_mpris2.cpp --- old/kmix-14.12.3/backends/mixer_mpris2.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/backends/mixer_mpris2.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -620,7 +620,7 @@ MediaController::PlayState Mixer_MPRIS2::mprisPlayStateString2PlayState(const QString& playbackStatus) { - MediaController::PlayState playState; + MediaController::PlayState playState = MediaController::PlayStopped; // presume Stopped for unknown state if (playbackStatus == "Playing") { playState = MediaController::PlayPlaying; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/backends/mixer_pulse.cpp new/kmix-15.04.1/backends/mixer_pulse.cpp --- old/kmix-14.12.3/backends/mixer_pulse.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/backends/mixer_pulse.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -24,6 +24,7 @@ #include <cstdlib> #include <QtCore/QAbstractEventDispatcher> #include <QTimer> +#include <QStringBuilder> #include <klocale.h> @@ -260,7 +261,7 @@ // Do something.... if (PA_INVALID_INDEX != i->monitor_of_sink) { - kDebug(67100) << "Ignoring Monitor Source: " << i->description; +// kDebug(67100) << "Ignoring Monitor Source: " << i->description; return; } @@ -339,14 +340,12 @@ QString appname = i18n("Unknown Application"); if (clients.contains(i->client)) - appname = clients[i->client]; - - QString prefix = QString("%1: ").arg(appname); + appname = clients.value(i->client); devinfo s; s.index = i->index; s.device_index = i->sink; - s.description = prefix + QString::fromUtf8(i->name); + s.description = appname % QLatin1String(": ") % QString::fromUtf8(i->name); s.name = QString("stream:") + QString::number(i->index); //appname.replace(' ', '_').toLower(); s.icon_name = getIconNameFromProplist(i->proplist); s.channel_map = i->channel_map; @@ -398,14 +397,12 @@ QString appname = i18n("Unknown Application"); if (clients.contains(i->client)) - appname = clients[i->client]; - - QString prefix = QString("%1: ").arg(appname); + appname = clients.value(i->client); devinfo s; s.index = i->index; s.device_index = i->source; - s.description = prefix + QString::fromUtf8(i->name); + s.description = appname % QLatin1String(": ") % QString::fromUtf8(i->name); s.name = QString("stream:") + QString::number(i->index); //appname.replace(' ', '_').toLower(); s.icon_name = getIconNameFromProplist(i->proplist); s.channel_map = i->channel_map; @@ -745,7 +742,7 @@ return cvol; } -static devmap* get_widget_map(int type, QString id = "") +static devmap* get_widget_map(int type, QString id = QString()) { Q_ASSERT(type >= 0 && type <= KMIXPA_WIDGET_MAX); @@ -929,9 +926,9 @@ if (isAppStream) md->setApplicationStream(true); - kDebug(67100) << "Adding Pulse volume " << dev.name << ", isCapture= " - << (m_devnum == KMIXPA_CAPTURE || m_devnum == KMIXPA_APP_CAPTURE) - << ", isAppStream= " << isAppStream << "=" << md->isApplicationStream() << ", devnum=" << m_devnum; +// kDebug(67100) << "Adding Pulse volume " << dev.name << ", isCapture= " +// << (m_devnum == KMIXPA_CAPTURE || m_devnum == KMIXPA_APP_CAPTURE) +// << ", isAppStream= " << isAppStream << "=" << md->isApplicationStream() << ", devnum=" << m_devnum; md->addPlaybackVolume(v); md->setMuted(dev.mute); m_mixDevices.append(md->addToPool()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/core/GlobalConfig.cpp new/kmix-15.04.1/core/GlobalConfig.cpp --- old/kmix-14.12.3/core/GlobalConfig.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/core/GlobalConfig.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -31,8 +31,9 @@ addItemBool("Labels", data.showLabels, true); addItemBool("VolumeOverdrive", data.volumeOverdrive, false); addItemBool("VolumeFeedback", data.beepOnVolumeChange, true); - ItemString* is = addItemString("Orientation", data.orientationMainGUIString, "Vertical"); - kDebug() << is->name() << is->value(); +// ItemString* is = + addItemString("Orientation", data.orientationMainGUIString, "Vertical"); +// kDebug() << is->name() << is->value(); addItemString("Orientation.TrayPopup", data.orientationTrayPopupString, QLatin1String("Vertical")); // Sound Menu @@ -50,6 +51,7 @@ addItemBool("Debug.ControlManager", data.debugControlManager, false); addItemBool("Debug.GUI", data.debugGUI, false); addItemBool("Debug.Volume", data.debugVolume, false); + addItemBool("Debug.Config", data.debugConfig, false); readConfig(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/core/GlobalConfig.h new/kmix-15.04.1/core/GlobalConfig.h --- old/kmix-14.12.3/core/GlobalConfig.h 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/core/GlobalConfig.h 2015-01-29 01:44:03.000000000 +0100 @@ -51,6 +51,7 @@ bool debugControlManager; bool debugGUI; bool debugVolume; + bool debugConfig; Qt::Orientation getToplevelOrientation(); Qt::Orientation getTraypopupOrientation(); @@ -95,6 +96,18 @@ } ; + /** + * Frees all data associated with the static instance. + * + */ + static void shutdown() + { + delete instanceObj; + instanceObj = 0; + } + ; + + GlobalConfigData data; void setMixersForSoundmenu(QSet<QString> mixersForSoundmenu) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/core/mixdevice.cpp new/kmix-15.04.1/core/mixdevice.cpp --- old/kmix-14.12.3/core/mixdevice.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/core/mixdevice.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -288,6 +288,7 @@ { _enumValues.clear(); // The QString's inside will be auto-deleted, as they get unref'ed delete _dbusControlWrapper; + delete mediaController; } Volume& MixDevice::playbackVolume() @@ -425,7 +426,7 @@ bool MixDevice::write( KConfig *config, const QString& grp ) { if (_mixer->isDynamic() || isArtificial()) { - kDebug(67100) << "MixDevice::write(): This MixDevice does not permit volume saving (i.e. because it is handled lower down in the audio stack). Ignoring."; +// kDebug(67100) << "MixDevice::write(): This MixDevice does not permit volume saving (i.e. because it is handled lower down in the audio stack). Ignoring."; return false; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/core/mixer.cpp new/kmix-15.04.1/core/mixer.cpp --- old/kmix-14.12.3/core/mixer.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/core/mixer.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -509,7 +509,7 @@ static MasterControl result; if ( !fallbackAllowed || _globalMasterPreferred.isValid() ) { - kDebug() << "Returning preferred master"; +// kDebug() << "Returning preferred master"; return _globalMasterPreferred; } @@ -517,7 +517,7 @@ if (mm) { result.set(_globalMasterPreferred.getCard(), mm->getRecommendedDeviceId()); if (!result.getControl().isEmpty()) - kDebug() << "Returning extended preferred master"; +// kDebug() << "Returning extended preferred master"; return result; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/core/mixertoolbox.cpp new/kmix-15.04.1/core/mixertoolbox.cpp --- old/kmix-14.12.3/core/mixertoolbox.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/core/mixertoolbox.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -24,6 +24,10 @@ #include <QDir> #include <QWidget> #include <QString> +#include <QStringBuilder> +#ifndef X_KMIX_KF5_BUILD +#define QStringLiteral QLatin1String +#endif //#include <kdebug.h> #include <klocale.h> @@ -36,7 +40,7 @@ MixerToolBox* MixerToolBox::s_instance = 0; -QRegExp MixerToolBox::s_ignoreMixerExpression( QLatin1String( "Modem" )); +QRegExp MixerToolBox::s_ignoreMixerExpression( QStringLiteral( "Modem" )); //KLocale* MixerToolBox::s_whatsthisLocale = 0; /*********************************************************************************** @@ -106,14 +110,14 @@ int driverWithMixer = -1; bool multipleDriversActive = false; - QString driverInfo = ""; - QString driverInfoUsed = ""; + QString driverInfo; + QString driverInfoUsed; for( int drv1=0; drv1<drvNum; drv1++ ) { QString driverName = Mixer::driverName(drv1); if ( driverInfo.length() > 0 ) { - driverInfo += " + "; + driverInfo += QStringLiteral(" + "); } driverInfo += driverName; } @@ -148,7 +152,7 @@ } - bool regularBackend = driverName != "MPRIS2" && driverName != "PulseAudio"; + bool regularBackend = driverName != QLatin1String("MPRIS2") && driverName != QLatin1String("PulseAudio"); if (regularBackend && regularBackendFound) { // Only accept one regular backend => skip this one @@ -186,11 +190,11 @@ break; case SINGLE_PLUS_MPRIS2: - if ( driverName == "MPRIS2" ) + if ( driverName == QLatin1String("MPRIS2") ) { backendMprisFound = true; } - else if ( driverName == "PulseAudio" ) + else if ( driverName == QLatin1String("PulseAudio") ) { // PulseAudio is not useful together with MPRIS2. Treat it as "single" if ( foundSomethingAndLastControlReached ) @@ -280,13 +284,13 @@ driverInfoUsed = Mixer::driverName(0); } - ref_hwInfoString = i18n("Sound drivers supported:"); - ref_hwInfoString.append(" ").append( driverInfo ).append( "\n").append(i18n("Sound drivers used:")) .append(" ").append(driverInfoUsed); + ref_hwInfoString = i18n("Sound drivers supported:") % ' ' % driverInfo % '\n' % + i18n("Sound drivers used:") % ' ' % driverInfoUsed; if ( multipleDriversActive ) { // this will only be possible by hacking the config-file, as it will not be officially supported - ref_hwInfoString.append("\n").append(i18n("Experimental multiple-Driver mode activated")); + ref_hwInfoString += '\n' + i18n("Experimental multiple-Driver mode activated"); QString allDrivermatch("*"); if (hotplug) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/core/volume.cpp new/kmix-15.04.1/core/volume.cpp --- old/kmix-14.12.3/core/volume.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/core/volume.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -66,14 +66,14 @@ // Forbidden/private. Only here because if there is no CaptureVolume we need the values initialized // And also QMap requires it. Volume::Volume() +: _chmask(MNONE) +, _minVolume(0) +, _maxVolume(0) +, _hasSwitch(false) +, _switchActivated(false) +, _switchType(None) +, _isCapture(false) { - _minVolume = 0; - _maxVolume = 0; - _hasSwitch = false; - _switchActivated = false; - _switchType = None; - _isCapture = false; - _chmask = MNONE; } /** @@ -82,15 +82,15 @@ * @deprecated Do not use */ VolumeChannel::VolumeChannel() +: volume(0) +, chid(Volume::NOCHANNEL) { - volume = 0; - chid = Volume::NOCHANNEL; } -VolumeChannel::VolumeChannel(Volume::ChannelID chid) +VolumeChannel::VolumeChannel(Volume::ChannelID c) +: volume(0) +, chid(c) { - volume = 0; - this->chid = chid; } Volume::Volume(long maxVolume, long minVolume, bool hasSwitch, bool isCapture ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/gui/kmixdockwidget.cpp new/kmix-15.04.1/gui/kmixdockwidget.cpp --- old/kmix-14.12.3/gui/kmixdockwidget.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/gui/kmixdockwidget.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -54,6 +54,7 @@ , _oldToolTipValue(-1) , _oldPixmapType('-') , _kmixMainWindow(parent) + , _delta(0) { setToolTipIconByName("kmix"); setTitle(i18n( "Volume Control")); @@ -106,7 +107,19 @@ // _kmixMainWindow->updateDocking(); // _kmixMainWindow->saveConfig(); refreshVolumeLevels(); - findAction("select_master")->setEnabled(Mixer::getGlobalMasterMixer() != 0); + { + QAction *selectMasterAction = findAction("select_master"); + if(selectMasterAction) + { + // Review #120432 : Guard findAction("select_master"), as it is sometimes 0 on the KF5 build + // This is probably not a final solution, but better than a crash. + selectMasterAction->setEnabled(Mixer::getGlobalMasterMixer() != 0); + } + else + { + kWarning() << "select_master action not found. Cannot enable it in the Systray."; + } + } break; case ControlChangeType::Volume: @@ -347,15 +360,31 @@ Volume &vol = ( md->playbackVolume().hasVolume() ) ? md->playbackVolume() : md->captureVolume(); - // bko313579 Do not use "delta", as that is setting more related to documents (Editor, Browser). KMix should - // simply always use its own VOLUME_STEP_DIVISOR as a base for percentage change. - bool decrease = delta < 0; +// kDebug() << "I am seeing a wheel event with delta=" << delta << " and orientation=" << wheelOrientation; if (wheelOrientation == Qt::Horizontal) // Reverse horizontal scroll: bko228780 - decrease = !decrease; - long cv = vol.volumeStep(decrease); + { + delta = -delta; + } + // bko313579, bko341536, Review #121725 - Use delta and round it by 120. + _delta += delta; + bool decrease = delta < 0; + unsigned long inc = 0; + while (_delta >= 120) { + _delta -= 120; + inc++; + } + while (_delta <= -120) { + _delta += 120; + inc++; + } + + if (inc == 0) { + return; + } + long cv = vol.volumeStep(decrease) * inc; bool isInactive = vol.isCapture() ? !md->isRecSource() : md->isMuted(); - kDebug() << "Operating on capture=" << vol.isCapture() << ", isInactive=" << isInactive; +// kDebug() << "Operating on capture=" << vol.isCapture() << ", isInactive=" << isInactive; if ( cv > 0 && isInactive) { // increasing from muted state: unmute and start with a low volume level diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/gui/kmixdockwidget.h new/kmix-15.04.1/gui/kmixdockwidget.h --- old/kmix-14.12.3/gui/kmixdockwidget.h 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/gui/kmixdockwidget.h 2015-01-29 01:44:03.000000000 +0100 @@ -68,6 +68,7 @@ int _oldToolTipValue; char _oldPixmapType; KMixWindow* _kmixMainWindow; + int _delta; bool onlyHaveOneMouseButtonAction(); void refreshVolumeLevels(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/gui/kmixprefdlg.cpp new/kmix-15.04.1/gui/kmixprefdlg.cpp --- old/kmix-14.12.3/gui/kmixprefdlg.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/gui/kmixprefdlg.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -302,7 +302,8 @@ */ void KMixPrefDlg::updateWidgets() { - kDebug() << ""; + if (dialogConfig.data.debugConfig) + kDebug() << ""; bool toplevelHorizontal = dialogConfig.data.getToplevelOrientation() == Qt::Horizontal; _rbHorizontal->setChecked(toplevelHorizontal); _rbVertical->setChecked(!toplevelHorizontal); @@ -320,11 +321,13 @@ void KMixPrefDlg::updateSettings() { Qt::Orientation toplevelOrientation = _rbHorizontal->isChecked() ? Qt::Horizontal : Qt::Vertical; - kDebug() << "toplevelOrientation" << toplevelOrientation << ", _rbHorizontal->isChecked()" << _rbHorizontal->isChecked(); + if (dialogConfig.data.debugConfig) + kDebug() << "toplevelOrientation" << toplevelOrientation << ", _rbHorizontal->isChecked()" << _rbHorizontal->isChecked(); dialogConfig.data.setToplevelOrientation(toplevelOrientation); Qt::Orientation trayOrientation = _rbTraypopupHorizontal->isChecked() ? Qt::Horizontal : Qt::Vertical; - kDebug() << "trayOrientation" << trayOrientation << ", _rbTraypopupHorizontal->isChecked()" << _rbTraypopupHorizontal->isChecked(); + if (dialogConfig.data.debugConfig) + kDebug() << "trayOrientation" << trayOrientation << ", _rbTraypopupHorizontal->isChecked()" << _rbTraypopupHorizontal->isChecked(); dialogConfig.data.setTraypopupOrientation(trayOrientation); // Announcing MasterChanged, as the sound menu (aka ViewDockAreaPopup) primarily shows master volume(s). @@ -355,14 +358,16 @@ { bool orientationFromConfigIsHor = dialogConfig.data.getToplevelOrientation() == Qt::Horizontal; bool orientationFromWidgetIsHor = _rbHorizontal->isChecked(); - kDebug() << "Orientation MAIN fromConfig=" << (orientationFromConfigIsHor ? "Hor" : "Vert") << ", fromWidget=" << (orientationFromWidgetIsHor ? "Hor" : "Vert"); + if (dialogConfig.data.debugConfig) + kDebug() << "Orientation MAIN fromConfig=" << (orientationFromConfigIsHor ? "Hor" : "Vert") << ", fromWidget=" << (orientationFromWidgetIsHor ? "Hor" : "Vert"); bool changed = orientationFromConfigIsHor ^ orientationFromWidgetIsHor; if (!changed) { bool orientationFromConfigIsHor = dialogConfig.data.getTraypopupOrientation() == Qt::Horizontal; orientationFromWidgetIsHor = _rbTraypopupHorizontal->isChecked(); - kDebug() << "Orientation TRAY fromConfig=" << (orientationFromConfigIsHor ? "Hor" : "Vert") << ", fromWidget=" << (orientationFromWidgetIsHor ? "Hor" : "Vert"); + if (dialogConfig.data.debugConfig) + kDebug() << "Orientation TRAY fromConfig=" << (orientationFromConfigIsHor ? "Hor" : "Vert") << ", fromWidget=" << (orientationFromWidgetIsHor ? "Hor" : "Vert"); changed = orientationFromConfigIsHor ^ orientationFromWidgetIsHor; } @@ -371,7 +376,8 @@ changed = dvc->getModifyFlag(); } - kDebug() << "hasChanged=" << changed; + if (dialogConfig.data.debugConfig) + kDebug() << "hasChanged=" << changed; return changed; } @@ -405,7 +411,8 @@ "autostart", #endif QString("kmix_autostart.desktop")); - kDebug() << "autostartConfigFilename = " << autostartConfigFilename; + if (dialogConfig.data.debugConfig) + kDebug() << "autostartConfigFilename = " << autostartConfigFilename; bool autostartFileExists = !autostartConfigFilename.isNull(); //allowAutostartWarning->setEnabled(autostartFileExists); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/gui/viewbase.cpp new/kmix-15.04.1/gui/viewbase.cpp --- old/kmix-14.12.3/gui/viewbase.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/gui/viewbase.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -406,12 +406,12 @@ { if (pControl->getVisibility().satisfiesVisibility(visibility)) { - kDebug() << " MATCH " << (*pControl).id << " for " << mdwId << " with visibility " << pControl->getVisibility().getId() << " to " << visibility.getId(); +// kDebug() << " MATCH " << (*pControl).id << " for " << mdwId << " with visibility " << pControl->getVisibility().getId() << " to " << visibility.getId(); return pControl; } else { - kDebug() << "NOMATCH " << (*pControl).id << " for " << mdwId << " with visibility " << pControl->getVisibility().getId() << " to " << visibility.getId(); +// kDebug() << "NOMATCH " << (*pControl).id << " for " << mdwId << " with visibility " << pControl->getVisibility().getId() << " to " << visibility.getId(); } } } // iterate over all ProfControl entries diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmix-14.12.3/gui/viewdockareapopup.cpp new/kmix-15.04.1/gui/viewdockareapopup.cpp --- old/kmix-14.12.3/gui/viewdockareapopup.cpp 2014-10-22 01:27:24.000000000 +0200 +++ new/kmix-15.04.1/gui/viewdockareapopup.cpp 2015-01-29 01:44:03.000000000 +0100 @@ -231,7 +231,8 @@ delete layout(); // BKO 299754 _layoutMDW = new QGridLayout(this); _layoutMDW->setSpacing(KDialog::spacingHint()); - _layoutMDW->setMargin(0); + // Review #121166: Add some space over device icons, otherwise they may hit window border + _layoutMDW->setContentsMargins(0,5,0,0); //_layoutMDW->setSizeConstraint(QLayout::SetMinimumSize); _layoutMDW->setSizeConstraint(QLayout::SetMaximumSize); _layoutMDW->setObjectName(QLatin1String("KmixPopupLayout"));
