Search
SailfishOS Open Build Service
>
Projects
>
zephyr
:
devel:mw
>
bluetooth-qt
> qt5-build.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File qt5-build.patch of Package bluetooth-qt
diff --git a/bluetooth-qt/bluetoothdevicemodel.cpp b/bluetooth-qt/bluetoothdevicemodel.cpp index 4fdd2b4..fbab70c 100644 --- a/bluetooth-qt/bluetoothdevicemodel.cpp +++ b/bluetooth-qt/bluetoothdevicemodel.cpp @@ -22,8 +22,6 @@ BluetoothDevicesModel::BluetoothDevicesModel(QObject *parent) : connect(manager,SIGNAL(AdapterRemoved(QDBusObjectPath)),this,SLOT(adapterRemoved(QDBusObjectPath))); adapterAdded(QDBusObjectPath()); - QHash<int, QByteArray> roles; - QMetaObject properties = BluetoothDevice::staticMetaObject; for(int i=0; i<properties.propertyCount();i++) @@ -33,7 +31,11 @@ BluetoothDevicesModel::BluetoothDevicesModel(QObject *parent) : roles[roles.keys().count()+1] = "bluetoothDevice"; - setRoleNames(roles); +} + +QHash<int, QByteArray> BluetoothDevicesModel::roleNames() const +{ + return roles; } int BluetoothDevicesModel::rowCount(const QModelIndex &) const diff --git a/bluetooth-qt/bluetoothdevicemodel.h b/bluetooth-qt/bluetoothdevicemodel.h index 8a393cd..db9ee36 100644 --- a/bluetooth-qt/bluetoothdevicemodel.h +++ b/bluetooth-qt/bluetoothdevicemodel.h @@ -21,6 +21,8 @@ public: bool adapterPresent() { return adapter != NULL; } + QHash<int, QByteArray> roleNames() const; + public slots: int columnCount(const QModelIndex &) const { return 1; } @@ -65,6 +67,7 @@ private: OrgBluezManagerInterface *manager; OrgBluezAdapterInterface *adapter; QList<BluetoothDevice*> m_devices; + QHash<int, QByteArray> roles; }; #endif // BLUETOOTHDEVICEMODEL_H diff --git a/bluetooth-qt/nearbydevicesmodel.cpp b/bluetooth-qt/nearbydevicesmodel.cpp index 1e6d4fc..f480d61 100644 --- a/bluetooth-qt/nearbydevicesmodel.cpp +++ b/bluetooth-qt/nearbydevicesmodel.cpp @@ -23,15 +23,17 @@ NearbyDevicesModel::NearbyDevicesModel(QObject *parent) : connect(manager,SIGNAL(AdapterRemoved(QDBusObjectPath)),this,SLOT(adapterRemoved(QDBusObjectPath))); adapterAdded(QDBusObjectPath()); - QHash<int,QByteArray> roles; QMetaObject properties = NearbyItem::staticMetaObject; for(int i=0; i<properties.propertyCount();i++) { roles[i]=properties.property(i).name(); } - setRoleNames(roles); } +QHash<int, QByteArray> NearbyDevicesModel::roleNames() const +{ + return roles; +} int NearbyDevicesModel::rowCount(const QModelIndex &parent) const { @@ -111,7 +113,7 @@ void NearbyDevicesModel::replyRequestPidCode(QString pidCode) void NearbyDevicesModel::setAdapterProperty(QString name, QVariant value) { - if(adapter) adapter->setProperty(name.toAscii().data(),value); + if(adapter) adapter->setProperty(name.toLatin1().data(),value); } void NearbyDevicesModel::deviceCreated(QString hwaddy, QVariantMap properties) diff --git a/bluetooth-qt/nearbydevicesmodel.h b/bluetooth-qt/nearbydevicesmodel.h index 7de241b..be21e18 100644 --- a/bluetooth-qt/nearbydevicesmodel.h +++ b/bluetooth-qt/nearbydevicesmodel.h @@ -69,6 +69,7 @@ public: NearbyDevicesModel(QObject *parent = 0); BluetoothDevice* pairingDevice() { if(agent) return agent->device(); else return NULL; } + QHash<int, QByteArray> roleNames() const; public slots: @@ -112,6 +113,7 @@ private: OrgBluezManagerInterface *manager; OrgBluezAdapterInterface *adapter; AsyncAgent* agent; + QHash<int,QByteArray> roles; }; #endif // NEARBYDEVICESMODEL_H diff --git a/declarative/components.cpp b/declarative/components.cpp index 57df6d4..dbd4707 100644 --- a/declarative/components.cpp +++ b/declarative/components.cpp @@ -6,6 +6,7 @@ * http://www.apache.org/licenses/LICENSE-2.0 */ +#include <QtQml> #include "components.h" #include <nearbydevicesmodel.h> @@ -19,10 +20,10 @@ void Components::registerTypes(const char *uri) qmlRegisterType<BluetoothDevicesModel>(uri,0,0,"BluetoothDevicesModel"); } -void Components::initializeEngine(QDeclarativeEngine *engine, const char *uri) +void Components::initializeEngine(QQmlEngine *engine, const char *uri) { Q_UNUSED(uri); Q_UNUSED(engine); } -Q_EXPORT_PLUGIN(Components); +//Q_EXPORT_PLUGIN2(Components, Components); diff --git a/declarative/components.h b/declarative/components.h index 5e3813b..c4d7e7b 100644 --- a/declarative/components.h +++ b/declarative/components.h @@ -9,16 +9,16 @@ #ifndef COMPONENTS_H #define COMPONENTS_H -#include <QtDeclarative/qdeclarative.h> -#include <QtDeclarative/QDeclarativeExtensionPlugin> +#include <QQmlEngine> +#include <QQmlExtensionPlugin> -class Components : public QDeclarativeExtensionPlugin +class Components : public QQmlExtensionPlugin { Q_OBJECT - + Q_PLUGIN_METADATA( IID "org.merproject.nemo" ) public: void registerTypes(const char *uri); - void initializeEngine(QDeclarativeEngine *engine, const char *uri); + void initializeEngine(QQmlEngine *engine, const char *uri); }; #endif // COMPONENTS_H diff --git a/declarative/declarative.pro b/declarative/declarative.pro index b359159..8e0f8e2 100644 --- a/declarative/declarative.pro +++ b/declarative/declarative.pro @@ -1,5 +1,5 @@ TEMPLATE = lib -QT += declarative dbus +QT += quick dbus qml CONFIG += qt \ plugin \