equal
deleted
inserted
replaced
204 // ----------------------------------------------------------------------------- |
204 // ----------------------------------------------------------------------------- |
205 // |
205 // |
206 int LogsMatchesModel::doSetPredictiveSearch(bool enabled) |
206 int LogsMatchesModel::doSetPredictiveSearch(bool enabled) |
207 { |
207 { |
208 LOGS_QDEBUG( "logs [ENG] -> LogsMatchesModel::doSetPredictiveSearch()" ) |
208 LOGS_QDEBUG( "logs [ENG] -> LogsMatchesModel::doSetPredictiveSearch()" ) |
209 int err = mDbConnector->setPredictiveSearch(enabled); |
209 int err = LogsCommonData::getInstance().setPredictiveSearch(enabled); |
210 if (!err) { |
210 if (!err) { |
211 //in case of search is turned off, getLogMatches will only reset |
211 //in case of search is turned off, getLogMatches will only reset |
212 //previous search results |
212 //previous search results |
213 forceSearchQuery(); |
213 forceSearchQuery(); |
214 } |
214 } |
332 // |
332 // |
333 // ----------------------------------------------------------------------------- |
333 // ----------------------------------------------------------------------------- |
334 // |
334 // |
335 void LogsMatchesModel::initPredictiveSearch() |
335 void LogsMatchesModel::initPredictiveSearch() |
336 { |
336 { |
337 int searchStatus = mDbConnector->predictiveSearchStatus(); |
337 int searchStatus = LogsCommonData::getInstance().predictiveSearchStatus(); |
338 //searchStatus equal to 0 means that search should be permanently disabled |
338 //searchStatus equal to 0 means that search should be permanently disabled |
339 if (searchStatus != 0) { |
339 if (searchStatus != 0) { |
340 mLogsCntFinder = new LogsCntFinder(LogsCommonData::getInstance().contactManager(), |
340 mLogsCntFinder = new LogsCntFinder(LogsCommonData::getInstance().contactManager(), |
341 true); |
341 true); |
342 connect(mLogsCntFinder, SIGNAL(queryReady()),this, SLOT(queryReady())); |
342 connect(mLogsCntFinder, SIGNAL(queryReady()),this, SLOT(queryReady())); |
451 // ----------------------------------------------------------------------------- |
451 // ----------------------------------------------------------------------------- |
452 // |
452 // |
453 void LogsMatchesModel::doSearchQuery() |
453 void LogsMatchesModel::doSearchQuery() |
454 { |
454 { |
455 LOGS_QDEBUG( "logs [ENG] -> LogsMatchesModel::doSearchQuery()" ); |
455 LOGS_QDEBUG( "logs [ENG] -> LogsMatchesModel::doSearchQuery()" ); |
456 if (mCurrentSearchPattern != mPrevSearchPattern && |
456 if (mCurrentSearchPattern != mPrevSearchPattern && |
457 mDbConnector->predictiveSearchStatus() == 1 ){ |
457 LogsCommonData::getInstance().predictiveSearchStatus() == 1) { |
458 mPrevSearchPattern = mCurrentSearchPattern; |
458 mPrevSearchPattern = mCurrentSearchPattern; |
459 if (mCurrentSearchPattern.length() > 0) { |
459 if (mCurrentSearchPattern.length() > 0) { |
460 LOGS_QDEBUG( "logs [ENG] do search" ); |
460 LOGS_QDEBUG( "logs [ENG] do search" ); |
461 mLogsCntFinder->predictiveSearchQuery( mCurrentSearchPattern ); |
461 mLogsCntFinder->predictiveSearchQuery( mCurrentSearchPattern ); |
462 } else { |
462 } else { |