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