Neil Jerram <n...@ossau.homelinux.net> writes:

> If I've understood the code correctly, there appears to be a missing
> link between QModemNetworkRegistration, which is the first place that
> gets registration and cell location info, and CellModemManager, which is
> the class that sets the Telephony/Status/CellLocation value that the UI
> expects.
>
> The patch below tries to connect those two up.  It builds, but I don't
> have time this evening to quickly test it.  If anyone else feels
> brave...

Sorry, wrong patch.  Here's the right one.

     Neil


>From fdb74f5f6c8a69f4f5e0b63ba4d549d1510821ab Mon Sep 17 00:00:00 2001
From: Neil Jerram <n...@ossau.homelinux.net>
Date: Wed, 29 Aug 2012 22:08:35 +0100
Subject: [PATCH] Connect the jigsaw pieces for displaying cell location

---
 .../telephony/callpolicymanager/cell/cellmodemmanager.cpp  |   12 ++++++++++++
 .../telephony/callpolicymanager/cell/cellmodemmanager.h    |    1 +
 2 files changed, 13 insertions(+)

diff --git a/src/server/phone/telephony/callpolicymanager/cell/cellmodemmanager.cpp b/src/server/phone/telephony/callpolicymanager/cell/cellmodemmanager.cpp
index 6607581..4293b66 100644
--- a/src/server/phone/telephony/callpolicymanager/cell/cellmodemmanager.cpp
+++ b/src/server/phone/telephony/callpolicymanager/cell/cellmodemmanager.cpp
@@ -205,6 +205,8 @@ CellModemManager::CellModemManager(QObject *parent)
                      this, SLOT(registrationStateChanged()));
     QObject::connect(d->m_netReg, SIGNAL(currentOperatorChanged()),
                      this, SLOT(currentOperatorChanged()));
+    QObject::connect(d->m_netReg, SIGNAL(locationChanged()),
+                     this, SLOT(locationChanged()));
 
     // Rename signal for QAbstractCallPolicyManager.
     QObject::connect(this, SIGNAL(registrationStateChanged(QTelephony::RegistrationState)),
@@ -340,6 +342,16 @@ void CellModemManager::registrationStateChanged()
     doAutoRegister();
 }
 
+void CellModemManager::locationChanged()
+{
+  QString cell_location;
+  QTextStream(&cell_location)
+    << d->m_netReg->locationAreaCode()
+    << "/"
+    << d->m_netReg->cellId();
+  setCellLocation(cell_location);
+}
+
 void CellModemManager::rfLevelChanged()
 {
     QPhoneRfFunctionality::Level level = d->m_rfFunc->level();
diff --git a/src/server/phone/telephony/callpolicymanager/cell/cellmodemmanager.h b/src/server/phone/telephony/callpolicymanager/cell/cellmodemmanager.h
index 77a6fd0..1d239d1 100644
--- a/src/server/phone/telephony/callpolicymanager/cell/cellmodemmanager.h
+++ b/src/server/phone/telephony/callpolicymanager/cell/cellmodemmanager.h
@@ -108,6 +108,7 @@ private slots:
                    const QPinOptions&);
     void currentOperatorChanged();
     void registrationStateChanged();
+    void locationChanged();
     void autoRegisterTimeout();
     void planeModeChanged(bool);
     void queryCallForwarding();
-- 
1.7.10.4

_______________________________________________
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community

Reply via email to