From 60a21c7c96adb6724c9f64f83697ca76fa067d31 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 6 Apr 2017 11:43:29 +0200 Subject: [PATCH] fix(app): little fixes to improve compilation performance --- linphone-desktop/src/components/camera/Camera.hpp | 9 +++++++-- .../src/components/contacts/ContactsListProxyModel.cpp | 8 ++++---- .../src/components/contacts/ContactsListProxyModel.hpp | 5 ++--- linphone-desktop/src/components/notifier/Notifier.hpp | 1 - .../components/smart-search-bar/SmartSearchBarModel.hpp | 2 -- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/linphone-desktop/src/components/camera/Camera.hpp b/linphone-desktop/src/components/camera/Camera.hpp index 5528a1ed1..f9cba1fa0 100644 --- a/linphone-desktop/src/components/camera/Camera.hpp +++ b/linphone-desktop/src/components/camera/Camera.hpp @@ -23,16 +23,21 @@ #ifndef CAMERA_H_ #define CAMERA_H_ +#include + #include #include -#include "../call/CallModel.hpp" - // ============================================================================= +class CallModel; class Camera; struct ContextInfo; +namespace linphone { + class Call; +} + class CameraRenderer : public QQuickFramebufferObject::Renderer { friend class Camera; diff --git a/linphone-desktop/src/components/contacts/ContactsListProxyModel.cpp b/linphone-desktop/src/components/contacts/ContactsListProxyModel.cpp index fbf1e7ce9..51fbe4a10 100644 --- a/linphone-desktop/src/components/contacts/ContactsListProxyModel.cpp +++ b/linphone-desktop/src/components/contacts/ContactsListProxyModel.cpp @@ -76,7 +76,7 @@ bool ContactsListProxyModel::filterAcceptsRow ( const QModelIndex &index = sourceModel()->index(source_row, 0, source_parent); const ContactModel *contact = index.data().value(); - m_weights[contact] = static_cast(round(computeContactWeight(*contact))); + m_weights[contact] = static_cast(round(computeContactWeight(contact))); return m_weights[contact] > 0 && ( !m_use_connected_filter || @@ -125,11 +125,11 @@ float ContactsListProxyModel::computeStringWeight (const QString &string, float return percentage * FACTOR_POS_OTHER; } -float ContactsListProxyModel::computeContactWeight (const ContactModel &contact) const { - float weight = computeStringWeight(contact.getVcardModel()->getUsername(), USERNAME_WEIGHT); +float ContactsListProxyModel::computeContactWeight (const ContactModel *contact) const { + float weight = computeStringWeight(contact->getVcardModel()->getUsername(), USERNAME_WEIGHT); // Get all contact's addresses. - const list > addresses = contact.m_linphone_friend->getAddresses(); + const list > addresses = contact->m_linphone_friend->getAddresses(); float size = static_cast(addresses.size()); for (auto it = addresses.cbegin(); it != addresses.cend(); ++it) diff --git a/linphone-desktop/src/components/contacts/ContactsListProxyModel.hpp b/linphone-desktop/src/components/contacts/ContactsListProxyModel.hpp index 9d8bb6549..2b69fd386 100644 --- a/linphone-desktop/src/components/contacts/ContactsListProxyModel.hpp +++ b/linphone-desktop/src/components/contacts/ContactsListProxyModel.hpp @@ -23,12 +23,11 @@ #ifndef CONTACTS_LIST_PROXY_MODEL_H_ #define CONTACTS_LIST_PROXY_MODEL_H_ -#include "../contact/ContactModel.hpp" - #include // ============================================================================= +class ContactModel; class ContactsListModel; class ContactsListProxyModel : public QSortFilterProxyModel { @@ -52,7 +51,7 @@ protected: private: float computeStringWeight (const QString &string, float percentage) const; - float computeContactWeight (const ContactModel &contact) const; + float computeContactWeight (const ContactModel *contact) const; bool isConnectedFilterUsed () const { return m_use_connected_filter; diff --git a/linphone-desktop/src/components/notifier/Notifier.hpp b/linphone-desktop/src/components/notifier/Notifier.hpp index 5a6f80021..624fd6fbb 100644 --- a/linphone-desktop/src/components/notifier/Notifier.hpp +++ b/linphone-desktop/src/components/notifier/Notifier.hpp @@ -24,7 +24,6 @@ #define NOTIFIER_H_ #include - #include #include diff --git a/linphone-desktop/src/components/smart-search-bar/SmartSearchBarModel.hpp b/linphone-desktop/src/components/smart-search-bar/SmartSearchBarModel.hpp index 927a5b50e..63f2c885a 100644 --- a/linphone-desktop/src/components/smart-search-bar/SmartSearchBarModel.hpp +++ b/linphone-desktop/src/components/smart-search-bar/SmartSearchBarModel.hpp @@ -23,8 +23,6 @@ #ifndef SMART_SEARCH_BAR_MODEL_H_ #define SMART_SEARCH_BAR_MODEL_H_ -#include "../sip-addresses/SipAddressesModel.hpp" - #include // =============================================================================