Diffstat (limited to 'noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp index 7ec8288..d19386e 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp | |||
@@ -2,13 +2,32 @@ | |||
2 | #include "bluetoothRFCOMM_NNI.h" | 2 | #include "bluetoothRFCOMM_NNI.h" |
3 | #include "bluetooth_NN.h" | 3 | #include "bluetoothRFCOMM_NN.h" |
4 | 4 | ||
5 | ABluetoothRFCOMM::ABluetoothRFCOMM( BluetoothRFCOMMNetNode * PNN ) : ANetNodeInstance( PNN ) { | 5 | ABluetoothRFCOMM::ABluetoothRFCOMM( BluetoothRFCOMMNetNode * PNN ) : |
6 | GUI = 0; | 6 | ANetNodeInstance( PNN ), Data() { |
7 | RT = 0; | 7 | Data.Devices.setAutoDelete( TRUE ); |
8 | GUI = 0; | ||
9 | RT = 0; | ||
8 | } | 10 | } |
9 | 11 | ||
10 | void ABluetoothRFCOMM::setSpecificAttribute( QString & , QString & ) { | 12 | void ABluetoothRFCOMM::setSpecificAttribute( QString & A, QString & V) { |
13 | |||
14 | if( A == "bdaddress" ) { | ||
15 | Data.Devices.resize( Data.Devices.size() + 1 ); | ||
16 | Data.Devices.insert( Data.Devices.size() - 1, new RFCOMMChannel); | ||
17 | Data.Devices[ Data.Devices.size() - 1 ]->BDAddress = V; | ||
18 | } else if ( A == "channel" ) { | ||
19 | Data.Devices[ Data.Devices.size() - 1 ]->Channel = V.toLong(); | ||
20 | } else if ( A == "name" ) { | ||
21 | Data.Devices[ Data.Devices.size() - 1 ]->Name = V; | ||
22 | } | ||
11 | } | 23 | } |
12 | 24 | ||
13 | void ABluetoothRFCOMM::saveSpecificAttribute( QTextStream & ) { | 25 | void ABluetoothRFCOMM::saveSpecificAttribute( QTextStream & TS ) { |
26 | for( unsigned int i = 0 ; | ||
27 | i < Data.Devices.count(); | ||
28 | i ++ ) { | ||
29 | TS << "bdaddress=" << Data.Devices[i]->BDAddress << endl; | ||
30 | TS << "name=" << quote( Data.Devices[i]->Name ) << endl; | ||
31 | TS << "channel=" << Data.Devices[i]->Channel << endl; | ||
32 | } | ||
14 | } | 33 | } |