#define AGENTADAPTOR_H
#include <QDBusAbstractAdaptor>
-#include "bluetoothagent.h"
+#include "bluetoothbaseagent.h"
class AgentAdaptor : public QDBusAbstractAdaptor
{
!exists(headset.h):system(qdbusxml2cpp -p headset.h:headset.cpp headset.xml)
include(obex/obex.pri)
+TEMPLATE = lib
+TARGET = bluetooth-qt
+QT += dbus
+CONFIG += link_pkgconfig \
+ debug
+OTHER_FILES += McpBluetooth.conf \
+ manager.xml \
+ device.xml \
+ audiosrc.xml \
+ audiosink.xml \
+ adapter.xml \
+ headset.xml
+HEADERS += agentadaptor.h \
+ bluemanager.h \
+ bluedevice.h \
+ blueadapter.h \
+ audiosource.h \
+ audiosink.h \
+ headset.h \
+ btprofiles.h \
+ nearbydevicesmodel.h \
+ bluetoothbaseagent.h \
+ asyncagent.h \
+ devicetypes.h
+SOURCES += agentadaptor.cpp \
+ bluemanager.cpp \
+ bluedevice.cpp \
+ blueadapter.cpp \
+ audiosource.cpp \
+ audiosink.cpp \
+ headset.cpp \
+ nearbydevicesmodel.cpp \
+ bluetoothbaseagent.cpp \
+ asyncagent.cpp
+
+target.path = $$INSTALL_ROOT/usr/lib
+headers.path = $$INSTALL_ROOT/usr/include/bluetooth-qt/
+headers.files = $$HEADERS
+INSTALLS += target \
+ headers
+
+CONFIG += create_pc create_prl
+QMAKE_PKGCONFIG_DESCRIPTION = Qt Bluetooth Library
+QMAKE_PKGCONFIG_INCDIR = $$headers.path
+pkgconfig.path = $$INSTALL_ROOT/usr/lib/pkgconfig
+pkgconfig.files = bluetooth-qt.pc
+
+INSTALLS += pkgconfig
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/tripzero/src/bluetooth-qt-build-desktop</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">false</value>
</valuemap>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
--- /dev/null
+/* -*- Mode: C++ -*-
+ *
+ * meego handset bluetooth
+ * Copyright © 2010, Intel Corporation.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0. The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+
+
+
+#ifndef _DEVICETYPES_H_
+#define _DEVICETYPES_H_
+
+#include <QMap>
+
+typedef QMap<uint,QString> UIntStringMap;
+Q_DECLARE_METATYPE(UIntStringMap)
+
+
+
+#endif
#include "nearbydevicesmodel.h"
-#include "bluetoothagent.h"
+#include "bluetoothbaseagent.h"
NearbyDevicesModel::NearbyDevicesModel(QObject *parent) :
QAbstractListModel(parent), adapter(NULL), agent(NULL)
connect(manager,SIGNAL(AdapterAdded(QDBusObjectPath)),this,SLOT(adapterAdded(QDBusObjectPath)));
connect(manager,SIGNAL(AdapterRemoved(QDBusObjectPath)),this,SLOT(adapterRemoved(QDBusObjectPath)));
adapterAdded(QDBusObjectPath());
+
+ QHash<int,QByteArray> roles;
+ roles[Qt::DisplayRole]="name";
+
+ setRoleNames(roles);
}
//qDebug()<<"new object created: "<<object.path();
}
-void NearbyDevicesModel::discover()
+void NearbyDevicesModel::discover(bool start)
{
- adapter->StartDiscovery();
+ if(start)
+ adapter->StartDiscovery();
+ else adapter->StopDiscovery();
}
void NearbyDevicesModel::removeAll(bool)
if(!found)
{
- beginInsertRows(QModelIndex(), 0, devicepathlist.size());
devicepathlist.append(hwaddy);
+ beginInsertRows(QModelIndex(), devicepathlist.size(), devicepathlist.size());
deviceAliasMap[hwaddy] = properties["Alias"].toString();
emit nearbyDeviceFound(devicepathlist.indexOf(hwaddy));
endInsertRows();
int i=-1;
if((i = devicepathlist.indexOf(hwaddy)) >=0)
{
- beginRemoveRows(QModelIndex(),i,i+1);
+ beginRemoveRows(QModelIndex(),i,i);
devicepathlist.removeAt(i);
emit nearbyDeviceRemoved(i);
- endInsertRows();
+ endRemoveRows();
}
}
QString hwAddress(int index) { return devicepathlist[index]; }
QString alias(int index){ return deviceAliasMap[devicepathlist[index]]; }
void pair(QString hwaddy);
- void discover();
+ void discover(bool start);
void removeAll(bool);
void replyRequestConfirmation(bool confirmed);