diff options
| -rw-r--r-- | recipes-connectivity/libqofono/libqofono/0001-also-emit-modemRemoved-and-modemAdded.patch | 54 | ||||
| -rw-r--r-- | recipes-connectivity/libqofono/libqofono_git.bb | 10 |
2 files changed, 61 insertions, 3 deletions
diff --git a/recipes-connectivity/libqofono/libqofono/0001-also-emit-modemRemoved-and-modemAdded.patch b/recipes-connectivity/libqofono/libqofono/0001-also-emit-modemRemoved-and-modemAdded.patch new file mode 100644 index 00000000..0122e051 --- /dev/null +++ b/recipes-connectivity/libqofono/libqofono/0001-also-emit-modemRemoved-and-modemAdded.patch | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | From 05241dc61e8c43a12f91ee9976a2ecb2337a3eaf Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Christophe Chapuis <chris.chapuis@gmail.com> | ||
| 3 | Date: Sat, 13 Jul 2019 11:17:08 +0000 | ||
| 4 | Subject: [PATCH] onGetModemsFinished: also emit modemRemoved and modemAdded | ||
| 5 | |||
| 6 | VoiceCall only subscribes to these events, so we need to emit these | ||
| 7 | more "atomic" events too. | ||
| 8 | |||
| 9 | Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com> | ||
| 10 | --- | ||
| 11 | src/qofonomanager.cpp | 21 ++++++++++++++++++--- | ||
| 12 | 1 file changed, 18 insertions(+), 3 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/src/qofonomanager.cpp b/src/qofonomanager.cpp | ||
| 15 | index deeb946..e94a3c7 100644 | ||
| 16 | --- a/src/qofonomanager.cpp | ||
| 17 | +++ b/src/qofonomanager.cpp | ||
| 18 | @@ -40,15 +40,30 @@ void QOfonoManager::Private::handleGetModemsReply(QOfonoManager* obj, ObjectPath | ||
| 19 | { | ||
| 20 | bool wasAvailable = available; | ||
| 21 | QString prevDefault = defaultModem(); | ||
| 22 | - QStringList newModems; | ||
| 23 | + QStringList newModems, oldModems; | ||
| 24 | const int n = reply.count(); | ||
| 25 | for (int i = 0; i < n; i++) { | ||
| 26 | newModems.append(reply.at(i).path.path()); | ||
| 27 | } | ||
| 28 | qSort(newModems); | ||
| 29 | available = true; | ||
| 30 | - if (modems != newModems) { | ||
| 31 | - modems = newModems; | ||
| 32 | + oldModems = modems; | ||
| 33 | + modems = newModems; | ||
| 34 | + | ||
| 35 | + // emit atomic events for add/remove | ||
| 36 | + Q_FOREACH(QString modem, oldModems) { | ||
| 37 | + if(!newModems.contains(modem)) { | ||
| 38 | + Q_EMIT obj->modemRemoved(modem); | ||
| 39 | + } | ||
| 40 | + } | ||
| 41 | + Q_FOREACH(QString modem, newModems) { | ||
| 42 | + if(!oldModems.contains(modem)) { | ||
| 43 | + Q_EMIT obj->modemAdded(modem); | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + // then update the whole list | ||
| 48 | + if (oldModems != newModems) { | ||
| 49 | Q_EMIT obj->modemsChanged(modems); | ||
| 50 | } | ||
| 51 | QString newDefault = defaultModem(); | ||
| 52 | -- | ||
| 53 | 2.23.0 | ||
| 54 | |||
diff --git a/recipes-connectivity/libqofono/libqofono_git.bb b/recipes-connectivity/libqofono/libqofono_git.bb index 8b57e171..7de0e49b 100644 --- a/recipes-connectivity/libqofono/libqofono_git.bb +++ b/recipes-connectivity/libqofono/libqofono_git.bb | |||
| @@ -5,11 +5,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" | |||
| 5 | 5 | ||
| 6 | DEPENDS += "qtbase qtdeclarative qtxmlpatterns" | 6 | DEPENDS += "qtbase qtdeclarative qtxmlpatterns" |
| 7 | 7 | ||
| 8 | SRCREV = "6916cd030b05f0bd137ea9b669fee48f20c19084" | 8 | SRCREV = "3581a6e85561da85858e1b90bef9be88b87acc4d" |
| 9 | SRC_URI = "git://git.merproject.org/mer-core/libqofono.git" | 9 | SRC_URI = "git://git.merproject.org/mer-core/libqofono.git \ |
| 10 | file://0001-also-emit-modemRemoved-and-modemAdded.patch \ | ||
| 11 | " | ||
| 10 | S = "${WORKDIR}/git" | 12 | S = "${WORKDIR}/git" |
| 11 | 13 | ||
| 12 | PV = "0.92+gitr${SRCPV}" | 14 | PV = "0.98+gitr${SRCPV}" |
| 13 | 15 | ||
| 14 | inherit qmake5 | 16 | inherit qmake5 |
| 15 | 17 | ||
| @@ -23,10 +25,12 @@ PACKAGES += "${PN}-tests" | |||
| 23 | 25 | ||
| 24 | FILES_${PN}-tests = " \ | 26 | FILES_${PN}-tests = " \ |
| 25 | ${libdir}/libqofono-qt5/tests/tst_* \ | 27 | ${libdir}/libqofono-qt5/tests/tst_* \ |
| 28 | /opt/examples/libqofono-qt5/ \ | ||
| 26 | /opt/tests/libqofono-qt5 \ | 29 | /opt/tests/libqofono-qt5 \ |
| 27 | " | 30 | " |
| 28 | FILES_${PN} += " \ | 31 | FILES_${PN} += " \ |
| 29 | ${OE_QMAKE_PATH_QML}/MeeGo/QOfono/qmldir \ | 32 | ${OE_QMAKE_PATH_QML}/MeeGo/QOfono/qmldir \ |
| 33 | ${OE_QMAKE_PATH_QML}/MeeGo/QOfono/plugins.qmltypes \ | ||
| 30 | ${OE_QMAKE_PATH_QML}/MeeGo/QOfono/libQOfonoQtDeclarative.so \ | 34 | ${OE_QMAKE_PATH_QML}/MeeGo/QOfono/libQOfonoQtDeclarative.so \ |
| 31 | " | 35 | " |
| 32 | FILES_${PN}-dev += " \ | 36 | FILES_${PN}-dev += " \ |
