[kmobiletools] branches/kmobiletools/kmobiletools-0.5/kmobiletools/mainpart
Marco Gulino
marco at kmobiletools.org
Mon Jun 4 12:15:59 CEST 2007
SVN commit 671255 by gulino:
Setting the right URL for kdebluetooth-dbus too.
M +1 -0 bluetoothitems.h
M +19 -10 newdevicewizard.cpp
--- branches/kmobiletools/kmobiletools-0.5/kmobiletools/mainpart/bluetoothitems.h #671254:671255
@@ -87,6 +87,7 @@
public:
BtServiceItem(KListView *parent, const KBluetooth::ServiceRecord& service);
KBluetooth::ServiceRecord p_service;
+ RemoteDevice *device;
};
#endif
--- branches/kmobiletools/kmobiletools-0.5/kmobiletools/mainpart/newdevicewizard.cpp #671254:671255
@@ -49,17 +49,16 @@
#ifdef HAVE_KBLUETOOTH
#define useBT (selBT && ( BTItem || !manualSVC->isChecked() ) )
#define selBT ( btenable->isOn())
+#define BTItem ((BtServiceItem*)btsvcLV->selectedItem())
#else
#define selBT false
#define useBT false
#endif
#ifdef KBLUETOOTH
#include <kdebluetooth/namerequest.h>
-#define BTItem ((BtServiceItem*)btsvcLV->selectedItem())
#endif
#ifdef KBLUETOOTH_NEW
#include "bluemonitor.h"
-#define BTItem (btsvcLV->selectedItem())
#endif
#include "kmobiletools_devices.h"
@@ -262,7 +261,7 @@
if(! bturl.isNull())
kcfg_atdevices->insertItem(bturl);
}
-#ifdef KBLUETOOTH
+#ifdef HAVE_KBLUETOOTH
else
{
BtServiceItem *bitem;
@@ -271,8 +270,13 @@
{
bitem=(BtServiceItem*)it.current();
kcfg_atdevices->insertItem(QString("bluetooth://[%1]:%2").arg(
- bitem->bdAddr() ).arg(
- bitem->text(0)) );
+#ifdef KBLUETOOTH
+ bitem->bdAddr()
+#endif
+#ifdef KBLUETOOTH_NEW
+ bitem->device->getAddr()
+#endif
+ ).arg( bitem->text(0)) );
++it;
}
}
@@ -541,7 +545,7 @@
void newDeviceWizard::btScanFinished()
{
-#ifdef KBLUETOOTH
+#ifdef HAVE_KBLUETOOTH
// delete inquiry;
// delete progress;
if(btenable->isChecked () && ! btDevicesLV->selectedItem() )
@@ -591,7 +595,7 @@
#ifdef KBLUETOOTH_NEW
kdDebug() << "bluetooth_new services count: " << bitem->device()->hservices.size() << endl;
for(uint i=0; i<bitem->device()->hservices.size(); i++)
- new BtServiceItem(btsvcLV, *(bitem->device()->hservices.at(i)) );
+ (new BtServiceItem(btsvcLV, *(bitem->device()->hservices.at(i)) ))->device=bitem->device();
#endif
setNextEnabled(currentPage(), true);
#endif
@@ -599,14 +603,19 @@
void newDeviceWizard::btServiceClicked(QListViewItem* item)
{
-#ifdef KBLUETOOTH
+#ifdef HAVE_KBLUETOOTH
bturl=QString::null;
if(!item) return;
BtServiceItem* bitem=(BtServiceItem*)(item);
setNextEnabled ( currentPage(), (!btenable->isOn()) || (btsvcLV->selectedItem()!=0) );
bturl=QString("bluetooth://[%1]:%2").arg(
- bitem->bdAddr() ).arg(
- bitem->text(0));
+#ifdef KBLUETOOTH
+ bitem->bdAddr()
+#endif
+#ifdef KBLUETOOTH_NEW
+ bitem->device->getAddr()
+#endif
+ ).arg( bitem->text(0) );
kdDebug() << "Selected bluetooth device: \"" << bturl << "\"" << endl;
#endif
}
More information about the kmobiletools
mailing list