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