summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-11-12 17:38:52 (UTC)
committer mickeyl <mickeyl>2003-11-12 17:38:52 (UTC)
commit2fcfbc6e35c50d55333c01d582ef7e3d4a477e2b (patch) (side-by-side diff)
treeb1113d0934216eeb7ddbb162842f4a4bd61e846a
parentf4f7df4a3c54081c3b82489aba097e1c36359313 (diff)
downloadopie-2fcfbc6e35c50d55333c01d582ef7e3d4a477e2b.zip
opie-2fcfbc6e35c50d55333c01d582ef7e3d4a477e2b.tar.gz
opie-2fcfbc6e35c50d55333c01d582ef7e3d4a477e2b.tar.bz2
apply patch from Tim Smith <tim@electronghost.co.uk>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/startpanconnection.cpp14
-rw-r--r--noncore/net/opietooth/manager/panpopup.cpp1
2 files changed, 15 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() {
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 start" );
delete m_panConnect;
}
}
void StartPanConnection::slotExited( OProcess* proc ) {
delete m_panConnect;
+ m_panConnect = 0l;
}
void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len)
{}
void StartPanConnection::stop() {
if ( m_panConnect ) {
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
@@ -40,24 +40,25 @@ PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
PanPopup::~PanPopup() {
}
void PanPopup::slotConnect() {
m_panconnection = new StartPanConnection( m_item->mac() );
m_panconnection->start();
}
void PanPopup::slotDisconnect() {
+ if (!m_panconnection) m_panconnection = new StartPanConnection( m_item->mac() );
m_panconnection->stop();
}
void PanPopup::slotConnectAndConfig() {
slotConnect();
// more intelligence here later like passing the device ( bnepX )
QCopEnvelope e( "QPE/System", "execute(QString)" );
e << QString( "networksettings" );
}