author | zecke <zecke> | 2002-06-28 16:30:08 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-28 16:30:08 (UTC) |
commit | e72d93a703f4b38109f8f02ec96a759d93b8f91c (patch) (unidiff) | |
tree | 39d6725fa1061965c64c42dabb663a3cfdc1c976 | |
parent | ce221c2cf5b003f1033e6f0b603670ceb0bff7c7 (diff) | |
download | opie-e72d93a703f4b38109f8f02ec96a759d93b8f91c.zip opie-e72d93a703f4b38109f8f02ec96a759d93b8f91c.tar.gz opie-e72d93a703f4b38109f8f02ec96a759d93b8f91c.tar.bz2 |
Don't leak
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index b4b59c3..0385cb1 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -121,96 +121,97 @@ namespace OpieTooth { | |||
121 | 121 | ||
122 | Config cfg( "bluetoothmanager" ); | 122 | Config cfg( "bluetoothmanager" ); |
123 | cfg.setGroup( "bluezsettings" ); | 123 | cfg.setGroup( "bluezsettings" ); |
124 | 124 | ||
125 | cfg.writeEntry( "name" , deviceName ); | 125 | cfg.writeEntry( "name" , deviceName ); |
126 | cfg.writeEntryCrypt( "passkey" , defaultPasskey ); | 126 | cfg.writeEntryCrypt( "passkey" , defaultPasskey ); |
127 | cfg.writeEntry( "useEncryption" , useEncryption ); | 127 | cfg.writeEntry( "useEncryption" , useEncryption ); |
128 | cfg.writeEntry( "enableAuthentification" , enableAuthentification ); | 128 | cfg.writeEntry( "enableAuthentification" , enableAuthentification ); |
129 | cfg.writeEntry( "enablePagescan" , enablePagescan ); | 129 | cfg.writeEntry( "enablePagescan" , enablePagescan ); |
130 | cfg.writeEntry( "enableInquiryscan" , enableInquiryscan ); | 130 | cfg.writeEntry( "enableInquiryscan" , enableInquiryscan ); |
131 | 131 | ||
132 | writeToHciConfig(); | 132 | writeToHciConfig(); |
133 | } | 133 | } |
134 | 134 | ||
135 | void BlueBase::writeToHciConfig() { | 135 | void BlueBase::writeToHciConfig() { |
136 | 136 | ||
137 | HciConfWrapper *hciconf = new HciConfWrapper( "/tmp/hcid.conf" ); | 137 | HciConfWrapper *hciconf = new HciConfWrapper( "/tmp/hcid.conf" ); |
138 | hciconf->setPinHelper( "/bin/QtPalmtop/bin/blue-pin" ); | 138 | hciconf->setPinHelper( "/bin/QtPalmtop/bin/blue-pin" ); |
139 | 139 | ||
140 | 140 | ||
141 | // hciconf->setPinHelper( "/bin/QtPalmtop/bin/blue-pin" ); | 141 | // hciconf->setPinHelper( "/bin/QtPalmtop/bin/blue-pin" ); |
142 | 142 | ||
143 | hciconf->setName( deviceName ); | 143 | hciconf->setName( deviceName ); |
144 | 144 | ||
145 | if ( useEncryption == 1) { | 145 | if ( useEncryption == 1) { |
146 | hciconf->setEncrypt( true ); | 146 | hciconf->setEncrypt( true ); |
147 | } else { | 147 | } else { |
148 | hciconf->setEncrypt( false ); | 148 | hciconf->setEncrypt( false ); |
149 | } | 149 | } |
150 | 150 | ||
151 | 151 | ||
152 | if ( enableAuthentification == 1) { | 152 | if ( enableAuthentification == 1) { |
153 | hciconf->setAuth( true ); | 153 | hciconf->setAuth( true ); |
154 | } else { | 154 | } else { |
155 | hciconf->setAuth( false ); | 155 | hciconf->setAuth( false ); |
156 | } | 156 | } |
157 | 157 | ||
158 | if ( enablePagescan == 1) { | 158 | if ( enablePagescan == 1) { |
159 | hciconf->setPscan( true ); | 159 | hciconf->setPscan( true ); |
160 | } else { | 160 | } else { |
161 | hciconf->setPscan( false ); | 161 | hciconf->setPscan( false ); |
162 | } | 162 | } |
163 | 163 | ||
164 | if ( enableInquiryscan == 1) { | 164 | if ( enableInquiryscan == 1) { |
165 | hciconf->setIscan( true ); | 165 | hciconf->setIscan( true ); |
166 | } else { | 166 | } else { |
167 | hciconf->setIscan( false ); | 167 | hciconf->setIscan( false ); |
168 | } | 168 | } |
169 | delete hciconf; | ||
169 | } | 170 | } |
170 | 171 | ||
171 | 172 | ||
172 | /** | 173 | /** |
173 | * Read the list of allready known devices | 174 | * Read the list of allready known devices |
174 | * | 175 | * |
175 | */ | 176 | */ |
176 | void BlueBase::readSavedDevices() { | 177 | void BlueBase::readSavedDevices() { |
177 | 178 | ||
178 | QList<RemoteDevice> *loadedDevices = new QList<RemoteDevice>; | 179 | QList<RemoteDevice> *loadedDevices = new QList<RemoteDevice>; |
179 | 180 | ||
180 | QDir deviceListSave( QDir::homeDirPath() + "/Settings/bluetooth/"); | 181 | QDir deviceListSave( QDir::homeDirPath() + "/Settings/bluetooth/"); |
181 | // list of .conf files | 182 | // list of .conf files |
182 | QStringList devicesFileList = deviceListSave.entryList(); | 183 | QStringList devicesFileList = deviceListSave.entryList(); |
183 | 184 | ||
184 | // cut .conf of to get the mac and also read the name entry in it. | 185 | // cut .conf of to get the mac and also read the name entry in it. |
185 | 186 | ||
186 | for ( QStringList::Iterator it = devicesFileList.begin(); it != devicesFileList.end(); ++it ) { | 187 | for ( QStringList::Iterator it = devicesFileList.begin(); it != devicesFileList.end(); ++it ) { |
187 | 188 | ||
188 | QString name; | 189 | QString name; |
189 | QString mac; | 190 | QString mac; |
190 | qDebug((*it).latin1() ); | 191 | qDebug((*it).latin1() ); |
191 | Config conf((*it)); | 192 | Config conf((*it)); |
192 | conf.setGroup("Info"); | 193 | conf.setGroup("Info"); |
193 | name = conf.readEntry("name", "Error"); | 194 | name = conf.readEntry("name", "Error"); |
194 | qDebug("MAC: " + mac); | 195 | qDebug("MAC: " + mac); |
195 | qDebug("NAME: " + name); | 196 | qDebug("NAME: " + name); |
196 | RemoteDevice currentDevice = RemoteDevice( mac , name ); | 197 | RemoteDevice currentDevice = RemoteDevice( mac , name ); |
197 | loadedDevices->append( ¤tDevice ); | 198 | loadedDevices->append( ¤tDevice ); |
198 | } | 199 | } |
199 | addSearchedDevices( *loadedDevices ); | 200 | addSearchedDevices( *loadedDevices ); |
200 | } | 201 | } |
201 | 202 | ||
202 | /** | 203 | /** |
203 | * Write the list of allready known devices | 204 | * Write the list of allready known devices |
204 | * | 205 | * |
205 | */ | 206 | */ |
206 | void BlueBase::writeSavedDevices() { | 207 | void BlueBase::writeSavedDevices() { |
207 | 208 | ||
208 | QListViewItemIterator it( ListView2 ); | 209 | QListViewItemIterator it( ListView2 ); |
209 | 210 | ||
210 | for ( ; it.current(); ++it ) { | 211 | for ( ; it.current(); ++it ) { |
211 | 212 | ||
212 | // seperate config file for each device, to store more information in future. | 213 | // seperate config file for each device, to store more information in future. |
213 | // TO FIX: BTLISTITEM!!! | 214 | // TO FIX: BTLISTITEM!!! |
214 | 215 | ||
215 | // Config conf( QDir::homeDirPath() + "/Settings/bluetooth/" + (((BTListItem)it.current())->mac()) + ".conf", Config::File ); | 216 | // Config conf( QDir::homeDirPath() + "/Settings/bluetooth/" + (((BTListItem)it.current())->mac()) + ".conf", Config::File ); |
216 | // conf.setGroup( "Info" ); | 217 | // conf.setGroup( "Info" ); |