Navigation Menu

Skip to content

Commit

Permalink
[connectionagent] really set timeupdates to manual.
Browse files Browse the repository at this point in the history
We need to wait for first update to ensure that the clockmodel is
connected to connman, then we set them to manual.
  • Loading branch information
Lorn Potter committed Nov 6, 2013
1 parent f7c1320 commit e728710
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
13 changes: 9 additions & 4 deletions connd/qconnectionmanager.cpp
Expand Up @@ -24,7 +24,6 @@
#include <connman-qt5/networktechnology.h>
#include <connman-qt5/networkservice.h>
#include <connman-qt5/sessionagent.h>
#include <connman-qt5/clockmodel.h>
#include <qofono-qt5/qofonoconnectioncontext.h>
#include <qofono-qt5/qofonoconnectionmanager.h>
#include <qofono-qt5/qofononetworkregistration.h>
Expand Down Expand Up @@ -83,6 +82,7 @@ QConnectionManager::QConnectionManager(QObject *parent) :

askForRoaming = askRoaming();

connect(&clockModel,SIGNAL(timeUpdatesChanged()),this,SLOT(timeUpdatesChanged()));
ua = new UserAgent(this);

connect(ua,SIGNAL(userInputRequested(QString,QVariantMap)),
Expand Down Expand Up @@ -600,6 +600,14 @@ void QConnectionManager::serviceRemoved(const QString &srv)
serviceInProgress.clear();
}

void QConnectionManager::timeUpdatesChanged()
{
qDebug();
clockModel.setTimeUpdates("manual");
clockModel.setTimezoneUpdates("manual");
disconnect(&clockModel,SIGNAL(timeUpdatesChanged()),this,SLOT(timeUpdatesChanged()));
}

void QConnectionManager::setup()
{
qDebug() << Q_FUNC_INFO
Expand All @@ -610,9 +618,6 @@ void QConnectionManager::setup()
<< netman->state()
<< netman->defaultRoute()->type();

ClockModel clockModel;
clockModel.setTimeUpdates("manual");
clockModel.setTimezoneUpdates("manual");

techChanged();
connect(netman,SIGNAL(technologiesChanged()),this,SLOT(techChanged()));
Expand Down
8 changes: 6 additions & 2 deletions connd/qconnectionmanager.h
Expand Up @@ -25,6 +25,7 @@
#include <QDBusObjectPath>
#include <QQueue>
#include <QPair>
#include <connman-qt5/clockmodel.h>

class UserAgent;
class SessionAgent;
Expand Down Expand Up @@ -111,8 +112,10 @@ public Q_SLOTS:
NetworkTechnology *tetheringWifiTech;
bool tetheringEnabled;
bool flightModeSuppression;
WakeupWatcher *mceWatch;
QTimer *goodConnectTimer;
WakeupWatcher *mceWatch;
QTimer *goodConnectTimer;
ClockModel clockModel;

private slots:
void onScanFinished();
void updateServicesMap();
Expand Down Expand Up @@ -147,6 +150,7 @@ private slots:

void connectionTimeout();
void serviceAutoconnectChanged(bool);
void timeUpdatesChanged();

};

Expand Down

0 comments on commit e728710

Please sign in to comment.