Diffstat (limited to 'noncore/net/opietooth/lib/startdunconnection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/lib/startdunconnection.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/net/opietooth/lib/startdunconnection.cpp b/noncore/net/opietooth/lib/startdunconnection.cpp index 6b6d247..c3850eb 100644 --- a/noncore/net/opietooth/lib/startdunconnection.cpp +++ b/noncore/net/opietooth/lib/startdunconnection.cpp | |||
@@ -1,67 +1,67 @@ | |||
1 | 1 | ||
2 | #include "startdunconnection.h" | 2 | #include "startdunconnection.h" |
3 | 3 | ||
4 | using namespace OpieTooth; | 4 | using namespace OpieTooth; |
5 | 5 | ||
6 | 6 | ||
7 | StartDunConnection::StartDunConnection() { | 7 | StartDunConnection::StartDunConnection() { |
8 | m_dunConnect = 0l; | 8 | m_dunConnect = 0l; |
9 | setConnectionType(); | 9 | setConnectionType(); |
10 | } | 10 | } |
11 | 11 | ||
12 | StartDunConnection::~StartDunConnection() { | 12 | StartDunConnection::~StartDunConnection() { |
13 | delete m_dunConnect; | 13 | delete m_dunConnect; |
14 | } | 14 | } |
15 | 15 | ||
16 | StartDunConnection::StartDunConnection( QString mac ) { | 16 | StartDunConnection::StartDunConnection( QString mac ) { |
17 | m_dunConnect = 0l; | 17 | m_dunConnect = 0l; |
18 | m_mac = mac; | 18 | m_mac = mac; |
19 | setConnectionType(); | 19 | setConnectionType(); |
20 | } | 20 | } |
21 | 21 | ||
22 | void StartDunConnection::setName( QString name ) { | 22 | void StartDunConnection::setName( QString name ) { |
23 | m_name = name; | 23 | m_name = name; |
24 | } | 24 | } |
25 | 25 | ||
26 | QString StartDunConnection::name() { | 26 | QString StartDunConnection::name() { |
27 | return m_name; | 27 | return m_name; |
28 | } | 28 | } |
29 | 29 | ||
30 | void StartDunConnection::setConnectionType() { | 30 | void StartDunConnection::setConnectionType() { |
31 | m_connectionType = Pan; | 31 | m_connectionType = Pan; |
32 | } | 32 | } |
33 | 33 | ||
34 | StartConnection::ConnectionType StartDunConnection::type() { | 34 | StartConnection::ConnectionType StartDunConnection::type() { |
35 | return m_connectionType; | 35 | return m_connectionType; |
36 | } | 36 | } |
37 | 37 | ||
38 | void StartDunConnection::start() { | 38 | void StartDunConnection::start() { |
39 | m_dunConnect = new OProcess(); | 39 | m_dunConnect = new OProcess(); |
40 | *m_dunConnect << "dund" << "--listen" << "--connect" << m_mac; | 40 | *m_dunConnect << "dund" << "--listen" << "--connect" << m_mac; |
41 | 41 | ||
42 | connect( m_dunConnect, SIGNAL( processExited( OProcess* ) ) , | 42 | connect( m_dunConnect, SIGNAL( processExited(OProcess*) ) , |
43 | this, SLOT( slotExited( OProcess* ) ) ); | 43 | this, SLOT( slotExited(OProcess*) ) ); |
44 | connect( m_dunConnect, SIGNAL( receivedStdout( OProcess*, char*, int ) ), | 44 | connect( m_dunConnect, SIGNAL( receivedStdout(OProcess*,char*,int) ), |
45 | this, SLOT( slotStdOut( OProcess*, char*, int ) ) ); | 45 | this, SLOT( slotStdOut(OProcess*,char*,int) ) ); |
46 | if (!m_dunConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { | 46 | if (!m_dunConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { |
47 | qWarning( "could not start" ); | 47 | qWarning( "could not start" ); |
48 | delete m_dunConnect; | 48 | delete m_dunConnect; |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | 52 | ||
53 | void StartDunConnection::slotExited( OProcess* proc ) { | 53 | void StartDunConnection::slotExited( OProcess* proc ) { |
54 | delete m_dunConnect; | 54 | delete m_dunConnect; |
55 | } | 55 | } |
56 | 56 | ||
57 | void StartDunConnection::slotStdOut(OProcess* proc, char* chars, int len) | 57 | void StartDunConnection::slotStdOut(OProcess* proc, char* chars, int len) |
58 | {} | 58 | {} |
59 | 59 | ||
60 | 60 | ||
61 | void StartDunConnection::stop() { | 61 | void StartDunConnection::stop() { |
62 | if ( m_dunConnect ) { | 62 | if ( m_dunConnect ) { |
63 | delete m_dunConnect; | 63 | delete m_dunConnect; |
64 | m_dunConnect = 0l; | 64 | m_dunConnect = 0l; |
65 | } | 65 | } |
66 | } | 66 | } |
67 | 67 | ||