Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.2:PowerPC
cantata
0001-Correctly-handle-changing-Basic-mode-music...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Correctly-handle-changing-Basic-mode-music-folder.patch of Package cantata
From 72729bb424ddeddfba452983d6e6211adf6e9a86 Mon Sep 17 00:00:00 2001 From: Craig Drummond <craig.p.drummond@gmail.com> Date: Sat, 29 Feb 2020 08:26:57 +0000 Subject: [PATCH] - Correctly handle changing 'Basic' mode music folder. - When stopping 'Basic' mode MPD instance, send SIGKILL. Closes #1575 --- CMakeLists.txt | 2 +- ChangeLog | 5 +++++ gui/serversettings.cpp | 1 + mpd-interface/mpduser.cpp | 23 +++++++++++++++++------ 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a84decc7..0a8c4705 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Qt Client for MPD") set(CPACK_SOURCE_GENERATOR "TBZ2") set(CPACK_PACKAGE_VERSION_MAJOR "2") set(CPACK_PACKAGE_VERSION_MINOR "4") -set(CPACK_PACKAGE_VERSION_PATCH "1") +set(CPACK_PACKAGE_VERSION_PATCH "2") set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) set(CPACK_PACKAGE_VERSION_SPIN "") # Use ".$number" - e.g. ".1" set(CPACK_PACKAGE_CONTACT "Craig Drummond <craig.p.drummond@gmail.com>") diff --git a/ChangeLog b/ChangeLog index 30ed1051..a26f41bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2.4.2 +----- +1. Correctly handle changing 'Basic' mode music folder. +2. When stopping 'Basic' mode MPD instance, send SIGKILL. + 2.4.1 ----- 1. Re-enable custom playqueue background. This is broken for 5.12, but that's a diff --git a/gui/serversettings.cpp b/gui/serversettings.cpp index 558d2c61..840dce44 100644 --- a/gui/serversettings.cpp +++ b/gui/serversettings.cpp @@ -299,6 +299,7 @@ void ServerSettings::add() basicDir->setText(dir); MPDUser::self()->setMusicFolder(dir); combo->addItem(MPDUser::translatedName()); + haveBasicCollection = true; } #endif removeButton->setEnabled(combo->count()>1); diff --git a/mpd-interface/mpduser.cpp b/mpd-interface/mpduser.cpp index b9fac5ac..4cf56746 100644 --- a/mpd-interface/mpduser.cpp +++ b/mpd-interface/mpduser.cpp @@ -134,6 +134,11 @@ void MPDUser::setMusicFolder(const QString &folder) } init(true); + bool mpdRunning = isRunning(); + if (mpdRunning) { + controlMpd(true); + } + QFile cfgFile(Utils::dataDir(constDir, true)+constConfigFile); QStringList lines; if (cfgFile.open(QIODevice::ReadOnly|QIODevice::Text)) { @@ -145,22 +150,22 @@ void MPDUser::setMusicFolder(const QString &folder) lines.append(line); } } + cfgFile.close(); } if (!lines.isEmpty()) { - cfgFile.close(); if (cfgFile.open(QIODevice::WriteOnly|QIODevice::Text)) { QTextStream out(&cfgFile); for (const QString &line: lines) { out << line; } + cfgFile.close(); } } det.dir=folder; det.setDirReadable(); - if (0!=getPid()) { - controlMpd(true); // Stop - controlMpd(false); // Start + if (mpdRunning) { + controlMpd(false); } } @@ -334,14 +339,20 @@ int MPDUser::getPid() bool MPDUser::controlMpd(bool stop) { + if (stop) { + int pid = getPid(); + ::kill(pid, SIGKILL); + return !isRunning(); + } + QString confFile=Utils::dataDir(constDir, true)+constConfigFile; if (!QFile::exists(confFile)) { return false; } QStringList args=QStringList() << confFile; - if (stop) { + /*if (stop) { args+="--kill"; - } else { + } else*/ { // Ensure cache dir exists before starting MPD Utils::cacheDir(constDir, true); if (!pidFileName.isEmpty() && QFile::exists(pidFileName)) { -- 2.25.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor