-rw-r--r-- | noncore/settings/networksettings2/opietooth2/OTGateway.cpp | 1 | ||||
-rw-r--r-- | noncore/settings/networksettings2/opietooth2/OTGateway.h | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/opietooth2/OTGateway.cpp b/noncore/settings/networksettings2/opietooth2/OTGateway.cpp index e8137dd..1b61a2e 100644 --- a/noncore/settings/networksettings2/opietooth2/OTGateway.cpp +++ b/noncore/settings/networksettings2/opietooth2/OTGateway.cpp @@ -136,24 +136,25 @@ void OTGateway::SLOT_Enable() { } void OTGateway::SLOT_Disable() { getOTDevice()->detach(); } bool OTGateway::needsEnabling() { return getOTDevice()->needsAttach(); } bool OTGateway::isEnabled() { if( getOTDevice()->deviceNr() >= 0 && + AllDrivers.count() != 0 && driver( getOTDevice()->deviceNr() )->isUp() ) return TRUE; // else check system return getOTDevice()->isAttached(); } void OTGateway::SLOT_ShowError( const QString & S ) { odebug << S << oendl; if( ErrorConnectCount > 0 ) { diff --git a/noncore/settings/networksettings2/opietooth2/OTGateway.h b/noncore/settings/networksettings2/opietooth2/OTGateway.h index d97ef35..11c6b30 100644 --- a/noncore/settings/networksettings2/opietooth2/OTGateway.h +++ b/noncore/settings/networksettings2/opietooth2/OTGateway.h @@ -80,25 +80,25 @@ public : // return true if this device needs enabling of bluetooth bool needsEnabling(); // return true if system is running bool isEnabled(); void setRefreshTimer( int MilleSecs ); // return socket to HCI raw layer inline int getSocket() { return HciCtl; } OTDriverList & getDriverList() { return AllDrivers; } OTDriver * driver( int nr ) - { return AllDrivers[nr]; } + { return AllDrivers.count() == 0 ? 0 : AllDrivers[nr]; } void updateDrivers(); PANConnectionVector getPANConnections(); // scan neighbourhood using device void scanNeighbourhood( OTDriver * D = 0 ); void stopScanOfNeighbourhood(void ); void setScanWith( OTDriver * D = 0 ) { ScanWith = (D) ? D : (AllDrivers.count() ) ? AllDrivers[0] : 0; } OTDriver * scanWith( void ) { return ScanWith; } |