Skip to content

Commit

Permalink
Revert "[qtlocation] Start Geoclue client position interface asynchro…
Browse files Browse the repository at this point in the history
…nously. Contributes to JB#38358"

This reverts commit 3020dff.
  • Loading branch information
rainemak committed Jan 15, 2018
1 parent 69941ce commit 8e8ef4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
24 changes: 7 additions & 17 deletions src/plugins/position/geoclue/qgeocluemaster.cpp
Expand Up @@ -80,22 +80,6 @@ bool QGeoclueMaster::hasMasterClient() const
return m_client && m_masterPosition;
}

void createGeoclueMasterClientPositionCallback(GeoclueMasterClient *,
GeocluePosition *position,
GError *error,
QGeoclueMaster *geoclueMaster)
{
if (error) {
qCritical("QGeoclueMaster failed to get master position object");
g_error_free(error);
g_object_unref(geoclueMaster->m_client);
geoclueMaster->m_client = 0;
return;
}

geoclueMaster->m_masterPosition = position;
}

bool QGeoclueMaster::createMasterClient(GeoclueAccuracyLevel accuracy, GeoclueResourceFlags resourceFlags)
{
Q_ASSERT(!m_client && !m_masterPosition);
Expand Down Expand Up @@ -137,7 +121,13 @@ bool QGeoclueMaster::createMasterClient(GeoclueAccuracyLevel accuracy, GeoclueRe

// Need to create the master position interface even though it will not be used, otherwise
// GetPositionProvider always returns empty strings.
geoclue_master_client_create_position_async(m_client, reinterpret_cast<CreatePositionCallback>(createGeoclueMasterClientPositionCallback), this);
m_masterPosition = geoclue_master_client_create_position(m_client, 0);
if (!m_masterPosition) {
qCritical("QGeoclueMaster failed to get master position object");
g_object_unref(m_client);
m_client = 0;
return false;
}

return true;
}
Expand Down
4 changes: 0 additions & 4 deletions src/plugins/position/geoclue/qgeocluemaster.h
Expand Up @@ -61,10 +61,6 @@ class QGeoclueMaster
private:
GeoclueMasterClient *m_client;
GeocluePosition *m_masterPosition;
friend void createGeoclueMasterClientPositionCallback(GeoclueMasterClient *,
GeocluePosition *position,
GError *error,
QGeoclueMaster *geoclueMaster);

QObject *m_handler;
};
Expand Down

0 comments on commit 8e8ef4d

Please sign in to comment.