author | harlekin <harlekin> | 2002-06-23 09:10:55 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-06-23 09:10:55 (UTC) |
commit | 1d773d5df7038410c498d38a68a9569c1350975a (patch) (side-by-side diff) | |
tree | a14334997864cf5b01302e9aa05c0c09c72a86b3 | |
parent | e9f053439c8409ea2e1e57de9bf6f764f994b222 (diff) | |
download | opie-1d773d5df7038410c498d38a68a9569c1350975a.zip opie-1d773d5df7038410c498d38a68a9569c1350975a.tar.gz opie-1d773d5df7038410c498d38a68a9569c1350975a.tar.bz2 |
small load save update
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 5d742b7..cc51405 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp @@ -78,9 +78,8 @@ namespace OpieTooth { readConfig(); initGui(); - //TESTING ListView2->setRootIsDecorated(true); QListViewItem *topLV2 = new QListViewItem( ListView2, "Siemens S45" , "no" ); @@ -133,14 +132,27 @@ namespace OpieTooth { void BlueBase::readSavedDevices() { QList<RemoteDevice> *loadedDevices = new QList<RemoteDevice>; - Config deviceListSave( QDir::homeDirPath() + "/Settings/bluetooth/devicelist.conf", Config::File ); + 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. - // RemoteDevice *currentDevice = RemoteDevice( , ); - //loadedDevices->append( currentDevice ); + 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 ); } /** @@ -190,9 +202,8 @@ namespace OpieTooth { infoString += QString( "<br><b>" + tr( "MAC adress: " ) +"</b> No idea" ); infoString += QString( "<br><b>" + tr( "Class" ) + "</b> PDA" ); return (infoString); - } /** @@ -211,9 +222,8 @@ namespace OpieTooth { QMessageBox* box = new QMessageBox( this, "Test" ); box->setText( tr( "Changes applied" ) ); box->show(); - // falls nötig hcid killhupen - die funktionalität adden } @@ -260,9 +270,8 @@ namespace OpieTooth { * Action that are toggled on hold (mostly QPopups i guess) */ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int column ) { - } /** * Search and display avail. services for a device (on expand from device listing) @@ -304,10 +313,8 @@ namespace OpieTooth { } QValueList<OpieTooth::Services>::Iterator it2; - - QListViewItem * serviceItem; for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) { serviceItem = new QListViewItem( deviceItem , (*it2).serviceName() ); @@ -331,9 +338,8 @@ namespace OpieTooth { */ bool BlueBase::deviceActive( RemoteDevice *device ) { // search by mac - // localDevice->isAvailable( device->mac() ); return true; } @@ -364,7 +370,6 @@ namespace OpieTooth { */ BlueBase::~BlueBase() { writeSavedDevices(); } - } |