Skip to content
Snippets Groups Projects
Commit 97a67db2 authored by Stepan Salenikovich's avatar Stepan Salenikovich Committed by Nicolas Jager
Browse files

rename getBestId to bestId


This is to follow LRC/Qt naming convention. Getters don't begin
with the word "get".

Note that getBestId() has been kept so as not to break API, but
marked as deprecated so that we can quickly update the clients.

Change-Id: Ifcf1d66763b70b5ef4f1b67d39b40892263b5359
Reviewed-by: default avatarNicolas Jäger <nicolas.jager@savoirfairelinux.com>
parent d3034567
Branches
No related tags found
No related merge requests found
......@@ -2183,7 +2183,7 @@ QVariant Call::roleData(int role) const
return dialNumber();
case static_cast<int>(Ring::Role::Number):
case static_cast<int>(Call::Role::Number):
return peerContactMethod()->getBestId();
return peerContactMethod()->bestId();
case static_cast<int>(Ring::Role::URI):
return peerContactMethod()->uri();
case Qt::DecorationRole:
......
......@@ -432,11 +432,17 @@ QString ContactMethod::registeredName() const
return d_ptr->m_RegisteredName.isEmpty()? QString() : d_ptr->m_RegisteredName;
}
/// Best bet for this contact identity
/// returns the registered name if present, otherwise returns the uri
/// Returns the registered name if available, otherwise returns the uri
/// Deprecated for not following LRC naming convention, please use bestId() instead
QString ContactMethod::getBestId() const
{
return d_ptr->m_RegisteredName.isEmpty() ? d_ptr->m_Uri : d_ptr->m_RegisteredName;
return bestId();
}
/// Returns the registered name if available, otherwise returns the uri
QString ContactMethod::bestId() const
{
return registeredName().isEmpty() ? uri() : registeredName();
}
/**
......@@ -560,7 +566,7 @@ QVariant ContactMethod::roleData(int role) const
case Qt::EditRole:
case static_cast<int>(Ring::Role::Number):
case static_cast<int>(Call::Role::Number):
cat = getBestId();
cat = bestId();
break;
case Qt::DecorationRole:
return GlobalInstances::pixmapManipulator().decorationRole(this);
......
......@@ -89,7 +89,7 @@ public:
Q_PROPERTY(bool isReachable READ isReachable )
Q_PROPERTY(Certificate* certificate READ certificate )
Q_PROPERTY(QString registeredName READ registeredName NOTIFY registeredNameSet )
Q_PROPERTY(QString getBestId READ getBestId )
Q_PROPERTY(QString bestId READ bestId )
// Q_PROPERTY(QHash<QString,int> alternativeNames READ alternativeNames )
......@@ -132,7 +132,8 @@ public:
bool isReachable () const;
Certificate* certificate () const;
QString registeredName () const;
QString getBestId () const;
Q_DECL_DEPRECATED QString getBestId () const;
QString bestId () const;
bool isDuplicate () const;
/*
......
......@@ -51,7 +51,7 @@ QVariant PendingContactRequestModel::data( const QModelIndex& index, int role )
case Columns::PEER_ID:
switch(role) {
case Qt::DisplayRole:
return d_ptr->m_lRequests[index.row()]->peer()->phoneNumbers()[0]->getBestId();
return d_ptr->m_lRequests[index.row()]->peer()->phoneNumbers()[0]->bestId();
}
break;
case Columns::TIME:
......
......@@ -203,7 +203,7 @@ PersonPrivate::getLastIdUsed()
return (a->lastUsed() < b->lastUsed());
});
return (*lastPhoneNumberUsed) ? (*lastPhoneNumberUsed)->getBestId() : QString();
return (*lastPhoneNumberUsed) ? (*lastPhoneNumberUsed)->bestId() : QString();
}
PersonPrivate::PersonPrivate(Person* contact) : QObject(nullptr),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment