summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-06-28 21:08:44 (UTC)
committer harlekin <harlekin>2002-06-28 21:08:44 (UTC)
commit4aa30fb2582bcbc4f8819afb0b5f612c6441ae1d (patch) (side-by-side diff)
treeb2e892b6a301d60fb86fe3916df53763ce09b7c9
parent5223240e859a0433605ee642b3aac68a05e4d0f4 (diff)
downloadopie-4aa30fb2582bcbc4f8819afb0b5f612c6441ae1d.zip
opie-4aa30fb2582bcbc4f8819afb0b5f612c6441ae1d.tar.gz
opie-4aa30fb2582bcbc4f8819afb0b5f612c6441ae1d.tar.bz2
update
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 0385cb1..3e7e2ab 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -167,100 +167,101 @@ namespace OpieTooth {
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( &currentDevice );
}
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!!!
+ qDebug( "/Settings/bluetooth/" + (((BTListItem*)it.current())->mac()) + ".conf");
+ Config conf( QDir::homeDirPath() + "/Settings/bluetooth/" + (((BTListItem*)it.current())->mac()) + ".conf", Config::File );
- // Config conf( QDir::homeDirPath() + "/Settings/bluetooth/" + (((BTListItem)it.current())->mac()) + ".conf", Config::File );
- // conf.setGroup( "Info" );
- // conf.writeEntry( "name", it.current()->name() );
+ conf.setGroup( "Info" );
+ conf.writeEntry( "name", ((BTListItem*)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 );
deviceNameLine->setText( deviceName );
passkeyLine->setText( defaultPasskey );
// set info tab
setInfo();
}
/**
* Get the status informations and returns it
* @return QString the status informations gathered
*/
QString BlueBase::getStatus(){
QString infoString = tr( "<b>Device name : </b> Ipaq" );
infoString += QString( "<br><b>" + tr( "MAC adress: " ) +"</b> No idea" );
infoString += QString( "<br><b>" + tr( "Class" ) + "</b> PDA" );
return (infoString);
}
/**
* Read the current values from the gui and invoke writeConfig()
*/
void BlueBase::applyConfigChanges() {
deviceName = deviceNameLine->text();
defaultPasskey = passkeyLine->text();
useEncryption = cryptCheckBox->isChecked();
enableAuthentification = authCheckBox->isChecked();
enablePagescan = pagescanCheckBox->isChecked();
enableInquiryscan = inquiryscanCheckBox->isChecked();