I have made the following changes intended for :
  CE:MW:Shared / contextkit-meego

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.pub.meego.com//request/show/5138

Thank You,
rojkov

[This message was auto-generated]

---

Request # 5138:

Messages from BOSS:

State: review at 2012-06-26T09:21:23 by bossbot

Reviews:
       accepted by bossbot : Prechecks succeeded.
       new for CE-maintainers : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: home:rojkov:branches:CE:MW:Shared / contextkit-meego -> CE:MW:Shared 
/ contextkit-meego
  
changes files:
--------------
--- contextkit-meego.changes
+++ contextkit-meego.changes
@@ -0,0 +1,4 @@
+* Tue Jun 19 2012 Dmitry Rozhkov <[email protected]> - 0.0.16
+- Internet plugin updated to work with connman 1.1:
+    0009-adaptation-to-connman11.patch
+

new:
----
  0009-adaptation-to-connman11.patch

spec files:
-----------
--- contextkit-meego.spec
+++ contextkit-meego.spec
@@ -1,6 +1,6 @@
 # 
 # Do NOT Edit the Auto-generated Part!
-# Generated by: spectacle version 0.24
+# Generated by: spectacle version 0.24.1
 # 
 
 Name:       contextkit-meego
@@ -26,6 +26,7 @@
 Patch7:     0006-Revert-Revert-First-draft-of-integrating-new-provide.patch
 Patch8:     0007-Revert-Revert-BMC-21131-Location-properties-provided.patch
 Patch9:     0008-fixed-location-skyhook.context-name-conflict-with-ge.patch
+Patch10:     0009-adaptation-to-connman11.patch
 BuildRequires:  pkgconfig(QtCore)
 BuildRequires:  pkgconfig(bluetooth-qt)
 BuildRequires:  pkgconfig(contextsubscriber-1.0) >= 0.5.25
@@ -68,7 +69,7 @@
 %package internet
 Summary:    Internet plugin for Contextkit
 Group:      System/GUI/Other
-Requires:   connman
+Requires:   connman-qt >= 0.1.4-7
 
 %description internet
 %{summary}.
@@ -130,6 +131,8 @@
 %patch8 -p1
 # 0008-fixed-location-skyhook.context-name-conflict-with-ge.patch
 %patch9 -p1
+# 0009-adaptation-to-connman11.patch
+%patch10 -p1
 # >> setup
 # << setup
 

other changes:
--------------

++++++ 0009-adaptation-to-connman11.patch (new)
--- 0009-adaptation-to-connman11.patch
+++ 0009-adaptation-to-connman11.patch
@@ -0,0 +1,277 @@
+diff --git a/internet/connmanprovider.cpp b/internet/connmanprovider.cpp
+index d6336ba..e64cd8e 100644
+--- a/internet/connmanprovider.cpp
++++ b/internet/connmanprovider.cpp
+@@ -2,6 +2,7 @@
+  *
+  * contextkit-meego
+  * Copyright © 2010, Intel Corporation.
++ * Copyright © 2012, Jolla.
+  *
+  * 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
+@@ -14,6 +15,8 @@
+ #include <QStringList>
+ #include <QVariant>
+ 
++#define DBG qDebug() << __FILE__ << ":" << __LINE__ << ":"
++
+ IProviderPlugin* pluginFactory(const QString& constructionString)
+ {
+   Q_UNUSED(constructionString)
+@@ -28,9 +31,9 @@ const QString 
ConnmanProvider::trafficIn("Internet.TrafficIn");
+ const QString ConnmanProvider::trafficOut("Internet.TrafficOut");
+ 
+ 
+-ConnmanProvider::ConnmanProvider(): activeWifi(NULL)
++ConnmanProvider::ConnmanProvider(): activeService(NULL)
+ {
+-  qDebug() << "ConnmanProvider::ConnmanProvider()";
++  DBG << "ConnmanProvider::ConnmanProvider()";
+ 
+   m_nameMapper["wifi"] = "WLAN";
+   m_nameMapper["gprs"] = "GPRS";
+@@ -39,37 +42,38 @@ ConnmanProvider::ConnmanProvider(): activeWifi(NULL)
+   m_nameMapper["ethernet"] = "ethernet";
+ 
+   m_nameMapper["offline"] = "disconnected";
++  m_nameMapper["idle"] = "disconnected";
+   m_nameMapper["online"] = "connected";
+-  m_nameMapper["connected"] = "connected";
++  m_nameMapper["ready"] = "connected";
+ 
+   //hack
+   m_properties[trafficIn] = 20;
+   m_properties[trafficOut] = 20;
+   m_timerId = startTimer(5*1000);
+-  
++
+   QMetaObject::invokeMethod(this, "ready", Qt::QueuedConnection);
+ 
+-  m_networkListModel = new NetworkListModel();
+-  m_properties[networkType] = map(m_networkListModel->defaultTechnology());
+-  m_properties[networkState] = map(m_networkListModel->state());
++  m_networkManager = NetworkManagerFactory::createInstance();;
++  m_properties[networkType] = map("gprs");
++  m_properties[networkState] = map(m_networkManager->state());
+ 
+-  if(m_networkListModel->defaultRoute())
++  if(m_networkManager->defaultRoute())
+   {
+-      activeWifi = m_networkListModel->defaultRoute();
++      activeService = m_networkManager->defaultRoute();
+ 
+-      
connect(activeWifi,SIGNAL(propertyChanged(QString,QVariant)),this,SLOT(propertiesChanged()));
++      
connect(activeService,SIGNAL(nameChanged(QString)),this,SLOT(nameChanged(QString)));
++      
connect(activeService,SIGNAL(strengthChanged(uint)),this,SLOT(signalStrengthChanged(uint)));
+ 
+-      m_properties[signalStrength] = 
m_networkListModel->defaultRoute()->strength();
+-      m_properties[networkName] = m_networkListModel->defaultRoute()->name();
++      m_properties[signalStrength] = 
m_networkManager->defaultRoute()->strength();
++      m_properties[networkName] = m_networkManager->defaultRoute()->name();
++      m_properties[networkType] = map(activeService->type());
+   }
+ 
+-  connect(m_networkListModel, SIGNAL(defaultTechnologyChanged(QString)),
+-        this, SLOT(defaultTechnologyChanged(QString)));
+-  connect(m_networkListModel, SIGNAL(stateChanged(QString)),
++  connect(m_networkManager, SIGNAL(stateChanged(QString)),
+         this, SLOT(stateChanged(QString)));
+-  connect(m_networkListModel, SIGNAL(defaultRouteChanged(NetworkItemModel*)),
+-          this, SLOT(defaultRouteChanged(NetworkItemModel*)));
+-  
++  connect(m_networkManager, SIGNAL(defaultRouteChanged(NetworkService*)),
++          this, SLOT(defaultRouteChanged(NetworkService*)));
++
+   //sadly, QVariant is not a registered metatype
+   qRegisterMetaType<QVariant>("QVariant");
+ 
+@@ -89,7 +93,7 @@ ConnmanProvider::ConnmanProvider(): activeWifi(NULL)
+ 
+ ConnmanProvider::~ConnmanProvider()
+ {
+-  qDebug() << "ConnmanProvider::~ConnmanProvider()";
++  DBG << "ConnmanProvider::~ConnmanProvider()";
+ }
+ 
+ void ConnmanProvider::subscribe(QSet<QString> keys)
+@@ -105,7 +109,7 @@ void ConnmanProvider::subscribe(QSet<QString> keys)
+ void ConnmanProvider::unsubscribe(QSet<QString> keys)
+ {
+   qDebug() << "ConnmanProvider::unsubscribe(" << 
QStringList(keys.toList()).join(", ") << ")";
+-  
++
+   m_subscribedProperties.subtract(keys);
+ }
+ 
+@@ -124,11 +128,9 @@ QString ConnmanProvider::map(const QString &input) const
+   return m_nameMapper[input];
+ }
+ 
+-void ConnmanProvider::signalStrengthChanged(int strength)
++void ConnmanProvider::signalStrengthChanged(uint strength)
+ {
+-    if(!activeWifi) return;
+-
+-    qDebug()<<"signal strength for: "<<activeWifi->name()<<" "<<strength;
++    if(!activeService) return;
+ 
+     m_properties[signalStrength] = strength;
+ 
+@@ -140,6 +142,7 @@ void ConnmanProvider::signalStrengthChanged(int strength)
+ void ConnmanProvider::emitSubscribeFinished()
+ {
+   foreach (QString key, m_subscribedProperties) {
++    DBG << "emit subscribedFinished(" << key << ")";
+     emit subscribeFinished(key);
+   }
+ }
+@@ -147,53 +150,58 @@ void ConnmanProvider::emitSubscribeFinished()
+ void ConnmanProvider::emitChanged()
+ {
+   foreach (QString key, m_subscribedProperties) {
++    DBG << "ConnmanProvider::emitChanged(): " << key << "=" << 
m_properties[key];
+     emit valueChanged(key, QVariant(m_properties[key]));
+   }
+ }
+ 
+-void ConnmanProvider::defaultTechnologyChanged(QString Technology)
++void ConnmanProvider::defaultRouteChanged(NetworkService *item)
+ {
+-  //qDebug() << "defaultTechnologyChanged: " << Technology;
+-  m_properties[networkType] = map(Technology);
+-  if (m_subscribedProperties.contains(networkType)) {
+-    emit valueChanged(networkType, QVariant(m_properties[networkType]));
+-  }
+-}
+-
+-void ConnmanProvider::defaultRouteChanged(NetworkItemModel *item)
+-{
+-    if(activeWifi)
++    if(activeService)
+     {
+-        activeWifi->disconnect(this,SLOT(propertiesChanged()));
+-        activeWifi->disconnect(this,SLOT(signalStrengthChanged(int)));
++        DBG << "disconnecting from " << activeService->name();
++        activeService->disconnect(this,SLOT(nameChanged(QString)));
++        activeService->disconnect(this,SLOT(signalStrengthChanged(uint)));
+     }
+ 
+-    activeWifi = item;
++    activeService = item;
+ 
++    if (item) {
++        DBG << "new default route: " << item->name();
++        QString ntype = map(item->type());
++        if (m_properties[networkType] != ntype) {
++            if (m_subscribedProperties.contains(networkType)) {
++                m_properties[networkType] = ntype;
++                DBG << "networkType has changed to " << ntype;
++                emit valueChanged(networkType, 
QVariant(m_properties[networkType]));
++            }
++        }
+ 
+-    if(item)
+-    {
+         m_properties[networkName] = item->name();
+         m_properties[signalStrength] = item->strength();
+ 
+-        
connect(activeWifi,SIGNAL(strengthChanged(int)),this,SLOT(signalStrengthChanged(int)));
+-        
connect(activeWifi,SIGNAL(propertyChanged(QString,QVariant)),this,SLOT(propertiesChanged()));
++        DBG << "connecting to " << activeService->name();
++        
connect(activeService,SIGNAL(strengthChanged(uint)),this,SLOT(signalStrengthChanged(uint)));
++        
connect(activeService,SIGNAL(nameChanged(QString)),this,SLOT(nameChanged(QString)));
+     }
+     else
+         m_properties[signalStrength] = 0;
+ 
+     if (m_subscribedProperties.contains(signalStrength)) {
++      DBG << "emit valueChanged(strength)";
+       emit valueChanged(signalStrength, 
QVariant(m_properties[signalStrength]));
+     }
+ 
+     if (m_subscribedProperties.contains(networkName)) {
++      DBG << "emit valueChanged(naetworkName)";
+       emit valueChanged(networkName, QVariant(m_properties[networkName]));
+     }
+ }
+ 
+-void ConnmanProvider::propertiesChanged()
(78 more lines skipped)

++++++ contextkit-meego.yaml
--- contextkit-meego.yaml
+++ contextkit-meego.yaml
@@ -20,6 +20,7 @@
     - 0006-Revert-Revert-First-draft-of-integrating-new-provide.patch
     - 0007-Revert-Revert-BMC-21131-Location-properties-provided.patch
     - 0008-fixed-location-skyhook.context-name-conflict-with-ge.patch
+    - 0009-adaptation-to-connman11.patch
 PkgBR:
     - connman-qt-devel
     - gconf-devel
@@ -71,7 +72,7 @@
       Description: |
             %{summary}.
       Requires:
-            - connman
+            - connman-qt >= 0.1.4-7
       Files:
             - "%{_datadir}/contextkit/providers/internet.context"
             - "%{_libdir}/contextkit/subscriber-plugins/libinternet.so"



Reply via email to