Commit 60a21c7c authored by Ronan Abhamon's avatar Ronan Abhamon

fix(app): little fixes to improve compilation performance

parent 3bc72a26
...@@ -23,16 +23,21 @@ ...@@ -23,16 +23,21 @@
#ifndef CAMERA_H_ #ifndef CAMERA_H_
#define CAMERA_H_ #define CAMERA_H_
#include <memory>
#include <QOpenGLFramebufferObject> #include <QOpenGLFramebufferObject>
#include <QQuickFramebufferObject> #include <QQuickFramebufferObject>
#include "../call/CallModel.hpp"
// ============================================================================= // =============================================================================
class CallModel;
class Camera; class Camera;
struct ContextInfo; struct ContextInfo;
namespace linphone {
class Call;
}
class CameraRenderer : public QQuickFramebufferObject::Renderer { class CameraRenderer : public QQuickFramebufferObject::Renderer {
friend class Camera; friend class Camera;
......
...@@ -76,7 +76,7 @@ bool ContactsListProxyModel::filterAcceptsRow ( ...@@ -76,7 +76,7 @@ bool ContactsListProxyModel::filterAcceptsRow (
const QModelIndex &index = sourceModel()->index(source_row, 0, source_parent); const QModelIndex &index = sourceModel()->index(source_row, 0, source_parent);
const ContactModel *contact = index.data().value<ContactModel *>(); const ContactModel *contact = index.data().value<ContactModel *>();
m_weights[contact] = static_cast<unsigned int>(round(computeContactWeight(*contact))); m_weights[contact] = static_cast<unsigned int>(round(computeContactWeight(contact)));
return m_weights[contact] > 0 && ( return m_weights[contact] > 0 && (
!m_use_connected_filter || !m_use_connected_filter ||
...@@ -125,11 +125,11 @@ float ContactsListProxyModel::computeStringWeight (const QString &string, float ...@@ -125,11 +125,11 @@ float ContactsListProxyModel::computeStringWeight (const QString &string, float
return percentage * FACTOR_POS_OTHER; return percentage * FACTOR_POS_OTHER;
} }
float ContactsListProxyModel::computeContactWeight (const ContactModel &contact) const { float ContactsListProxyModel::computeContactWeight (const ContactModel *contact) const {
float weight = computeStringWeight(contact.getVcardModel()->getUsername(), USERNAME_WEIGHT); float weight = computeStringWeight(contact->getVcardModel()->getUsername(), USERNAME_WEIGHT);
// Get all contact's addresses. // Get all contact's addresses.
const list<shared_ptr<linphone::Address> > addresses = contact.m_linphone_friend->getAddresses(); const list<shared_ptr<linphone::Address> > addresses = contact->m_linphone_friend->getAddresses();
float size = static_cast<float>(addresses.size()); float size = static_cast<float>(addresses.size());
for (auto it = addresses.cbegin(); it != addresses.cend(); ++it) for (auto it = addresses.cbegin(); it != addresses.cend(); ++it)
......
...@@ -23,12 +23,11 @@ ...@@ -23,12 +23,11 @@
#ifndef CONTACTS_LIST_PROXY_MODEL_H_ #ifndef CONTACTS_LIST_PROXY_MODEL_H_
#define CONTACTS_LIST_PROXY_MODEL_H_ #define CONTACTS_LIST_PROXY_MODEL_H_
#include "../contact/ContactModel.hpp"
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>
// ============================================================================= // =============================================================================
class ContactModel;
class ContactsListModel; class ContactsListModel;
class ContactsListProxyModel : public QSortFilterProxyModel { class ContactsListProxyModel : public QSortFilterProxyModel {
...@@ -52,7 +51,7 @@ protected: ...@@ -52,7 +51,7 @@ protected:
private: private:
float computeStringWeight (const QString &string, float percentage) const; float computeStringWeight (const QString &string, float percentage) const;
float computeContactWeight (const ContactModel &contact) const; float computeContactWeight (const ContactModel *contact) const;
bool isConnectedFilterUsed () const { bool isConnectedFilterUsed () const {
return m_use_connected_filter; return m_use_connected_filter;
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#define NOTIFIER_H_ #define NOTIFIER_H_
#include <linphone++/linphone.hh> #include <linphone++/linphone.hh>
#include <QMutex> #include <QMutex>
#include <QObject> #include <QObject>
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
#ifndef SMART_SEARCH_BAR_MODEL_H_ #ifndef SMART_SEARCH_BAR_MODEL_H_
#define SMART_SEARCH_BAR_MODEL_H_ #define SMART_SEARCH_BAR_MODEL_H_
#include "../sip-addresses/SipAddressesModel.hpp"
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>
// ============================================================================= // =============================================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment