57 |
57 |
58 QList<QContactLocalId> CntFilterLocalId::contacts( |
58 QList<QContactLocalId> CntFilterLocalId::contacts( |
59 const QContactFilter &filter, |
59 const QContactFilter &filter, |
60 const QList<QContactSortOrder> &sortOrders, |
60 const QList<QContactSortOrder> &sortOrders, |
61 bool &filterSupportedflag, |
61 bool &filterSupportedflag, |
62 QContactManager::Error &error) |
62 QContactManager::Error* error) |
63 { |
63 { |
64 Q_UNUSED(sortOrders); |
64 Q_UNUSED(sortOrders); |
65 Q_UNUSED(filterSupportedflag); |
65 Q_UNUSED(filterSupportedflag); |
66 //Check if any invalid filter is passed |
66 //Check if any invalid filter is passed |
67 if(!filterSupported(filter)) |
67 if(!filterSupported(filter)) |
68 { |
68 { |
69 error = QContactManager::NotSupportedError; |
69 *error = QContactManager::NotSupportedError; |
70 return QList<QContactLocalId>(); |
70 return QList<QContactLocalId>(); |
71 } |
71 } |
72 QList<QContactLocalId> idList; |
72 QList<QContactLocalId> idList; |
73 |
73 |
74 //Create the query |
74 //Create the query |
75 QString sqlQuery; |
75 QString sqlQuery; |
76 createSelectQuery( filter,sqlQuery,error); |
76 createSelectQuery( filter,sqlQuery,error); |
77 |
77 |
78 //fetch the contacts |
78 //fetch the contacts |
79 if(error != QContactManager::NotSupportedError) |
79 if(*error != QContactManager::NotSupportedError) |
80 { |
80 { |
81 idList = m_srvConnection.searchContacts(sqlQuery, error); |
81 idList = m_srvConnection.searchContacts(sqlQuery, error); |
82 } |
82 } |
83 |
83 |
84 return idList; |
84 return idList; |
99 } |
99 } |
100 |
100 |
101 |
101 |
102 void CntFilterLocalId::createSelectQuery(const QContactFilter& filter, |
102 void CntFilterLocalId::createSelectQuery(const QContactFilter& filter, |
103 QString& sqlQuery, |
103 QString& sqlQuery, |
104 QContactManager::Error& error) |
104 QContactManager::Error* error) |
105 |
105 |
106 { |
106 { |
107 //Check if any invalid filter is passed |
107 //Check if any invalid filter is passed |
108 if(!filterSupported(filter)) |
108 if(!filterSupported(filter)) |
109 { |
109 { |
110 error = QContactManager::NotSupportedError; |
110 *error = QContactManager::NotSupportedError; |
111 } |
111 } |
112 //Not yet supported |
112 //Not yet supported |
113 sqlQuery = ""; |
113 sqlQuery = ""; |
114 |
114 |
115 |
115 |