From 2fcfbc6e35c50d55333c01d582ef7e3d4a477e2b Mon Sep 17 00:00:00 2001 From: mickeyl Date: Wed, 12 Nov 2003 17:38:52 +0000 Subject: apply patch from Tim Smith --- (limited to 'noncore/net') 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 @@ -53,6 +53,7 @@ void StartPanConnection::start() { void StartPanConnection::slotExited( OProcess* proc ) { delete m_panConnect; + m_panConnect = 0l; } void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len) @@ -64,5 +65,18 @@ void StartPanConnection::stop() { delete m_panConnect; m_panConnect = 0l; } + m_panConnect = new OProcess(); + qDebug("IM STOP " + m_mac); + + *m_panConnect << "pand" << "--kill" << m_mac; + + connect( m_panConnect, SIGNAL( processExited( OProcess* ) ) , + this, SLOT( slotExited( OProcess* ) ) ); + connect( m_panConnect, SIGNAL( receivedStdout( OProcess*, char*, int ) ), + this, SLOT( slotStdOut( OProcess*, char*, int ) ) ); + if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { + qWarning( "could not stop" ); + delete m_panConnect; + } } diff --git a/noncore/net/opietooth/manager/panpopup.cpp b/noncore/net/opietooth/manager/panpopup.cpp index 695f349..8b05964 100644 --- a/noncore/net/opietooth/manager/panpopup.cpp +++ b/noncore/net/opietooth/manager/panpopup.cpp @@ -49,6 +49,7 @@ void PanPopup::slotConnect() { } void PanPopup::slotDisconnect() { + if (!m_panconnection) m_panconnection = new StartPanConnection( m_item->mac() ); m_panconnection->stop(); } -- cgit v0.9.0.2