aboutsummaryrefslogtreecommitdiff
path: root/audio/quimup/files/patch-src_qm__mpdcom.cpp
blob: c3cf55809370412e2608b4f8a3e17d23d52ae468 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--- src/qm_mpdcom.cpp.orig	2018-12-11 21:49:38 UTC
+++ src/qm_mpdcom.cpp
@@ -367,16 +367,16 @@ QString qm_mpdCom::get_from_etcdefaultmpd()
     QFile file;
     QString line = "";
 
-    file.setFileName("/etc/default/mpd");
+    file.setFileName("%%PREFIX%%/etc/musicpd.conf");
     if ( !file.exists() )
     {
-        printf ("MPD's config : Tried /etc/default/mpd but it does not exist\n");
+        printf ("MPD's config : Tried %%PREFIX%%/etc/musicpd.conf but it does not exist\n");
         return line;
     }
 
     if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
     {
-        printf ("MPD's config : Tried /etc/default/mpd but it is not readable\n");
+        printf ("MPD's config : Tried %%PREFIX%%/etc/musicpd.conf but it is not readable\n");
         return line;
     }
 
@@ -393,10 +393,10 @@ QString qm_mpdCom::get_from_etcdefaultmpd()
     file.close();
 
     if (line.isEmpty())
-        printf ("MPD's config : Tried /etc/default/mpd but MPDCONF is not set\n");
+        printf ("MPD's config : Tried %%PREFIX%%/etc/musicpd.conf but MPDCONF is not set\n");
     else
     {
-        QString msg  = "MPD's config found in /etc/default/mpd : " + line + "\n";
+        QString msg  = "MPD's config found in %%PREFIX%%/etc/musicpd.conf : " + line + "\n";
         printf ("%s", msg.toUtf8().constData());
     }
 
@@ -2710,17 +2710,10 @@ bool qm_mpdCom::is_mpd_running()
     struct stat sts;
     bool b_isrunning = false;
 
-    // try pidof
-    if (stat("/bin/pidof", &sts) == 0)
-    {
-        if( system("pidof mpd > /dev/null") == 0)
-        b_isrunning = true;
-    }
-    else
     // try pgrep
-    if (stat("/usr/bin/pgrep", &sts) == 0)
+    if (stat("/bin/pgrep", &sts) == 0)
     {
-        if( system("pgrep mpd > /dev/null") == 0)
+        if( system("pgrep musicpd > /dev/null") == 0)
             b_isrunning = true;
     }