Added
Link Here
|
1 |
--- source/qm_mpdcom.cpp.orig 2024-02-02 09:26:32 UTC |
2 |
+++ source/qm_mpdcom.cpp |
3 |
@@ -17,7 +17,7 @@ qm_mpdCommand::qm_mpdCommand(qm_Config * cfg) |
4 |
setObjectName("mpdCom"); |
5 |
|
6 |
config = cfg; |
7 |
- config->mpd_is_installed = is_mpd_installed(config->cout_extensive); |
8 |
+ config->mpd_is_installed = true; |
9 |
|
10 |
p_conn = nullptr; |
11 |
connect_Thread = nullptr; |
12 |
@@ -377,24 +377,24 @@ QString qm_mpdCommand::get_mpdconf_path() |
13 |
return confpath; |
14 |
} |
15 |
|
16 |
-// Get mpd.conf from /etc/default/mpd |
17 |
+// Get mpd.conf from %%PREFIX%%/etc/musicpd.conf |
18 |
QString qm_mpdCommand::get_etc_default_mpd() |
19 |
{ |
20 |
QFile file; |
21 |
QString line = ""; |
22 |
|
23 |
- file.setFileName("/etc/default/mpd"); |
24 |
+ file.setFileName("%%PREFIX%%/etc/musicpd.conf"); |
25 |
if ( !file.exists() ) |
26 |
{ |
27 |
if (config->cout_extensive) |
28 |
- printf ("MPD's config: Tried /etc/default/mpd but it does not exist\n"); |
29 |
+ printf ("MPD's config: Tried %%PREFIX%%/etc/musicpd.conf but it does not exist\n"); |
30 |
return line; |
31 |
} |
32 |
|
33 |
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) |
34 |
{ |
35 |
if (config->cout_extensive) |
36 |
- printf ("MPD's config: Tried /etc/default/mpd but it is not readable\n"); |
37 |
+ printf ("MPD's config: Tried %%PREFIX%%/etc/musicpd.conf but it is not readable\n"); |
38 |
return line; |
39 |
} |
40 |
else |
41 |
@@ -418,19 +418,19 @@ QString qm_mpdCommand::get_etc_default_mpd() |
42 |
if (!file.exists()) |
43 |
{ |
44 |
if (config->cout_extensive) |
45 |
- printf ("MPD's config in /etc/default/mpd does not exist\n"); |
46 |
+ printf ("MPD's config in %%PREFIX%%/etc/musicpd.conf does not exist\n"); |
47 |
line = ""; |
48 |
} |
49 |
} |
50 |
else |
51 |
{ |
52 |
if (config->cout_extensive) |
53 |
- printf ("MPD's config: Tried /etc/default/mpd but MPDCONF is not set\n"); |
54 |
+ printf ("MPD's config: Tried %%PREFIX%%/etc/musicpd.conf but MPDCONF is not set\n"); |
55 |
} |
56 |
|
57 |
if (!line.isEmpty() && config->cout_extensive) |
58 |
{ |
59 |
- printf ("MPD's config from /etc/default/mpd: %s\n", line.toUtf8().constData()); |
60 |
+ printf ("MPD's config from %%PREFIX%%/etc/musicpd.conf: %s\n", line.toUtf8().constData()); |
61 |
} |
62 |
|
63 |
return line; |
64 |
@@ -2996,7 +2996,7 @@ QString qm_mpdCommand::find_config_files(bool show_dia |
65 |
|
66 |
QString qm_mpdCommand::find_config_files(bool show_dialog) |
67 |
{ |
68 |
-/* If not specified on the command-line or in /etc/default/mpd |
69 |
+/* If not specified on the command-line or in %%PREFIX%%/etc/musicpd.conf |
70 |
MPD searches |
71 |
1st at ~/.config/mpd/mpd.conf |
72 |
2nd at ~/.mpdconf |
73 |
@@ -3062,20 +3062,20 @@ QString qm_mpdCommand::find_config_files(bool show_dia |
74 |
} |
75 |
} |
76 |
|
77 |
- thispath = "/etc/mpd.conf"; |
78 |
+ thispath = "%%PREFIX%%/etc/musicpd.conf"; |
79 |
file.setFileName(thispath); |
80 |
if ( file.exists() ) |
81 |
{ |
82 |
if (file.open(QIODevice::ReadOnly)) |
83 |
{ |
84 |
file.close(); |
85 |
- printf ("located: /etc/mpd.conf\n"); |
86 |
+ printf ("located: %%PREFIX%%/etc/musicpd.conf\n"); |
87 |
return thispath; |
88 |
} |
89 |
else |
90 |
{ |
91 |
if (config->cout_extensive) |
92 |
- printf ("/etc/mpd.conf, but it is not readable\n"); |
93 |
+ printf ("%%PREFIX%%/etc/musicpd.conf, but it is not readable\n"); |
94 |
} |
95 |
} |
96 |
|
97 |
@@ -3227,8 +3227,8 @@ bool qm_mpdCommand::is_mpd_running(bool showmsg) |
98 |
config->mpd_process_owner = ""; // empty equals not running |
99 |
|
100 |
QProcess proc; |
101 |
- proc.setProgram("pidof"); |
102 |
- proc.setArguments({"mpd"}); |
103 |
+ proc.setProgram("pgrep"); |
104 |
+ proc.setArguments({"musicpd"}); |
105 |
proc.start(); |
106 |
if (!proc.waitForFinished()) |
107 |
return false; |