Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor adjustments #21

Merged
merged 2 commits into from Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 9 additions & 13 deletions src/qofonoassistedsatellitenavigation.cpp
Expand Up @@ -22,18 +22,17 @@ class QOfonoAssistedSatelliteNavigationPrivate
QOfonoAssistedSatelliteNavigationPrivate();
QString modemPath;
OfonoAssistedSatelliteNavigation *ofonoAssistedSatelliteNav;

};

QOfonoAssistedSatelliteNavigationPrivate::QOfonoAssistedSatelliteNavigationPrivate() :
modemPath(QString())
, ofonoAssistedSatelliteNav(0)
QOfonoAssistedSatelliteNavigationPrivate::QOfonoAssistedSatelliteNavigationPrivate()
: modemPath(QString())
, ofonoAssistedSatelliteNav(0)
{
}

QOfonoAssistedSatelliteNavigation::QOfonoAssistedSatelliteNavigation(QObject *parent) :
QObject(parent)
, d_ptr(new QOfonoAssistedSatelliteNavigationPrivate)
QOfonoAssistedSatelliteNavigation::QOfonoAssistedSatelliteNavigation(QObject *parent)
: QObject(parent)
, d_ptr(new QOfonoAssistedSatelliteNavigationPrivate)
{
}

Expand All @@ -50,11 +49,8 @@ void QOfonoAssistedSatelliteNavigation::setModemPath(const QString &path)
return;

if (path != modemPath()) {
if (d_ptr->ofonoAssistedSatelliteNav) {
delete d_ptr->ofonoAssistedSatelliteNav;
d_ptr->ofonoAssistedSatelliteNav = 0;
}
d_ptr->ofonoAssistedSatelliteNav = new OfonoAssistedSatelliteNavigation(OFONO_SERVICE, path, OFONO_BUS,this);
delete d_ptr->ofonoAssistedSatelliteNav;
d_ptr->ofonoAssistedSatelliteNav = new OfonoAssistedSatelliteNavigation(OFONO_SERVICE, path, OFONO_BUS, this);
if (d_ptr->ofonoAssistedSatelliteNav->isValid()) {
d_ptr->modemPath = path;
Q_EMIT modemPathChanged(path);
Expand All @@ -72,7 +68,7 @@ void QOfonoAssistedSatelliteNavigation::registerPositioningRequestAgent(const QS
if (d_ptr->ofonoAssistedSatelliteNav) {
QDBusPendingReply <> reply = d_ptr->ofonoAssistedSatelliteNav->RegisterPositioningRequestAgent(QDBusObjectPath(path));
if (reply.isError())
qDebug() << reply.error().message();
qDebug() << "QOfonoAssistedNavigation failed to register agent:" << reply.error().message();
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/qofonocallbarring.cpp
Expand Up @@ -18,8 +18,8 @@

#define SUPER QOfonoModemInterface

QOfonoCallBarring::QOfonoCallBarring(QObject *parent) :
SUPER(OfonoCallBarring::staticInterfaceName(), parent)
QOfonoCallBarring::QOfonoCallBarring(QObject *parent)
: SUPER(OfonoCallBarring::staticInterfaceName(), parent)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/qofonocallforwarding.cpp
Expand Up @@ -18,8 +18,8 @@

#define SUPER QOfonoModemInterface

QOfonoCallForwarding::QOfonoCallForwarding(QObject *parent) :
SUPER(OfonoCallForwarding::staticInterfaceName(), parent)
QOfonoCallForwarding::QOfonoCallForwarding(QObject *parent)
: SUPER(OfonoCallForwarding::staticInterfaceName(), parent)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/qofonocallmeter.cpp
Expand Up @@ -18,8 +18,8 @@

#define SUPER QOfonoModemInterface

QOfonoCallMeter::QOfonoCallMeter(QObject *parent) :
SUPER(OfonoCallMeter::staticInterfaceName(), parent)
QOfonoCallMeter::QOfonoCallMeter(QObject *parent)
: SUPER(OfonoCallMeter::staticInterfaceName(), parent)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/qofonocallsettings.cpp
Expand Up @@ -18,8 +18,8 @@

#define SUPER QOfonoModemInterface

QOfonoCallSettings::QOfonoCallSettings(QObject *parent) :
SUPER(OfonoCallSettings::staticInterfaceName(), parent)
QOfonoCallSettings::QOfonoCallSettings(QObject *parent)
: SUPER(OfonoCallSettings::staticInterfaceName(), parent)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/qofonocallvolume.cpp
Expand Up @@ -18,8 +18,8 @@

#define SUPER QOfonoModemInterface

QOfonoCallVolume::QOfonoCallVolume(QObject *parent) :
SUPER(OfonoCallVolume::staticInterfaceName(), parent)
QOfonoCallVolume::QOfonoCallVolume(QObject *parent)
: SUPER(OfonoCallVolume::staticInterfaceName(), parent)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/qofonocellbroadcast.cpp
Expand Up @@ -23,8 +23,8 @@ namespace {
const QString Topics("Topics");
}

QOfonoCellBroadcast::QOfonoCellBroadcast(QObject *parent) :
SUPER(OfonoCellBroadcast::staticInterfaceName(), parent)
QOfonoCellBroadcast::QOfonoCellBroadcast(QObject *parent)
: SUPER(OfonoCellBroadcast::staticInterfaceName(), parent)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/qofonoconnectioncontext.cpp
Expand Up @@ -34,8 +34,8 @@ class QOfonoConnectionContext::Private : public SUPER::ExtData
~Private() {}
};

QOfonoConnectionContext::QOfonoConnectionContext(QObject *parent) :
SUPER(new Private, parent)
QOfonoConnectionContext::QOfonoConnectionContext(QObject *parent)
: SUPER(new Private, parent)
{
}

Expand Down
14 changes: 7 additions & 7 deletions src/qofonoconnectionmanager.cpp
Expand Up @@ -69,8 +69,8 @@ void QOfonoConnectionManager::Private::filterContexts()
}
}

QOfonoConnectionManager::QOfonoConnectionManager(QObject *parent) :
SUPER(OfonoConnectionManager::staticInterfaceName(), new Private, parent)
QOfonoConnectionManager::QOfonoConnectionManager(QObject *parent)
: SUPER(OfonoConnectionManager::staticInterfaceName(), new Private, parent)
{
QOfonoDbusTypes::registerObjectPathProperties();
}
Expand Down Expand Up @@ -256,7 +256,7 @@ void QOfonoConnectionManager::onGetContextsFinished(QDBusPendingCallWatcher *wat
watch->deleteLater();
QDBusPendingReply<ObjectPathPropertiesList> reply(*watch);
if (reply.isError()) {
qDebug() << reply.error();
qDebug() << "QOfonoConnectionManager getContexts failure:" << reply.error();
Q_EMIT reportError(reply.error().message());
} else {
Private *d_ptr = privateData();
Expand Down Expand Up @@ -286,7 +286,7 @@ void QOfonoConnectionManager::onAddContextFinished(QDBusPendingCallWatcher *watc
watch->deleteLater();
QDBusPendingReply<QDBusObjectPath> reply(*watch);
if (reply.isError()) {
qDebug() << reply.error();
qDebug() << "QOfonoConnectionManager addContext failure:" << reply.error();
Q_EMIT reportError(reply.error().message());
}
}
Expand All @@ -296,7 +296,7 @@ void QOfonoConnectionManager::onRemoveContextFinished(QDBusPendingCallWatcher *w
watch->deleteLater();
QDBusPendingReply<> reply(*watch);
if (reply.isError()) {
qDebug() << reply.error();
qDebug() << "QOfonoConnectionManager removeContext failure:" << reply.error();
Q_EMIT reportError(reply.error().message());
}
}
Expand All @@ -306,7 +306,7 @@ void QOfonoConnectionManager::onDeactivateAllFinished(QDBusPendingCallWatcher *w
watch->deleteLater();
QDBusPendingReply<> reply(*watch);
if (reply.isError()) {
qDebug() << reply.error();
qDebug() << "QOfonoConnectionManager deactivateAll failure:" << reply.error();
Q_EMIT reportError(reply.error().message());
} else {
OfonoConnectionManager *iface = (OfonoConnectionManager*)dbusInterface();
Expand All @@ -324,7 +324,7 @@ void QOfonoConnectionManager::onResetContextFinished(QDBusPendingCallWatcher *wa
watch->deleteLater();
QDBusPendingReply<> reply(*watch);
if (reply.isError()) {
qDebug() << reply.error();
qDebug() << "QOfonoConnectionManager resetContext failure:" << reply.error();
Q_EMIT reportError(reply.error().message());
}
}
Expand Down
47 changes: 21 additions & 26 deletions src/qofonohandsfree.cpp
Expand Up @@ -26,15 +26,15 @@ class QOfonoHandsfreePrivate

};

QOfonoHandsfreePrivate::QOfonoHandsfreePrivate() :
modemPath(QString())
, ofonoHandsFree(0)
QOfonoHandsfreePrivate::QOfonoHandsfreePrivate()
: modemPath(QString())
, ofonoHandsFree(0)
{
}

QOfonoHandsfree::QOfonoHandsfree(QObject *parent) :
QObject(parent)
, d_ptr(new QOfonoHandsfreePrivate)
QOfonoHandsfree::QOfonoHandsfree(QObject *parent)
: QObject(parent)
, d_ptr(new QOfonoHandsfreePrivate)
{
}

Expand All @@ -45,29 +45,24 @@ QOfonoHandsfree::~QOfonoHandsfree()

void QOfonoHandsfree::setModemPath(const QString &path)
{
if (path == d_ptr->modemPath ||
path.isEmpty())
if (path == d_ptr->modemPath
|| path.isEmpty())
return;

if (path != modemPath()) {
if (d_ptr->ofonoHandsFree) {
delete d_ptr->ofonoHandsFree;
d_ptr->ofonoHandsFree = 0;
d_ptr->properties.clear();
}
d_ptr->ofonoHandsFree = new OfonoHandsfree(OFONO_SERVICE, path, OFONO_BUS,this);

if (d_ptr->ofonoHandsFree) {
d_ptr->modemPath = path;
connect(d_ptr->ofonoHandsFree,SIGNAL(PropertyChanged(QString,QDBusVariant)),
this,SLOT(propertyChanged(QString,QDBusVariant)));

QDBusPendingReply<QVariantMap> reply;
reply = d_ptr->ofonoHandsFree->GetProperties();
reply.waitForFinished();
d_ptr->properties = reply.value();
Q_EMIT modemPathChanged(path);
}
d_ptr->properties.clear();
delete d_ptr->ofonoHandsFree;
d_ptr->ofonoHandsFree = new OfonoHandsfree(OFONO_SERVICE, path, OFONO_BUS, this);

d_ptr->modemPath = path;
connect(d_ptr->ofonoHandsFree, SIGNAL(PropertyChanged(QString,QDBusVariant)),
this, SLOT(propertyChanged(QString,QDBusVariant)));

QDBusPendingReply<QVariantMap> reply;
reply = d_ptr->ofonoHandsFree->GetProperties();
reply.waitForFinished();
d_ptr->properties = reply.value();
Q_EMIT modemPathChanged(path);
}
}

Expand Down
13 changes: 6 additions & 7 deletions src/qofonohandsfreeaudioagent.cpp
Expand Up @@ -25,14 +25,14 @@ class QOfonoHandsfreeAudioAgentPrivate

};

QOfonoHandsfreeAudioAgentPrivate::QOfonoHandsfreeAudioAgentPrivate() :
ofonoHandsfreeAudioAgent(0)
QOfonoHandsfreeAudioAgentPrivate::QOfonoHandsfreeAudioAgentPrivate()
: ofonoHandsfreeAudioAgent(0)
{
}

QOfonoHandsfreeAudioAgent::QOfonoHandsfreeAudioAgent(QObject *parent) :
QObject(parent)
, d_ptr(new QOfonoHandsfreeAudioAgentPrivate)
QOfonoHandsfreeAudioAgent::QOfonoHandsfreeAudioAgent(QObject *parent)
: QObject(parent)
, d_ptr(new QOfonoHandsfreeAudioAgentPrivate)
{
}

Expand All @@ -45,8 +45,7 @@ void QOfonoHandsfreeAudioAgent::setAgentPath(const QString &path)
{
if (!d_ptr->ofonoHandsfreeAudioAgent) {
d_ptr->audioAgentPath = path;
d_ptr->ofonoHandsfreeAudioAgent = new OfonoHandsfreeAudioAgent(OFONO_SERVICE, path, OFONO_BUS,this);

d_ptr->ofonoHandsfreeAudioAgent = new OfonoHandsfreeAudioAgent(OFONO_SERVICE, path, OFONO_BUS, this);
}
}

Expand Down
39 changes: 17 additions & 22 deletions src/qofonohandsfreeaudiocard.cpp
Expand Up @@ -26,15 +26,15 @@ class QOfonoHandsfreeAudioCardPrivate

};

QOfonoHandsfreeAudioCardPrivate::QOfonoHandsfreeAudioCardPrivate() :
modemPath(QString())
, ofonoHandsfreeAudioCard(0)
QOfonoHandsfreeAudioCardPrivate::QOfonoHandsfreeAudioCardPrivate()
: modemPath(QString())
, ofonoHandsfreeAudioCard(0)
{
}

QOfonoHandsfreeAudioCard::QOfonoHandsfreeAudioCard(QObject *parent) :
QObject(parent)
, d_ptr(new QOfonoHandsfreeAudioCardPrivate)
QOfonoHandsfreeAudioCard::QOfonoHandsfreeAudioCard(QObject *parent)
: QObject(parent)
, d_ptr(new QOfonoHandsfreeAudioCardPrivate)
{
}

Expand All @@ -45,26 +45,21 @@ QOfonoHandsfreeAudioCard::~QOfonoHandsfreeAudioCard()

void QOfonoHandsfreeAudioCard::setModemPath(const QString &path)
{
if (path == d_ptr->modemPath ||
path.isEmpty())
if (path == d_ptr->modemPath
|| path.isEmpty())
return;

if (path != modemPath()) {
if (d_ptr->ofonoHandsfreeAudioCard) {
delete d_ptr->ofonoHandsfreeAudioCard;
d_ptr->ofonoHandsfreeAudioCard = 0;
d_ptr->properties.clear();
}
d_ptr->properties.clear();
delete d_ptr->ofonoHandsfreeAudioCard;
d_ptr->modemPath = path;
d_ptr->ofonoHandsfreeAudioCard = new OfonoHandsfreeAudioCard(OFONO_SERVICE, path, OFONO_BUS,this);

if (d_ptr->ofonoHandsfreeAudioCard) {
QDBusPendingReply<QVariantMap> reply;
reply = d_ptr->ofonoHandsfreeAudioCard->GetProperties();
reply.waitForFinished();
d_ptr->properties = reply.value();
Q_EMIT modemPathChanged(path);
}
d_ptr->ofonoHandsfreeAudioCard = new OfonoHandsfreeAudioCard(OFONO_SERVICE, path, OFONO_BUS, this);

QDBusPendingReply<QVariantMap> reply;
reply = d_ptr->ofonoHandsfreeAudioCard->GetProperties();
reply.waitForFinished();
d_ptr->properties = reply.value();
Q_EMIT modemPathChanged(path);
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/qofonohandsfreeaudiomanager.cpp
Expand Up @@ -26,16 +26,16 @@ class QOfonoHandsfreeAudioManagerPrivate

};

QOfonoHandsfreeAudioManagerPrivate::QOfonoHandsfreeAudioManagerPrivate() :
modemPath(QString())
, ofonoHandsfreeAudioManager(0),
audioCards(QStringList())
QOfonoHandsfreeAudioManagerPrivate::QOfonoHandsfreeAudioManagerPrivate()
: modemPath(QString())
, ofonoHandsfreeAudioManager(0)
, audioCards(QStringList())
{
}

QOfonoHandsfreeAudioManager::QOfonoHandsfreeAudioManager(QObject *parent) :
QObject(parent)
, d_ptr(new QOfonoHandsfreeAudioManagerPrivate)
QOfonoHandsfreeAudioManager::QOfonoHandsfreeAudioManager(QObject *parent)
: QObject(parent)
, d_ptr(new QOfonoHandsfreeAudioManagerPrivate)
{
}

Expand Down Expand Up @@ -84,7 +84,7 @@ void QOfonoHandsfreeAudioManager::registerAgent(const QString &path, CodecTypeFl

if (codecs & CVSD) ba += CVSD;
if (codecs & mSBC) ba += mSBC;
d_ptr->ofonoHandsfreeAudioManager->Register(QDBusObjectPath(path),ba);
d_ptr->ofonoHandsfreeAudioManager->Register(QDBusObjectPath(path), ba);
}

bool QOfonoHandsfreeAudioManager::isValid() const
Expand Down
8 changes: 4 additions & 4 deletions src/qofonoipmultimediasystem.cpp
Expand Up @@ -64,8 +64,8 @@ class QOfonoIpMultimediaSystem::Interface: public QDBusAbstractInterface

static const RegistrationValue RegistrationMap[];

Interface(QString aPath, QObject *aParent) :
QDBusAbstractInterface(OFONO_SERVICE, aPath, NAME, OFONO_BUS, aParent) {}
Interface(QString aPath, QObject *aParent)
: QDBusAbstractInterface(OFONO_SERVICE, aPath, NAME, OFONO_BUS, aParent) {}

static bool syncCall(Interface *proxy, const QString &method, QDBusError *outError);

Expand Down Expand Up @@ -121,8 +121,8 @@ bool QOfonoIpMultimediaSystem::Interface::syncCall(Interface *iface, const QStri

#define SUPER QOfonoModemInterface

QOfonoIpMultimediaSystem::QOfonoIpMultimediaSystem(QObject *parent) :
SUPER(QLatin1String(Interface::NAME), parent)
QOfonoIpMultimediaSystem::QOfonoIpMultimediaSystem(QObject *parent)
: SUPER(QLatin1String(Interface::NAME), parent)
{
}

Expand Down