summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp11
1 files changed, 0 insertions, 11 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 6c17974..b31e14f 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -1,366 +1,355 @@
1/* 1/*
2 * bluebase.cpp * 2 * bluebase.cpp *
3 * --------------------- 3 * ---------------------
4 * 4 *
5 * copyright : (c) 2002 by Maximilian Rei� 5 * copyright : (c) 2002 by Maximilian Rei�
6 * email : max.reiss@gmx.de 6 * email : max.reiss@gmx.de
7 * 7 *
8 */ 8 */
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18#include "bluebase.h" 18#include "bluebase.h"
19#include "scandialog.h" 19#include "scandialog.h"
20#include "hciconfwrapper.h" 20#include "hciconfwrapper.h"
21#include "devicehandler.h" 21#include "devicehandler.h"
22#include "btconnectionitem.h" 22#include "btconnectionitem.h"
23 23
24#include <remotedevice.h> 24#include <remotedevice.h>
25#include <services.h> 25#include <services.h>
26 26
27#include <stdlib.h> 27#include <stdlib.h>
28 28
29#include <qframe.h> 29#include <qframe.h>
30#include <qlabel.h> 30#include <qlabel.h>
31#include <qpushbutton.h> 31#include <qpushbutton.h>
32#include <qlayout.h> 32#include <qlayout.h>
33#include <qvariant.h> 33#include <qvariant.h>
34#include <qimage.h> 34#include <qimage.h>
35#include <qpixmap.h> 35#include <qpixmap.h>
36#include <qtabwidget.h> 36#include <qtabwidget.h>
37#include <qscrollview.h> 37#include <qscrollview.h>
38#include <qvbox.h> 38#include <qvbox.h>
39#include <qmessagebox.h> 39#include <qmessagebox.h>
40#include <qcheckbox.h> 40#include <qcheckbox.h>
41#include <qlineedit.h> 41#include <qlineedit.h>
42#include <qlistview.h> 42#include <qlistview.h>
43#include <qdir.h> 43#include <qdir.h>
44#include <qpopupmenu.h> 44#include <qpopupmenu.h>
45#include <qtimer.h> 45#include <qtimer.h>
46 46
47#include <qpe/qpeapplication.h> 47#include <qpe/qpeapplication.h>
48#include <qpe/resource.h> 48#include <qpe/resource.h>
49#include <qpe/config.h> 49#include <qpe/config.h>
50 50
51 51
52using namespace OpieTooth; 52using namespace OpieTooth;
53 53
54BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) 54BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
55 : BluetoothBase( parent, name, fl ) { 55 : BluetoothBase( parent, name, fl ) {
56 56
57 m_localDevice = new Manager( "hci0" ); 57 m_localDevice = new Manager( "hci0" );
58 58
59 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); 59 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) );
60 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); 60 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) );
61 // not good since lib is async 61 // not good since lib is async
62 // connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ), 62 // connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ),
63 // this, SLOT( addServicesToDevice( QListViewItem * ) ) ); 63 // this, SLOT( addServicesToDevice( QListViewItem * ) ) );
64 connect( ListView2, SIGNAL( clicked( QListViewItem* )), 64 connect( ListView2, SIGNAL( clicked( QListViewItem* )),
65 this, SLOT( startServiceActionClicked( QListViewItem* ) ) ); 65 this, SLOT( startServiceActionClicked( QListViewItem* ) ) );
66 connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ), 66 connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ),
67 this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) ); 67 this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) );
68 connect( m_localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ), 68 connect( m_localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ),
69 this, SLOT( addServicesToDevice( const QString& , Services::ValueList ) ) ); 69 this, SLOT( addServicesToDevice( const QString& , Services::ValueList ) ) );
70 connect( m_localDevice, SIGNAL( available( const QString&, bool ) ), 70 connect( m_localDevice, SIGNAL( available( const QString&, bool ) ),
71 this, SLOT( deviceActive( const QString& , bool ) ) ); 71 this, SLOT( deviceActive( const QString& , bool ) ) );
72 connect( m_localDevice, SIGNAL( connections( ConnectionState::ValueList ) ), 72 connect( m_localDevice, SIGNAL( connections( ConnectionState::ValueList ) ),
73 this, SLOT( addConnectedDevices( ConnectionState::ValueList ) ) ); 73 this, SLOT( addConnectedDevices( ConnectionState::ValueList ) ) );
74 74
75 75
76 // let hold be rightButtonClicked() 76 // let hold be rightButtonClicked()
77 QPEApplication::setStylusOperation( ListView2->viewport(), QPEApplication::RightOnHold); 77 QPEApplication::setStylusOperation( ListView2->viewport(), QPEApplication::RightOnHold);
78 QPEApplication::setStylusOperation( ListView4->viewport(), QPEApplication::RightOnHold); 78 QPEApplication::setStylusOperation( ListView4->viewport(), QPEApplication::RightOnHold);
79 79
80 //Load all icons needed 80 //Load all icons needed
81 m_offPix = Resource::loadPixmap( "opietooth/notconnected" ); 81 m_offPix = Resource::loadPixmap( "opietooth/notconnected" );
82 m_onPix = Resource::loadPixmap( "opietooth/connected" ); 82 m_onPix = Resource::loadPixmap( "opietooth/connected" );
83 m_findPix = Resource::loadPixmap( "opietooth/find" ); 83 m_findPix = Resource::loadPixmap( "opietooth/find" );
84 84
85 QPalette pal = this->palette(); 85 QPalette pal = this->palette();
86 QColor col = pal.color( QPalette::Active, QColorGroup::Background ); 86 QColor col = pal.color( QPalette::Active, QColorGroup::Background );
87 pal.setColor( QPalette::Active, QColorGroup::Button, col ); 87 pal.setColor( QPalette::Active, QColorGroup::Button, col );
88 pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); 88 pal.setColor( QPalette::Inactive, QColorGroup::Button, col );
89 pal.setColor( QPalette::Normal, QColorGroup::Button, col ); 89 pal.setColor( QPalette::Normal, QColorGroup::Button, col );
90 pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); 90 pal.setColor( QPalette::Disabled, QColorGroup::Button, col );
91 this->setPalette( pal ); 91 this->setPalette( pal );
92 92
93 setCaption( tr( "Bluetooth Manager" ) ); 93 setCaption( tr( "Bluetooth Manager" ) );
94 94
95 readConfig(); 95 readConfig();
96 initGui(); 96 initGui();
97 97
98 //TESTING
99 ListView2->setRootIsDecorated(true); 98 ListView2->setRootIsDecorated(true);
100 99
101 BTDeviceItem *topLV2 = new BTDeviceItem( ListView2, RemoteDevice("xx:", "Siemens S45" ) );
102 topLV2->setPixmap( 1, m_onPix );
103 Services s1;
104 s1.setServiceName( "Serial" );
105 s1.insertClassId(1, "BlueNic");
106 (void) new BTServiceItem( topLV2, s1 );
107 s1.setServiceName( "BlueNic" );
108 s1.insertClassId(2, "Obex");
109 (void) new BTServiceItem( topLV2, s1 );
110
111 writeToHciConfig(); 100 writeToHciConfig();
112 // search conncetions 101 // search conncetions
113 addConnectedDevices(); 102 addConnectedDevices();
114 m_iconLoader = new BTIconLoader(); 103 m_iconLoader = new BTIconLoader();
115 readSavedDevices(); 104 readSavedDevices();
116} 105}
117 106
118/** 107/**
119 * Reads all options from the config file 108 * Reads all options from the config file
120 */ 109 */
121void BlueBase::readConfig() { 110void BlueBase::readConfig() {
122 111
123 Config cfg( "bluetoothmanager" ); 112 Config cfg( "bluetoothmanager" );
124 cfg.setGroup( "bluezsettings" ); 113 cfg.setGroup( "bluezsettings" );
125 114
126 m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with 115 m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with
127 m_defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak 116 m_defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak
128 m_useEncryption = cfg.readBoolEntry( "useEncryption" , TRUE ); 117 m_useEncryption = cfg.readBoolEntry( "useEncryption" , TRUE );
129 m_enableAuthentification = cfg.readBoolEntry( "enableAuthentification" , TRUE ); 118 m_enableAuthentification = cfg.readBoolEntry( "enableAuthentification" , TRUE );
130 m_enablePagescan = cfg.readBoolEntry( "enablePagescan" , TRUE ); 119 m_enablePagescan = cfg.readBoolEntry( "enablePagescan" , TRUE );
131 m_enableInquiryscan = cfg.readBoolEntry( "enableInquiryscan" , TRUE ); 120 m_enableInquiryscan = cfg.readBoolEntry( "enableInquiryscan" , TRUE );
132} 121}
133 122
134/** 123/**
135 * Writes all options to the config file 124 * Writes all options to the config file
136 */ 125 */
137void BlueBase::writeConfig() { 126void BlueBase::writeConfig() {
138 127
139 Config cfg( "bluetoothmanager" ); 128 Config cfg( "bluetoothmanager" );
140 cfg.setGroup( "bluezsettings" ); 129 cfg.setGroup( "bluezsettings" );
141 130
142 cfg.writeEntry( "name" , m_deviceName ); 131 cfg.writeEntry( "name" , m_deviceName );
143 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey ); 132 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey );
144 cfg.writeEntry( "useEncryption" , m_useEncryption ); 133 cfg.writeEntry( "useEncryption" , m_useEncryption );
145 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification ); 134 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification );
146 cfg.writeEntry( "enablePagescan" , m_enablePagescan ); 135 cfg.writeEntry( "enablePagescan" , m_enablePagescan );
147 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan ); 136 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan );
148 137
149 writeToHciConfig(); 138 writeToHciConfig();
150} 139}
151 140
152/** 141/**
153 * Modify the hcid.conf file to our needs 142 * Modify the hcid.conf file to our needs
154 */ 143 */
155void BlueBase::writeToHciConfig() { 144void BlueBase::writeToHciConfig() {
156 qWarning("writeToHciConfig"); 145 qWarning("writeToHciConfig");
157 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); 146 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" );
158 hciconf.load(); 147 hciconf.load();
159 hciconf.setPinHelper( "/bin/QtPalmtop/bin/blue-pin" ); 148 hciconf.setPinHelper( "/bin/QtPalmtop/bin/blue-pin" );
160 hciconf.setName( m_deviceName ); 149 hciconf.setName( m_deviceName );
161 hciconf.setEncrypt( m_useEncryption ); 150 hciconf.setEncrypt( m_useEncryption );
162 hciconf.setAuth( m_enableAuthentification ); 151 hciconf.setAuth( m_enableAuthentification );
163 hciconf.setPscan( m_enablePagescan ); 152 hciconf.setPscan( m_enablePagescan );
164 hciconf.setIscan( m_enableInquiryscan ); 153 hciconf.setIscan( m_enableInquiryscan );
165 hciconf.save(); 154 hciconf.save();
166} 155}
167 156
168 157
169/** 158/**
170 * Read the list of allready known devices 159 * Read the list of allready known devices
171 */ 160 */
172void BlueBase::readSavedDevices() { 161void BlueBase::readSavedDevices() {
173 162
174 QValueList<RemoteDevice> loadedDevices; 163 QValueList<RemoteDevice> loadedDevices;
175 DeviceHandler handler; 164 DeviceHandler handler;
176 loadedDevices = handler.load(); 165 loadedDevices = handler.load();
177 166
178 addSearchedDevices( loadedDevices ); 167 addSearchedDevices( loadedDevices );
179} 168}
180 169
181 170
182/** 171/**
183 * Write the list of allready known devices 172 * Write the list of allready known devices
184 */ 173 */
185void BlueBase::writeSavedDevices() { 174void BlueBase::writeSavedDevices() {
186 QListViewItemIterator it( ListView2 ); 175 QListViewItemIterator it( ListView2 );
187 BTListItem* item; 176 BTListItem* item;
188 BTDeviceItem* device; 177 BTDeviceItem* device;
189 RemoteDevice::ValueList list; 178 RemoteDevice::ValueList list;
190 for ( ; it.current(); ++it ) { 179 for ( ; it.current(); ++it ) {
191 item = (BTListItem*)it.current(); 180 item = (BTListItem*)it.current();
192 if(item->typeId() != BTListItem::Device ) 181 if(item->typeId() != BTListItem::Device )
193 continue; 182 continue;
194 device = (BTDeviceItem*)item; 183 device = (BTDeviceItem*)item;
195 184
196 list.append( device->remoteDevice() ); 185 list.append( device->remoteDevice() );
197 } 186 }
198 /* 187 /*
199 * if not empty save the List through DeviceHandler 188 * if not empty save the List through DeviceHandler
200 */ 189 */
201 if ( list.isEmpty() ) 190 if ( list.isEmpty() )
202 return; 191 return;
203 DeviceHandler handler; 192 DeviceHandler handler;
204 handler.save( list ); 193 handler.save( list );
205} 194}
206 195
207 196
208/** 197/**
209 * Set up the gui 198 * Set up the gui
210 */ 199 */
211void BlueBase::initGui() { 200void BlueBase::initGui() {
212 StatusLabel->setText( status() ); // maybe move it to getStatus() 201 StatusLabel->setText( status() ); // maybe move it to getStatus()
213 cryptCheckBox->setChecked( m_useEncryption ); 202 cryptCheckBox->setChecked( m_useEncryption );
214 authCheckBox->setChecked( m_enableAuthentification ); 203 authCheckBox->setChecked( m_enableAuthentification );
215 pagescanCheckBox->setChecked( m_enablePagescan ); 204 pagescanCheckBox->setChecked( m_enablePagescan );
216 inquiryscanCheckBox->setChecked( m_enableInquiryscan ); 205 inquiryscanCheckBox->setChecked( m_enableInquiryscan );
217 deviceNameLine->setText( m_deviceName ); 206 deviceNameLine->setText( m_deviceName );
218 passkeyLine->setText( m_defaultPasskey ); 207 passkeyLine->setText( m_defaultPasskey );
219 // set info tab 208 // set info tab
220 setInfo(); 209 setInfo();
221} 210}
222 211
223 212
224/** 213/**
225 * Get the status informations and returns it 214 * Get the status informations and returns it
226 * @return QString the status informations gathered 215 * @return QString the status informations gathered
227 */ 216 */
228QString BlueBase::status()const{ 217QString BlueBase::status()const{
229 QString infoString = tr( "<b>Device name : </b> Ipaq" ); 218 QString infoString = tr( "<b>Device name : </b> Ipaq" );
230 infoString += QString( "<br><b>" + tr( "MAC adress: " ) +"</b> No idea" ); 219 infoString += QString( "<br><b>" + tr( "MAC adress: " ) +"</b> No idea" );
231 infoString += QString( "<br><b>" + tr( "Class" ) + "</b> PDA" ); 220 infoString += QString( "<br><b>" + tr( "Class" ) + "</b> PDA" );
232 221
233 return (infoString); 222 return (infoString);
234} 223}
235 224
236 225
237/** 226/**
238 * Read the current values from the gui and invoke writeConfig() 227 * Read the current values from the gui and invoke writeConfig()
239 */ 228 */
240void BlueBase::applyConfigChanges() { 229void BlueBase::applyConfigChanges() {
241 m_deviceName = deviceNameLine->text(); 230 m_deviceName = deviceNameLine->text();
242 m_defaultPasskey = passkeyLine->text(); 231 m_defaultPasskey = passkeyLine->text();
243 m_useEncryption = cryptCheckBox->isChecked(); 232 m_useEncryption = cryptCheckBox->isChecked();
244 m_enableAuthentification = authCheckBox->isChecked(); 233 m_enableAuthentification = authCheckBox->isChecked();
245 m_enablePagescan = pagescanCheckBox->isChecked(); 234 m_enablePagescan = pagescanCheckBox->isChecked();
246 m_enableInquiryscan = inquiryscanCheckBox->isChecked(); 235 m_enableInquiryscan = inquiryscanCheckBox->isChecked();
247 236
248 writeConfig(); 237 writeConfig();
249 238
250 QMessageBox::information( this, tr("Test") , tr("Changes were applied.") ); 239 QMessageBox::information( this, tr("Test") , tr("Changes were applied.") );
251} 240}
252 241
253/** 242/**
254 * Add fresh found devices from scan dialog to the listing 243 * Add fresh found devices from scan dialog to the listing
255 * 244 *
256 */ 245 */
257void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) { 246void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) {
258 BTDeviceItem * deviceItem; 247 BTDeviceItem * deviceItem;
259 QValueList<RemoteDevice>::ConstIterator it; 248 QValueList<RemoteDevice>::ConstIterator it;
260 249
261 for( it = newDevices.begin(); it != newDevices.end() ; ++it ) { 250 for( it = newDevices.begin(); it != newDevices.end() ; ++it ) {
262 251
263 if (find( (*it) )) // is already inserted 252 if (find( (*it) )) // is already inserted
264 continue; 253 continue;
265 254
266 deviceItem = new BTDeviceItem( ListView2 , (*it) ); 255 deviceItem = new BTDeviceItem( ListView2 , (*it) );
267 deviceItem->setPixmap( 1, m_findPix ); 256 deviceItem->setPixmap( 1, m_findPix );
268 deviceItem->setExpandable ( true ); 257 deviceItem->setExpandable ( true );
269 258
270 // look if device is avail. atm, async 259 // look if device is avail. atm, async
271 deviceActive( (*it) ); 260 deviceActive( (*it) );
272 261
273 // ggf auch hier? 262 // ggf auch hier?
274 addServicesToDevice( deviceItem ); 263 addServicesToDevice( deviceItem );
275 } 264 }
276} 265}
277 266
278 267
279/** 268/**
280 * Action that is toggled on entrys on click 269 * Action that is toggled on entrys on click
281 */ 270 */
282void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) { 271void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) {
283} 272}
284 273
285 274
286/** 275/**
287 * Action that are toggled on hold (mostly QPopups i guess) 276 * Action that are toggled on hold (mostly QPopups i guess)
288 */ 277 */
289void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) { 278void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) {
290 if (!item ) 279 if (!item )
291 return; 280 return;
292 281
293 QPopupMenu *menu = new QPopupMenu(); 282 QPopupMenu *menu = new QPopupMenu();
294 int ret=0; 283 int ret=0;
295 284
296 if ( ((BTListItem*)item)->type() == "device") { 285 if ( ((BTListItem*)item)->type() == "device") {
297 286
298 QPopupMenu *groups = new QPopupMenu(); 287 QPopupMenu *groups = new QPopupMenu();
299 288
300 menu->insertItem( ((BTDeviceItem*)item)->name(),0 ); 289 menu->insertItem( ((BTDeviceItem*)item)->name(),0 );
301 menu->insertSeparator(1); 290 menu->insertSeparator(1);
302 menu->insertItem( tr("rescan sevices"), 2); 291 menu->insertItem( tr("rescan sevices"), 2);
303 menu->insertItem( tr("to group"), groups , 3); 292 menu->insertItem( tr("to group"), groups , 3);
304 menu->insertItem( tr("delete"), 4); 293 menu->insertItem( tr("delete"), 4);
305 294
306 ret = menu->exec( point , 0); 295 ret = menu->exec( point , 0);
307 296
308 switch(ret) { 297 switch(ret) {
309 case -1: 298 case -1:
310 break; 299 break;
311 case 0: 300 case 0:
312 addServicesToDevice( (BTDeviceItem*)item ); 301 addServicesToDevice( (BTDeviceItem*)item );
313 break; 302 break;
314 case 1: 303 case 1:
315 304
316 break; 305 break;
317 306
318 // NO need to, since hcid does that on the fly 307 // NO need to, since hcid does that on the fly
319 // case 2: 308 // case 2:
320 // make connection 309 // make connection
321 //m_localDevice->connectTo( ((BTDeviceItem*)item)->mac() ); 310 //m_localDevice->connectTo( ((BTDeviceItem*)item)->mac() );
322 //break; 311 //break;
323 case 3: 312 case 3:
324 // deletes childs too 313 // deletes childs too
325 delete item; 314 delete item;
326 break; 315 break;
327 } 316 }
328 delete groups; 317 delete groups;
329 318
330 } 319 }
331 320
332 /* 321 /*
333 * We got service sensitive PopupMenus in our factory 322 * We got service sensitive PopupMenus in our factory
334 * We will create one through the factory and will insert 323 * We will create one through the factory and will insert
335 * our Separator + ShowInfo into the menu or create a new 324 * our Separator + ShowInfo into the menu or create a new
336 * one if the factory returns 0 325 * one if the factory returns 0
337 * PopupMenu deletion is kind of weird. 326 * PopupMenu deletion is kind of weird.
338 * If escaped( -1 ) or any of our items were chosen we'll 327 * If escaped( -1 ) or any of our items were chosen we'll
339 * delete the PopupMenu otherwise it's the responsibility of 328 * delete the PopupMenu otherwise it's the responsibility of
340 * the PopupMenu to delete itself 329 * the PopupMenu to delete itself
341 * 330 *
342 */ 331 */
343 else if ( ((BTListItem*)item)->type() == "service") { 332 else if ( ((BTListItem*)item)->type() == "service") {
344 BTServiceItem* service = (BTServiceItem*)item; 333 BTServiceItem* service = (BTServiceItem*)item;
345 QMap<int, QString> list = service->services().classIdList(); 334 QMap<int, QString> list = service->services().classIdList();
346 QMap<int, QString>::Iterator it = list.begin(); 335 QMap<int, QString>::Iterator it = list.begin();
347 QPopupMenu *popup =0l; 336 QPopupMenu *popup =0l;
348 if ( it != list.end() ) { 337 if ( it != list.end() ) {
349 qWarning("Searching id %d %s", it.key(), it.data().latin1() ); 338 qWarning("Searching id %d %s", it.key(), it.data().latin1() );
350 popup = m_popHelper.find( it.key() /*1*/, 339 popup = m_popHelper.find( it.key() /*1*/,
351 service->services(), 340 service->services(),
352 (BTDeviceItem*)service->parent() ); 341 (BTDeviceItem*)service->parent() );
353 }else { 342 }else {
354 qWarning("Empty"); 343 qWarning("Empty");
355 } 344 }
356 345
357 if ( popup == 0l ) { 346 if ( popup == 0l ) {
358 qWarning("factory returned 0l"); 347 qWarning("factory returned 0l");
359 popup = new QPopupMenu(); 348 popup = new QPopupMenu();
360 } 349 }
361 int test1 = popup->insertItem( tr("Test1:"), 2); 350 int test1 = popup->insertItem( tr("Test1:"), 2);
362 351
363 ret = popup->exec( point ); 352 ret = popup->exec( point );
364 qWarning("returned from exec() "); 353 qWarning("returned from exec() ");
365 if ( ret == -1 ) { 354 if ( ret == -1 ) {
366 ; 355 ;