From fac9ec9b389bc82d9d3027f801aaceea72c0d63e Mon Sep 17 00:00:00 2001 From: harlekin Date: Tue, 18 Jun 2002 22:44:14 +0000 Subject: update --- diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index d45fbe0..4d476ac 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -138,15 +139,40 @@ namespace OpieTooth { */ void BlueBase::readSavedDevices() { + QList *loadedDevices = new QList; + + Config deviceList( QDir::homeDirPath() + "/Settings/bluetooth/devicelist.conf", Config::File ); + + + // RemoteDevice *currentDevice = RemoteDevice( , ); + //loadedDevices->append( currentDevice ); + + addSearchedDevices( *loadedDevices ); } /* - * Read the list of allready known devices + * Write the list of allready known devices * */ void BlueBase::writeSavedDevices() { + QListViewItemIterator it( ListView2 ); + + // one top conf file with all decices (by mac adress) + Config deviceList( QDir::homeDirPath() + "/Settings/bluetooth/devicelist.conf", Config::File ); + for ( ; it.current(); ++it ) { + + // MAC adress as group + deviceList.setGroup( it.current()->text(1) ); + deviceList.writeEntry("inList", 1); + + // seperate config file for each device, to store more information in future. + + Config conf( QDir::homeDirPath() + "/Settings/bluetooth/" + (it.current()->text(1)) + ".conf", Config::File ); + conf.setGroup("Info"); + conf.writeEntry("name", it.current()->text(0) ); + } } @@ -165,7 +191,7 @@ namespace OpieTooth { passkeyLine->setText(defaultPasskey); // set info tab setInfo(); -} + } /** @@ -290,6 +316,7 @@ namespace OpieTooth { * Decontructor */ BlueBase::~BlueBase(){ + writeSavedDevices(); } } -- cgit v0.9.0.2