Skip to content
Snippets Groups Projects
Commit 98dc54e3 authored by Emmanuel Lepage's avatar Emmanuel Lepage
Browse files

[ #10222 ] Fix contact sorting

parent 71e593f8
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@
#include <QObject>
#include <QVector>
#include <QHash>
#include <QMap>
#include "typedefs.h"
//Qt
......@@ -37,7 +37,7 @@ class AccountList;
class Account;
class ContactBackend;
typedef QHash<QString, Call*> CallHash;
typedef QMap<QString, Call*> CallMap;
typedef QList<Call*> CallList;
///@class CallModelBase Base class for the central model/frontend
......@@ -128,7 +128,7 @@ class LIB_EXPORT CallModel : public CallModelBase {
//Getters
int size ();
CallList getCallList ();
static const CallHash& getHistory ();
static const CallMap& getHistory ();
static const QStringList getNumbersByPopularity ();
static const QStringList getHistoryCallId ();
......@@ -191,8 +191,8 @@ class LIB_EXPORT CallModel : public CallModelBase {
typedef QHash< Index , InternalStruct* > InternalIndex ;
//Static attributes
static CallHash m_sActiveCalls ;
static CallHash m_sHistoryCalls;
static CallMap m_sActiveCalls ;
static CallMap m_sHistoryCalls;
static InternalCall m_sPrivateCallList_call ;
static InternalCallId m_sPrivateCallList_callId;
......
......@@ -45,8 +45,8 @@ template <typename CallWidget, typename Index> bool CallModel<CallWidget,Index>
template <typename CallWidget, typename Index> bool CallModel<CallWidget,Index>::m_sCallInit = false ;
template <typename CallWidget, typename Index> bool CallModel<CallWidget,Index>::m_sHistoryInit = false ;
template <typename CallWidget, typename Index> QHash<QString, Call*> CallModel<CallWidget,Index>::m_sActiveCalls ;
template <typename CallWidget, typename Index> QHash<QString, Call*> CallModel<CallWidget,Index>::m_sHistoryCalls ;
template <typename CallWidget, typename Index> CallMap CallModel<CallWidget,Index>::m_sActiveCalls ;
template <typename CallWidget, typename Index> CallMap CallModel<CallWidget,Index>::m_sHistoryCalls ;
template <typename CallWidget, typename Index> typename CallModel<CallWidget,Index>::InternalCall CallModel<CallWidget,Index>::m_sPrivateCallList_call ;
template <typename CallWidget, typename Index> typename CallModel<CallWidget,Index>::InternalCallId CallModel<CallWidget,Index>::m_sPrivateCallList_callId ;
......@@ -434,7 +434,7 @@ template<typename CallWidget, typename Index> const QStringList CallModel<CallWi
}
///Return the history list
template<typename CallWidget, typename Index> const CallHash& CallModel<CallWidget,Index>::getHistory()
template<typename CallWidget, typename Index> const CallMap& CallModel<CallWidget,Index>::getHistory()
{
qDebug() << "Getting history" << m_sHistoryCalls.count();
return m_sHistoryCalls;
......@@ -474,6 +474,7 @@ template<typename CallWidget, typename Index> const QStringList CallModel<CallWi
return cl;
}
/*****************************************************************************
* *
* Account related code *
......
......@@ -106,6 +106,17 @@ const QString& Contact::getUid() const
return m_Uid;
}
///Get the group
const QString& Contact::getGroup() const
{
return m_Group;
}
const QString& Contact::getDepartment() const
{
return m_Department;
}
///Get the contact type
const QString& Contact::getType() const
{
......@@ -165,3 +176,15 @@ void Contact::setUid(const QString& id)
{
m_Uid = id;
}
///Set Group
void Contact::setGroup(const QString& name)
{
m_Group = name;
}
///Set department
void Contact::setDepartment(const QString& name)
{
m_Department = name;
}
\ No newline at end of file
......@@ -69,6 +69,8 @@ private:
QString m_PreferredEmail ;
QString m_Organization ;
QString m_Uid ;
QString m_Group ;
QString m_Department ;
bool m_DisplayPhoto ;
PhoneNumbers m_Numbers ;
......@@ -89,6 +91,8 @@ public:
virtual const QString& getPreferredEmail() const;
virtual const QPixmap* getPhoto() const;
virtual const QString& getType() const;
virtual const QString& getGroup() const;
virtual const QString& getDepartment() const;
//Setters
virtual void setPhoneNumbers ( PhoneNumbers );
......@@ -98,6 +102,8 @@ public:
virtual void setFamilyName ( const QString& name );
virtual void setOrganization ( const QString& name );
virtual void setPreferredEmail ( const QString& name );
virtual void setGroup ( const QString& name );
virtual void setDepartment ( const QString& name );
virtual void setUid ( const QString& id );
virtual void setPhoto ( QPixmap* photo );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment