Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[qconnmanengine] Make sure that configurationChanged is emitted when …
…session state changes
  • Loading branch information
monich authored and martinjones committed Oct 3, 2016
1 parent 254969f commit e51fbcf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 16 additions & 0 deletions src/plugins/bearer/connman/qconnmanengine.cpp
Expand Up @@ -373,6 +373,22 @@ void QConnmanEngine::configurationChange(QConnmanServiceInterface *serv)

ptr->mutex.unlock();

if (!changed) {
const QNetworkSession::State curSessionState = sessionStateForId(id);
const QNetworkSession::State prevSessionState =
connmanLastKnownSessionState.contains(id) ?
connmanLastKnownSessionState.value(id) :
QNetworkSession::Invalid;
if (curSessionState != prevSessionState) {
if (curSessionState == QNetworkSession::Invalid) {
connmanLastKnownSessionState.remove(id);
} else {
connmanLastKnownSessionState.insert(id, curSessionState);
}
changed = true;
}
}

if (changed) {
locker.unlock();
emit configurationChanged(ptr);
Expand Down
4 changes: 1 addition & 3 deletions src/plugins/bearer/connman/qconnmanengine.h
Expand Up @@ -108,23 +108,21 @@ private Q_SLOTS:

QList<QNetworkConfigurationPrivate *> foundConfigurations;

QString networkFromId(const QString &id);

QNetworkConfiguration::StateFlags getStateForService(const QString &service);
QNetworkConfiguration::BearerType typeToBearer(const QString &type);

void removeConfiguration(const QString &servicePath);
void addServiceConfiguration(const QString &servicePath);
QDateTime activeTime;


QMap<QString,QConnmanTechnologyInterface *> technologies; // techpath, tech interface
QMap<QString,QString> configInterfaces; // id, interface name
QList<QString> serviceNetworks; //servpath

QNetworkConfiguration::BearerType ofonoTechToBearerType(const QString &type);
bool isRoamingAllowed(const QString &context);
QMap <QString,QConnmanServiceInterface *> connmanServiceInterfaces;
QMap <QString,QNetworkSession::State> connmanLastKnownSessionState;

protected:
bool requiresPolling() const;
Expand Down

0 comments on commit e51fbcf

Please sign in to comment.