author | zecke <zecke> | 2002-06-28 16:30:08 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-28 16:30:08 (UTC) |
commit | e72d93a703f4b38109f8f02ec96a759d93b8f91c (patch) (side-by-side diff) | |
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 @@ -105,128 +105,129 @@ namespace OpieTooth { deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak useEncryption = cfg.readNumEntry( "useEncryption" , 1 ); enableAuthentification = cfg.readNumEntry( "enableAuthentification" , 1 ); enablePagescan = cfg.readNumEntry( "enablePagescan" , 1 ); enableInquiryscan = cfg.readNumEntry( "enableInquiryscan" , 1 ); } /** * Writes all options to the config file */ void BlueBase::writeConfig() { Config cfg( "bluetoothmanager" ); cfg.setGroup( "bluezsettings" ); cfg.writeEntry( "name" , deviceName ); cfg.writeEntryCrypt( "passkey" , defaultPasskey ); cfg.writeEntry( "useEncryption" , useEncryption ); cfg.writeEntry( "enableAuthentification" , enableAuthentification ); cfg.writeEntry( "enablePagescan" , enablePagescan ); cfg.writeEntry( "enableInquiryscan" , enableInquiryscan ); writeToHciConfig(); } void BlueBase::writeToHciConfig() { HciConfWrapper *hciconf = new HciConfWrapper( "/tmp/hcid.conf" ); hciconf->setPinHelper( "/bin/QtPalmtop/bin/blue-pin" ); // hciconf->setPinHelper( "/bin/QtPalmtop/bin/blue-pin" ); hciconf->setName( deviceName ); if ( useEncryption == 1) { hciconf->setEncrypt( true ); } else { hciconf->setEncrypt( false ); } if ( enableAuthentification == 1) { hciconf->setAuth( true ); } else { hciconf->setAuth( false ); } if ( enablePagescan == 1) { hciconf->setPscan( true ); } else { hciconf->setPscan( false ); } if ( enableInquiryscan == 1) { hciconf->setIscan( true ); } else { hciconf->setIscan( false ); } + delete hciconf; } /** * Read the list of allready known devices * */ void BlueBase::readSavedDevices() { QList<RemoteDevice> *loadedDevices = new QList<RemoteDevice>; QDir deviceListSave( QDir::homeDirPath() + "/Settings/bluetooth/"); // list of .conf files QStringList devicesFileList = deviceListSave.entryList(); // cut .conf of to get the mac and also read the name entry in it. for ( QStringList::Iterator it = devicesFileList.begin(); it != devicesFileList.end(); ++it ) { QString name; QString mac; qDebug((*it).latin1() ); Config conf((*it)); conf.setGroup("Info"); name = conf.readEntry("name", "Error"); qDebug("MAC: " + mac); qDebug("NAME: " + name); RemoteDevice currentDevice = RemoteDevice( mac , name ); loadedDevices->append( ¤tDevice ); } addSearchedDevices( *loadedDevices ); } /** * Write the list of allready known devices * */ void BlueBase::writeSavedDevices() { QListViewItemIterator it( ListView2 ); for ( ; it.current(); ++it ) { // seperate config file for each device, to store more information in future. // TO FIX: BTLISTITEM!!! // Config conf( QDir::homeDirPath() + "/Settings/bluetooth/" + (((BTListItem)it.current())->mac()) + ".conf", Config::File ); // conf.setGroup( "Info" ); // conf.writeEntry( "name", it.current()->name() ); } } /** * Set up the gui */ void BlueBase::initGui() { StatusLabel->setText( getStatus() ); // maybe move it to getStatus() cryptCheckBox->setChecked( useEncryption ); authCheckBox->setChecked( enableAuthentification ); pagescanCheckBox->setChecked( enablePagescan ); inquiryscanCheckBox->setChecked( enableInquiryscan ); |