14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #include "searchhandler.h" |
18 #include "searchhandler.h" |
19 #include <qcpixsearcher.h> |
19 #include <cpixsearcher.h> |
20 #include <qcpixdocument.h> |
20 #include <cpixdocument.h> |
21 |
21 |
22 CSearchHandler::CSearchHandler() |
22 CSearchHandler::CSearchHandler() |
23 { |
23 { |
24 iSearchInterface = QCPixSearcher::newInstance("root","_aggregate"); |
24 iSearchInterface = CpixSearcher::newInstance("root","_aggregate"); |
25 iSearchInterface->connect(iSearchInterface, SIGNAL(handleSearchResults(int,int)), this, SLOT(__handleSearchResult(int,int))); |
25 iSearchInterface->connect(iSearchInterface, SIGNAL(handleSearchResults(int,int)), this, SLOT(__handleSearchResult(int,int))); |
26 iSearchInterface->connect(iSearchInterface, SIGNAL(handleDocument(int,QCPixDocument*)), this, SLOT(__getDocumentAsync(int,QCPixDocument*))); |
26 iSearchInterface->connect(iSearchInterface, SIGNAL(handleDocument(int,CpixDocument*)), this, SLOT(__getDocumentAsync(int,CpixDocument*))); |
27 } |
27 } |
28 |
28 |
29 void CSearchHandler::__handleSearchResult(int aError, int estimatedResultCount) |
29 void CSearchHandler::__handleSearchResult(int aError, int estimatedResultCount) |
30 { |
30 { |
31 qDebug() << aError << estimatedResultCount; |
31 qDebug() << aError << estimatedResultCount; |
32 iSearchresultCount= estimatedResultCount; |
32 iSearchresultCount= estimatedResultCount; |
33 emit handleAsyncSearchResult(aError, estimatedResultCount); |
33 emit handleAsyncSearchResult(aError, estimatedResultCount); |
34 } |
34 } |
35 |
35 |
36 void CSearchHandler::__getDocumentAsync(int aError, QCPixDocument* aDocument ) |
36 void CSearchHandler::__getDocumentAsync(int aError, CpixDocument* aDocument ) |
37 { |
37 { |
38 emit handleDocument( aError, aDocument ); |
38 emit handleDocument( aError, aDocument ); |
39 } |
39 } |
40 |
40 |
41 QCPixDocument* CSearchHandler::getDocumentAtIndex(int aIndex) |
41 CpixDocument* CSearchHandler::getDocumentAtIndex(int aIndex) |
42 { |
42 { |
43 return iSearchInterface->getDocument( aIndex ); |
43 return iSearchInterface->document( aIndex ); |
44 } |
44 } |
45 |
45 |
46 void CSearchHandler::search(QString aSearchString) |
46 void CSearchHandler::search(QString aSearchString) |
47 { |
47 { |
48 qDebug() << "CSearchHandler::search Enter"; |
48 qDebug() << "CSearchHandler::search Enter"; |
61 return iSearchresultCount; |
61 return iSearchresultCount; |
62 } |
62 } |
63 |
63 |
64 void CSearchHandler::getDocumentAsyncAtIndex( int aIndex ) |
64 void CSearchHandler::getDocumentAsyncAtIndex( int aIndex ) |
65 { |
65 { |
66 iSearchInterface->getDocumentAsync( aIndex ); |
66 iSearchInterface->documentAsync( aIndex ); |
67 } |
67 } |
68 |
68 |
69 void CSearchHandler::searchAsync(QString aSearchString) |
69 void CSearchHandler::searchAsync(QString aSearchString) |
70 { |
70 { |
71 iSearchInterface->searchAsync( aSearchString ); |
71 iSearchInterface->searchAsync( aSearchString ); |