Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[connectionagent] remove lots of debug messages.
Dont try to connect or access netman if it's offline.
  • Loading branch information
Lorn Potter committed Jul 18, 2013
1 parent 0727dd8 commit 251c36f
Showing 1 changed file with 5 additions and 48 deletions.
53 changes: 5 additions & 48 deletions connd/qconnectionmanager.cpp
Expand Up @@ -130,25 +130,19 @@ QConnectionManager & QConnectionManager::instance()
// from useragent
void QConnectionManager::onUserInputRequested(const QString &servicePath, const QVariantMap &fields)
{
qDebug() << Q_FUNC_INFO;

// gets called when a connman service gets called to connect and needs more configurations.
Q_EMIT userInputRequested(servicePath, fields);
}

// from useragent
void QConnectionManager::onUserInputCanceled()
{
qDebug() << Q_FUNC_INFO;

Q_EMIT userInputCanceled();
}

// from useragent
void QConnectionManager::onErrorReported(const QString &servicePath, const QString &error)
{
qDebug() << Q_FUNC_INFO;

Q_EMIT errorReported(servicePath, error);
}

Expand All @@ -157,7 +151,6 @@ void QConnectionManager::onConnectionRequest()
{
sendConnectReply("Suppress", 15);
bool ok = autoConnect();
qDebug() << Q_FUNC_INFO << ok;
if (!ok) {
Q_EMIT connectionRequest();
}
Expand All @@ -178,12 +171,6 @@ void QConnectionManager::onServiceAdded(const QString &servicePath)
if (!servicesMap.contains(servicePath)) {
updateServicesMap();
}
qDebug() << Q_FUNC_INFO
<< servicePath
<< servicesMap.value(servicePath)->state()
<< okToConnect
<< currentType.isEmpty()
<< connectedServices.count();

if (okToConnect && !currentType.isEmpty() && servicesMap.contains(servicePath)) {

Expand Down Expand Up @@ -213,8 +200,6 @@ void QConnectionManager::onServiceAdded(const QString &servicePath)

void QConnectionManager::onServiceRemoved(const QString &servicePath)
{
qDebug() << Q_FUNC_INFO << servicePath
<< netman->state();
updateServicesMap();
if (!handoverInProgress)
autoConnect();
Expand All @@ -229,12 +214,6 @@ void QConnectionManager::serviceErrorChanged(const QString &error)
void QConnectionManager::serviceStateChanged(const QString &state)
{
NetworkService *service = qobject_cast<NetworkService *>(sender());
qDebug() << Q_FUNC_INFO
<< service->name()
<< state
<< service->path()
<< service->ethernet()["Interface"].toString()
<< netman->getTechnology(service->type())->powered();

if (currentNetworkState == "disconnect") {
ua->sendConnectReply("Clear");
Expand Down Expand Up @@ -291,7 +270,6 @@ void QConnectionManager::serviceStateChanged(const QString &state)

bool QConnectionManager::autoConnect()
{
qDebug() << Q_FUNC_INFO;
QString selectedService;
QString currentType;
if (handoverInProgress)
Expand Down Expand Up @@ -333,7 +311,6 @@ void QConnectionManager::connectToType(const QString &type)
{
currentType = type;
QString techPath = netman->technologyPathForType(type);
qDebug() << Q_FUNC_INFO << techPath;

if (techPath.isEmpty()) {
Q_EMIT errorReported("","Type not valid");
Expand Down Expand Up @@ -387,12 +364,6 @@ void QConnectionManager::connectToNetworkService(const QString &servicePath)
NetworkTechnology technology;
technology.setPath(netman->technologyPathForType(servicesMap.value(servicePath)->type()));

qDebug() << Q_FUNC_INFO
<< servicePath
<< servicesMap.value(servicePath)->state()
<< "powered:" << netman->getTechnology(servicesMap.value(servicePath)->type())->powered()
<< "powered:" << technology.powered();

if (technology.powered() && handoverInProgress && servicesMap.contains(servicePath)
&& servicesMap.value(servicePath)->state() == "idle") {
qDebug() << Q_FUNC_INFO << "requesting connection to " << servicesMap.value(servicePath)->name();
Expand All @@ -407,7 +378,6 @@ void QConnectionManager::onScanFinished()

void QConnectionManager::updateServicesMap()
{
qDebug() << Q_FUNC_INFO;
servicesMap.clear();
connectedServices.clear();
orderedServicesList.clear();
Expand All @@ -429,7 +399,6 @@ void QConnectionManager::updateServicesMap()
connectedServices.prepend(serv->path());

if (netman->state() != "online") {
qDebug() << Q_FUNC_INFO << "emit connectionState";
Q_EMIT connectionState(serv->state(), serv->type());
}
}
Expand All @@ -453,14 +422,9 @@ void QConnectionManager::servicesError(const QString &errorMessage)
QString QConnectionManager::findBestConnectableService()
{

qDebug() << Q_FUNC_INFO << techPreferenceList << orderedServicesList;

for (int i = 0; i < orderedServicesList.count(); i++) {

QString path = orderedServicesList.at(i);
qDebug() << Q_FUNC_INFO
<< path
<< servicesMap.value(path)->state();

NetworkService *service = servicesMap.value(path);
if (service->state() != "idle")
Expand Down Expand Up @@ -496,10 +460,6 @@ QString QConnectionManager::findBestConnectableService()

void QConnectionManager::connectionHandover(const QString &oldService, const QString &newService)
{
qDebug() << Q_FUNC_INFO
<< oldService
<< servicesMap.value(oldService)->state()
<< newService;

bool isOnline = false;
bool ok = true;
Expand Down Expand Up @@ -531,9 +491,6 @@ void QConnectionManager::connectionHandover(const QString &oldService, const QSt

void QConnectionManager::networkStateChanged(const QString &state)
{
qDebug() << Q_FUNC_INFO
<< state
<< handoverInProgress;

if (state == "idle" && !handoverInProgress) {
//automigrate
Expand Down Expand Up @@ -579,12 +536,13 @@ void QConnectionManager::setAskRoaming(bool value)

void QConnectionManager::connmanAvailabilityChanged(bool b)
{
qDebug() << Q_FUNC_INFO << b;
connmanPropertiesAvailable = b;
if (!b) {
if (b) {
connect(netman,SIGNAL(servicesChanged()),this,SLOT(setup()));
currentNetworkState = netman->state();
} else {
currentNetworkState = "error";
}
currentNetworkState = netman->state();
}

void QConnectionManager::emitConnectionState()
Expand All @@ -595,7 +553,6 @@ void QConnectionManager::emitConnectionState()

void QConnectionManager::setup()
{
qDebug() << Q_FUNC_INFO << connmanPropertiesAvailable;

if (!connmanPropertiesAvailable) {
connmanPropertiesAvailable = true;
Expand Down Expand Up @@ -627,5 +584,5 @@ void QConnectionManager::setup()
void QConnectionManager::technologyPowerChanged(bool b)
{
NetworkTechnology *tech = qobject_cast<NetworkTechnology *>(sender());
qDebug() << Q_FUNC_INFO << b << tech->name();
qDebug()<< b << tech->name();
}

0 comments on commit 251c36f

Please sign in to comment.