1 |
johu 12/01/12 00:10:53 |
2 |
|
3 |
Added: kcdemu-0.3.1-start-cdemud.patch |
4 |
Log: |
5 |
Revision bump. Add patch to fix compatibility with >=app-cdr/cdemud-1.4.0. Thanks Alexandre Rostovtsev <tetromino@g.o> for the patch. Fixes bug #393121. |
6 |
|
7 |
(Portage version: 2.2.0_alpha84/cvs/Linux i686) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 app-cdr/kcdemu/files/kcdemu-0.3.1-start-cdemud.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-cdr/kcdemu/files/kcdemu-0.3.1-start-cdemud.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-cdr/kcdemu/files/kcdemu-0.3.1-start-cdemud.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: kcdemu-0.3.1-start-cdemud.patch |
16 |
=================================================================== |
17 |
From 9486c351315373e7f3be0ca8ab3c84e3295eccfb Mon Sep 17 00:00:00 2001 |
18 |
From: Alexandre Rostovtsev <tetromino@g.o> |
19 |
Date: Tue, 10 Jan 2012 23:29:23 -0500 |
20 |
Subject: [PATCH] Try to start the daemon if it's not already running |
21 |
|
22 |
Fixes compatibility with cdemud-1.4.0, see |
23 |
https://bugs.gentoo.org/show_bug.cgi?id=393121 |
24 |
--- |
25 |
src/cdemu.cpp | 9 ++++++++- |
26 |
src/cdemu.h | 2 +- |
27 |
2 files changed, 9 insertions(+), 2 deletions(-) |
28 |
|
29 |
diff --git a/src/cdemu.cpp b/src/cdemu.cpp |
30 |
index 3fe18c2..75f91dc 100644 |
31 |
--- a/src/cdemu.cpp |
32 |
+++ b/src/cdemu.cpp |
33 |
@@ -32,6 +32,9 @@ CDEmu::CDEmu() |
34 |
m_currentBus(0) |
35 |
{ |
36 |
this->findCurrentBus(); |
37 |
+ // If the daemon has not been started, try to start it |
38 |
+ if (!m_currentBus) |
39 |
+ this->findCurrentBus(true); |
40 |
|
41 |
this->connectSlots(&m_sessionBus); |
42 |
this->connectSlots(&m_systemBus); |
43 |
@@ -181,7 +184,7 @@ void CDEmu::connectSlots(QDBusConnection *connection) |
44 |
} |
45 |
|
46 |
|
47 |
-void CDEmu::findCurrentBus() |
48 |
+void CDEmu::findCurrentBus(bool start_daemon) |
49 |
{ |
50 |
// We don't want to get signals from the wrong bus in case we |
51 |
// switch from the session bus to the system bus or vice versa |
52 |
@@ -194,12 +197,16 @@ void CDEmu::findCurrentBus() |
53 |
|
54 |
// Try session bus first |
55 |
QDBusConnectionInterface *interface = m_sessionBus.interface(); |
56 |
+ if (start_daemon) |
57 |
+ interface->startService("net.sf.cdemu.CDEMUD_Daemon"); |
58 |
if (interface->isServiceRegistered("net.sf.cdemu.CDEMUD_Daemon")) |
59 |
m_currentBus = &m_sessionBus; |
60 |
else |
61 |
{ |
62 |
// Try system bus then |
63 |
interface = m_systemBus.interface(); |
64 |
+ if (start_daemon) |
65 |
+ interface->startService("net.sf.cdemu.CDEMUD_Daemon"); |
66 |
if (interface->isServiceRegistered("net.sf.cdemu.CDEMUD_Daemon")) |
67 |
m_currentBus = &m_systemBus; |
68 |
else |
69 |
diff --git a/src/cdemu.h b/src/cdemu.h |
70 |
index c7b0655..8381c2f 100644 |
71 |
--- a/src/cdemu.h |
72 |
+++ b/src/cdemu.h |
73 |
@@ -56,7 +56,7 @@ private: |
74 |
~CDEmu(); |
75 |
|
76 |
void connectSlots(QDBusConnection *connection); |
77 |
- void findCurrentBus(); |
78 |
+ void findCurrentBus(bool start_daemon = false); |
79 |
int nextFreeSlot(); |
80 |
|
81 |
QDBusConnection m_sessionBus; |
82 |
-- |
83 |
1.7.8.3 |