qtmobility/src/messaging/qmessageaccountid_maemo.cpp
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
child 11 06b8e2af4411
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
    38 ** $QT_END_LICENSE$
    38 ** $QT_END_LICENSE$
    39 **
    39 **
    40 ****************************************************************************/
    40 ****************************************************************************/
    41 #include "qmessageaccountid.h"
    41 #include "qmessageaccountid.h"
    42 #include "qmessageaccountid_p.h"
    42 #include "qmessageaccountid_p.h"
       
    43 
       
    44 #include <qhash.h>
    43 
    45 
    44 QTM_BEGIN_NAMESPACE
    46 QTM_BEGIN_NAMESPACE
    45 
    47 
    46 QMessageAccountId::QMessageAccountId()
    48 QMessageAccountId::QMessageAccountId()
    47  : d_ptr(0)
    49  : d_ptr(0)
    97 bool QMessageAccountId::operator<(const QMessageAccountId& other) const
    99 bool QMessageAccountId::operator<(const QMessageAccountId& other) const
    98 {
   100 {
    99     long left = 0;
   101     long left = 0;
   100     long right = 0;
   102     long right = 0;
   101     if (d_ptr) {
   103     if (d_ptr) {
   102         left = d_ptr->_id.toLong();
   104         left = qHash(d_ptr->_id);
   103     }
   105     }
   104     if (other.d_ptr) {
   106     if (other.d_ptr) {
   105         right = other.d_ptr->_id.toLong();
   107         right = qHash(other.d_ptr->_id);
   106     }
   108     }
   107 
   109 
   108     return (left < right);
   110     return (left < right);
   109 }
   111 }
   110 
   112 
   122     return (d_ptr && !d_ptr->_id.isEmpty());
   124     return (d_ptr && !d_ptr->_id.isEmpty());
   123 }
   125 }
   124 
   126 
   125 uint qHash(const QMessageAccountId &id)
   127 uint qHash(const QMessageAccountId &id)
   126 {
   128 {
   127     //TODO: return qHash(id.toString());
   129     return qHash(id.toString());
   128 }
   130 }
   129 
   131 
   130 QTM_END_NAMESPACE
   132 QTM_END_NAMESPACE