diff options
Diffstat (limited to 'pbap')
-rw-r--r-- | pbap/CMakeLists.txt | 2 | ||||
-rw-r--r-- | pbap/pbap.cpp | 25 | ||||
-rw-r--r-- | pbap/pbap.h | 14 |
3 files changed, 20 insertions, 21 deletions
diff --git a/pbap/CMakeLists.txt b/pbap/CMakeLists.txt index 04f9c67..480661a 100644 --- a/pbap/CMakeLists.txt +++ b/pbap/CMakeLists.txt @@ -8,7 +8,7 @@ add_library(qtappfw-bt-pbap SHARED pbap.cpp) target_include_directories(qtappfw-bt-pbap PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(qtappfw-bt-pbap PUBLIC "${CMAKE_INSTALL_INCLUDEDIR}") -target_link_libraries(qtappfw-bt-pbap qtappfw-core) +target_link_libraries(qtappfw-bt-pbap Qt5::Qml) set_target_properties(qtappfw-bt-pbap PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION 1 diff --git a/pbap/pbap.cpp b/pbap/pbap.cpp index a3bde48..7473c54 100644 --- a/pbap/pbap.cpp +++ b/pbap/pbap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Konsulko Group + * Copyright (C) 2018-2020,2022 Konsulko Group * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,13 +18,8 @@ #include <QMetaEnum> #include <QMimeDatabase> #include <QtQml/QQmlEngine> +#include <QJsonObject> -#include "callmessage.h" -#include "eventmessage.h" -#include "responsemessage.h" -#include "messagefactory.h" -#include "messageengine.h" -#include "messageenginefactory.h" #include "pbap.h" @@ -81,19 +76,23 @@ int RecentCall::stringToEnum(QString key) return (value < 0) ? 0 : value; } -Pbap::Pbap (QUrl &url, QQmlContext *context, QObject * parent) : +Pbap::Pbap (QQmlContext *context, QObject * parent) : QObject(parent) { +#if 0 m_mloop = MessageEngineFactory::getInstance().getMessageEngine(url); +#endif m_context = context; m_context->setContextProperty("ContactsModel", QVariant::fromValue(m_contacts)); qmlRegisterUncreatableType<PhoneNumber>("PhoneNumber", 1, 0, "PhoneNumber", "Enum"); m_context->setContextProperty("RecentCallModel", QVariant::fromValue(m_calls)); qmlRegisterUncreatableType<RecentCall>("RecentCall", 1, 0, "RecentCall", "Enum"); +#if 0 QObject::connect(m_mloop.get(), &MessageEngine::connected, this, &Pbap::onConnected); QObject::connect(m_mloop.get(), &MessageEngine::disconnected, this, &Pbap::onDisconnected); QObject::connect(m_mloop.get(), &MessageEngine::messageReceived, this, &Pbap::onMessageReceived); +#endif } Pbap::~Pbap() @@ -102,6 +101,7 @@ Pbap::~Pbap() void Pbap::importContacts(int max_entries) { +#if 0 std::unique_ptr<Message> msg = MessageFactory::getInstance().createOutboundMessage(MessageId::Call); if (!msg) return; @@ -111,10 +111,12 @@ void Pbap::importContacts(int max_entries) pmsg->createRequest("bluetooth-pbap", "import", parameter); m_mloop->sendMessage(std::move(msg)); +#endif } void Pbap::refreshContacts(int max_entries) { +#if 0 std::unique_ptr<Message> msg = MessageFactory::getInstance().createOutboundMessage(MessageId::Call); if (!msg) return; @@ -124,10 +126,12 @@ void Pbap::refreshContacts(int max_entries) pmsg->createRequest("bluetooth-pbap", "contacts", parameter); m_mloop->sendMessage(std::move(msg)); +#endif } void Pbap::refreshCalls(int max_entries) { +#if 0 std::unique_ptr<Message> msg = MessageFactory::getInstance().createOutboundMessage(MessageId::Call); if (!msg) return; @@ -141,10 +145,12 @@ void Pbap::refreshCalls(int max_entries) pmsg->createRequest("bluetooth-pbap", "history", parameter); m_mloop->sendMessage(std::move(msg)); +#endif } void Pbap::search(QString number) { +#if 0 std::unique_ptr<Message> msg = MessageFactory::getInstance().createOutboundMessage(MessageId::Call); if (!msg) return; @@ -158,6 +164,7 @@ void Pbap::search(QString number) pmsg->createRequest("bluetooth-pbap", "search", parameter); m_mloop->sendMessage(std::move(msg)); +#endif } bool compareContactPtr(QObject *a, QObject *b) @@ -263,6 +270,7 @@ void Pbap::sendSearchResults(QJsonArray results) emit searchResults(name); } +#if 0 void Pbap::onConnected() { QStringListIterator eventIterator(events); @@ -334,3 +342,4 @@ void Pbap::onMessageReceived(std::shared_ptr<Message> msg) } } } +#endif diff --git a/pbap/pbap.h b/pbap/pbap.h index 676b49d..25fa450 100644 --- a/pbap/pbap.h +++ b/pbap/pbap.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Konsulko Group + * Copyright (C) 2018-2020,2022 Konsulko Group * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,15 +17,11 @@ #ifndef PBAP_H #define PBAP_H -#include <memory> #include <QObject> #include <QJsonArray> #include <QtQml/QQmlContext> #include <QtQml/QQmlListProperty> -class MessageEngine; -class Message; - class PhoneNumber : public QObject { Q_OBJECT @@ -144,7 +140,7 @@ class Pbap : public QObject Q_OBJECT public: - explicit Pbap(QUrl &url, QQmlContext *context, QObject * parent = Q_NULLPTR); + explicit Pbap(QQmlContext *context, QObject * parent = Q_NULLPTR); virtual ~Pbap(); Q_INVOKABLE void importContacts(int max_entries); @@ -157,7 +153,6 @@ class Pbap : public QObject void statusChanged(bool connected); private: - std::shared_ptr<MessageEngine> m_mloop; QQmlContext *m_context; QList<QObject *>m_contacts; QList<QObject *>m_calls; @@ -165,11 +160,6 @@ class Pbap : public QObject void updateCalls(QJsonArray); void sendSearchResults(QJsonArray); - // slots - void onConnected(); - void onDisconnected(); - void onMessageReceived(std::shared_ptr<Message>); - const QStringList events { "status", }; |