!53 add pulseaudio process log message
From: @peijiankang Reviewed-by: @tanyulong2021 Signed-off-by: @tanyulong2021
This commit is contained in:
commit
d5e2fa049e
78
0002-add-pulseaudio-process-log-message.patch
Normal file
78
0002-add-pulseaudio-process-log-message.patch
Normal file
@ -0,0 +1,78 @@
|
||||
From 57d08339e7705ff1e588fddd0781d8306de9b5a8 Mon Sep 17 00:00:00 2001
|
||||
From: peijiankang <peijiankang@kylinos.cn>
|
||||
Date: Mon, 27 Jun 2022 10:57:01 +0800
|
||||
Subject: [PATCH] add pulseaudio process log message
|
||||
|
||||
---
|
||||
ukui-volume-control-applet-qt/main.cpp | 35 +++++++++++++++++---------
|
||||
1 file changed, 23 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/ukui-volume-control-applet-qt/main.cpp b/ukui-volume-control-applet-qt/main.cpp
|
||||
index 47a1fb1..c861578 100644
|
||||
--- a/ukui-volume-control-applet-qt/main.cpp
|
||||
+++ b/ukui-volume-control-applet-qt/main.cpp
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <QLibraryInfo>
|
||||
#include <QStandardPaths>
|
||||
#include <X11/Xlib.h>
|
||||
+#include <syslog.h>
|
||||
|
||||
|
||||
bool checkProc(){
|
||||
@@ -41,20 +42,34 @@ bool checkProc(){
|
||||
process.start("ps -C pulseaudio");
|
||||
if (process.waitForFinished())
|
||||
{
|
||||
- QByteArray result = process.readAll();
|
||||
- QString exe = QString(result);
|
||||
- if (exe.contains("pulseaudio"))
|
||||
- {
|
||||
- bIsExist = true;
|
||||
- }
|
||||
+ QByteArray result = process.readAll();
|
||||
+ QString exe = QString(result);
|
||||
+ if (exe.contains("pulseaudio"))
|
||||
+ {
|
||||
+ syslog(LOG_INFO, "ukui-meida: pulseaudio is running!");
|
||||
+ bIsExist = true;
|
||||
+ }
|
||||
}
|
||||
-
|
||||
+
|
||||
return bIsExist;
|
||||
}
|
||||
|
||||
-
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
+ int cnt = 0;
|
||||
+
|
||||
+ while(!checkProc())
|
||||
+ {
|
||||
+ syslog(LOG_INFO, "ukui-meida: pulseaudio is not running, please wait ......! cnt:%d", cnt+1);
|
||||
+ if(++cnt > 12)
|
||||
+ {
|
||||
+ syslog(LOG_INFO, "ukui-meida:pulseaudio is not startup, please check pulseaudio!");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ sleep(5);
|
||||
+ }
|
||||
+ sleep(2);
|
||||
+
|
||||
Display *display = XOpenDisplay(NULL);
|
||||
Screen *scrn = DefaultScreenOfDisplay(display);
|
||||
if(scrn == nullptr) {
|
||||
@@ -94,10 +109,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
qss.close();
|
||||
|
||||
- while(!checkProc())
|
||||
- {
|
||||
- sleep(5);
|
||||
- }
|
||||
DeviceSwitchWidget w;
|
||||
KWindowEffects::enableBlurBehind(w.winId(),true);
|
||||
w.raise();
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
Name: ukui-media
|
||||
Version: 3.0.4
|
||||
Release: 5
|
||||
Release: 6
|
||||
Summary: UKUI media utilities
|
||||
License: GPL-2+ GPL-3+ LGPL-2+ BSD-3-Clause
|
||||
URL: http://www.ukui.org
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Patch1: 0001-add-check-pulseaudio-process.patch
|
||||
Patch2: 0002-add-pulseaudio-process-log-message.patch
|
||||
|
||||
Autoreq : yes
|
||||
|
||||
@ -53,6 +54,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
|
||||
%build
|
||||
./autogen.sh --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64
|
||||
@ -139,6 +141,9 @@ glib-compile-schemas /usr/share/glib-2.0/schemas/ &> /dev/null ||:
|
||||
%{_datadir}/glib-2.0/schemas/org.ukui.media.gschema.xml
|
||||
|
||||
%changelog
|
||||
* Mon Jun 27 2022 peijiankang <peijiankang@kylinos.cn> - 3.0.4-6
|
||||
- add pulseaudio process log message
|
||||
|
||||
* Fri Jun 24 2022 peijiankang <peijiankang@kylinos.cn> - 3.0.4-5
|
||||
- add check pulseaudio process
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user