summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/lib
Unidiff
Diffstat (limited to 'noncore/net/opietooth/lib') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/startpanconnection.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/noncore/net/opietooth/lib/startpanconnection.cpp b/noncore/net/opietooth/lib/startpanconnection.cpp
index e7deede..6e0ab7e 100644
--- a/noncore/net/opietooth/lib/startpanconnection.cpp
+++ b/noncore/net/opietooth/lib/startpanconnection.cpp
@@ -44,25 +44,39 @@ void StartPanConnection::start() {
44 this, SLOT( slotExited( OProcess* ) ) ); 44 this, SLOT( slotExited( OProcess* ) ) );
45 connect( m_panConnect, SIGNAL( receivedStdout( OProcess*, char*, int ) ), 45 connect( m_panConnect, SIGNAL( receivedStdout( OProcess*, char*, int ) ),
46 this, SLOT( slotStdOut( OProcess*, char*, int ) ) ); 46 this, SLOT( slotStdOut( OProcess*, char*, int ) ) );
47 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 47 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
48 qWarning( "could not start" ); 48 qWarning( "could not start" );
49 delete m_panConnect; 49 delete m_panConnect;
50 } 50 }
51} 51}
52 52
53 53
54void StartPanConnection::slotExited( OProcess* proc ) { 54void StartPanConnection::slotExited( OProcess* proc ) {
55 delete m_panConnect; 55 delete m_panConnect;
56 m_panConnect = 0l;
56} 57}
57 58
58void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len) 59void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len)
59{} 60{}
60 61
61 62
62void StartPanConnection::stop() { 63void StartPanConnection::stop() {
63 if ( m_panConnect ) { 64 if ( m_panConnect ) {
64 delete m_panConnect; 65 delete m_panConnect;
65 m_panConnect = 0l; 66 m_panConnect = 0l;
66 } 67 }
68 m_panConnect = new OProcess();
69 qDebug("IM STOP " + m_mac);
70
71 *m_panConnect << "pand" << "--kill" << m_mac;
72
73 connect( m_panConnect, SIGNAL( processExited( OProcess* ) ) ,
74 this, SLOT( slotExited( OProcess* ) ) );
75 connect( m_panConnect, SIGNAL( receivedStdout( OProcess*, char*, int ) ),
76 this, SLOT( slotStdOut( OProcess*, char*, int ) ) );
77 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
78 qWarning( "could not stop" );
79 delete m_panConnect;
80 }
67} 81}
68 82