mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-02 01:26:19 +00:00
fix(app): coding style
This commit is contained in:
parent
0310ccb6c6
commit
dd09e6d3b1
3 changed files with 10 additions and 6 deletions
|
|
@ -39,6 +39,8 @@ ContactModel::ContactModel (shared_ptr<linphone::Friend> linphone_friend) {
|
|||
}
|
||||
|
||||
ContactModel::ContactModel (VcardModel *vcard) {
|
||||
Q_ASSERT(vcard != nullptr);
|
||||
|
||||
QQmlEngine *engine = App::getInstance()->getEngine();
|
||||
if (engine->objectOwnership(vcard) == QQmlEngine::CppOwnership)
|
||||
throw invalid_argument("A contact is already linked to this vcard.");
|
||||
|
|
@ -49,8 +51,11 @@ ContactModel::ContactModel (VcardModel *vcard) {
|
|||
engine->setObjectOwnership(vcard, QQmlEngine::CppOwnership);
|
||||
}
|
||||
|
||||
void ContactModel::presenceReceived () {
|
||||
Presence::PresenceStatus status = static_cast<Presence::PresenceStatus>(m_linphone_friend->getConsolidatedPresence());
|
||||
void ContactModel::refreshPresence () {
|
||||
Presence::PresenceStatus status = static_cast<Presence::PresenceStatus>(
|
||||
m_linphone_friend->getConsolidatedPresence()
|
||||
);
|
||||
|
||||
emit presenceStatusChanged(status);
|
||||
emit presenceLevelChanged(Presence::getPresenceLevel(status));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public:
|
|||
return m_vcard;
|
||||
}
|
||||
|
||||
void presenceReceived ();
|
||||
void refreshPresence ();
|
||||
|
||||
Q_INVOKABLE void startEdit ();
|
||||
Q_INVOKABLE void endEdit ();
|
||||
|
|
|
|||
|
|
@ -69,12 +69,11 @@ void CoreHandlers::onMessageReceived (
|
|||
|
||||
void CoreHandlers::onNotifyPresenceReceivedForUriOrTel (
|
||||
const shared_ptr<linphone::Core> &,
|
||||
const shared_ptr<linphone::Friend> &lf,
|
||||
const shared_ptr<linphone::Friend> &linphone_friend,
|
||||
const string &,
|
||||
const shared_ptr<linphone::PresenceModel> &
|
||||
) {
|
||||
ContactModel *contact_model = &lf->getData<ContactModel>("contact-model");
|
||||
contact_model->presenceReceived();
|
||||
linphone_friend->getData<ContactModel>("contact-model").refreshPresence();
|
||||
}
|
||||
|
||||
void CoreHandlers::onRegistrationStateChanged (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue