Diffstat (limited to 'noncore/net/opietooth/manager/devicehandler.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/devicehandler.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/net/opietooth/manager/devicehandler.cpp b/noncore/net/opietooth/manager/devicehandler.cpp index 9c5b817..bd34351 100644 --- a/noncore/net/opietooth/manager/devicehandler.cpp +++ b/noncore/net/opietooth/manager/devicehandler.cpp | |||
@@ -24,31 +24,31 @@ QString path = QDir::homeDirPath() + "/Settings/bluetooth"; | |||
24 | QStringList devicesFileList = deviceListSave.entryList(); | 24 | QStringList devicesFileList = deviceListSave.entryList(); |
25 | 25 | ||
26 | 26 | ||
27 | // cut .conf of to get the mac and also read the name entry in it. | 27 | // cut .conf of to get the mac and also read the name entry in it. |
28 | if (!devicesFileList.isEmpty() ) { | 28 | if (!devicesFileList.isEmpty() ) { |
29 | QString name; | 29 | QString name; |
30 | QString mac; | 30 | QString mac; |
31 | QStringList::Iterator it; | 31 | QStringList::Iterator it; |
32 | for (it = devicesFileList.begin(); it != devicesFileList.end(); ++it ) { | 32 | for (it = devicesFileList.begin(); it != devicesFileList.end(); ++it ) { |
33 | if ( (*it) == "." || (*it) == ".." ) | 33 | if ( (*it) == "." || (*it) == ".." ) |
34 | continue; | 34 | continue; |
35 | 35 | ||
36 | qDebug((*it).latin1() ); | 36 | odebug << (*it).latin1() << oendl; |
37 | Config conf(path + "/"+(*it), Config::File); | 37 | Config conf(path + "/"+(*it), Config::File); |
38 | conf.setGroup("Info"); | 38 | conf.setGroup("Info"); |
39 | name = conf.readEntry("name", "Error"); | 39 | name = conf.readEntry("name", "Error"); |
40 | mac = conf.readEntry("mac", QString::null); | 40 | mac = conf.readEntry("mac", QString::null); |
41 | qDebug("MAC: " + mac); | 41 | odebug << "MAC: " + mac << oendl; |
42 | qDebug("NAME: " + name); | 42 | odebug << "NAME: " + name << oendl; |
43 | if (mac.isEmpty() ) | 43 | if (mac.isEmpty() ) |
44 | continue; | 44 | continue; |
45 | RemoteDevice currentDevice( mac , name ); | 45 | RemoteDevice currentDevice( mac , name ); |
46 | list.append( currentDevice ); | 46 | list.append( currentDevice ); |
47 | } | 47 | } |
48 | } | 48 | } |
49 | return list; | 49 | return list; |
50 | }; | 50 | }; |
51 | /* | 51 | /* |
52 | * This is some how rude but make sure all old devices | 52 | * This is some how rude but make sure all old devices |
53 | * are getting deleted | 53 | * are getting deleted |
54 | */ | 54 | */ |
@@ -57,31 +57,31 @@ void DeviceHandler::save( const RemoteDevice::ValueList& list) { | |||
57 | rm += "rm -rf "; | 57 | rm += "rm -rf "; |
58 | rm += QDir::homeDirPath() + "/Settings/bluetooth"; | 58 | rm += QDir::homeDirPath() + "/Settings/bluetooth"; |
59 | system ( rm.data() ); | 59 | system ( rm.data() ); |
60 | 60 | ||
61 | if (list.isEmpty() ) // no need to create the dir | 61 | if (list.isEmpty() ) // no need to create the dir |
62 | return; | 62 | return; |
63 | 63 | ||
64 | /** | 64 | /** |
65 | * Create a new dir | 65 | * Create a new dir |
66 | */ | 66 | */ |
67 | rm = "mkdir "; | 67 | rm = "mkdir "; |
68 | rm += QDir::homeDirPath() + "/Settings/bluetooth"; | 68 | rm += QDir::homeDirPath() + "/Settings/bluetooth"; |
69 | qWarning("out %s", rm.data() ); | 69 | owarn << "out " << rm.data() << "" << oendl; |
70 | system( rm.data() ); | 70 | system( rm.data() ); |
71 | 71 | ||
72 | RemoteDevice::ValueList::ConstIterator it; | 72 | RemoteDevice::ValueList::ConstIterator it; |
73 | // write the config | 73 | // write the config |
74 | 74 | ||
75 | for ( it = list.begin(); it != list.end(); ++it ) { | 75 | for ( it = list.begin(); it != list.end(); ++it ) { |
76 | qDebug( "/Settings/bluetooth/" + (*it).mac() + ".conf"); | 76 | odebug << "/Settings/bluetooth/" + (*it).mac() + ".conf" << oendl; |
77 | 77 | ||
78 | Config conf( QDir::homeDirPath() + | 78 | Config conf( QDir::homeDirPath() + |
79 | "/Settings/bluetooth/" + | 79 | "/Settings/bluetooth/" + |
80 | (*it).mac() + ".conf", Config::File ); | 80 | (*it).mac() + ".conf", Config::File ); |
81 | 81 | ||
82 | conf.setGroup( "Info" ); | 82 | conf.setGroup( "Info" ); |
83 | conf.writeEntry( "name", (*it).name() ); | 83 | conf.writeEntry( "name", (*it).name() ); |
84 | conf.writeEntry( "mac", (*it).mac() ); | 84 | conf.writeEntry( "mac", (*it).mac() ); |
85 | } | 85 | } |
86 | 86 | ||
87 | } | 87 | } |