-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 @@ -80,5 +80,4 @@ namespace OpieTooth { initGui(); - //TESTING ListView2->setRootIsDecorated(true); @@ -135,10 +134,23 @@ namespace OpieTooth { 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 ); } @@ -192,5 +204,4 @@ namespace OpieTooth { return (infoString); - } @@ -213,5 +224,4 @@ namespace OpieTooth { box->setText( tr( "Changes applied" ) ); box->show(); - // falls nötig hcid killhupen - die funktionalität adden } @@ -262,5 +272,4 @@ namespace OpieTooth { void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int column ) { - } @@ -306,6 +315,4 @@ namespace OpieTooth { QValueList<OpieTooth::Services>::Iterator it2; - - QListViewItem * serviceItem; @@ -333,5 +340,4 @@ namespace OpieTooth { // search by mac - // localDevice->isAvailable( device->mac() ); @@ -366,5 +372,4 @@ namespace OpieTooth { writeSavedDevices(); } - } |