79 lines
2.0 KiB
Diff
79 lines
2.0 KiB
Diff
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
|
|
|