qcpix/src/qcpixsearcher.cpp
changeset 1 6f2c1c46032b
parent 0 671dee74050a
child 3 ae3f1779f6da
equal deleted inserted replaced
0:671dee74050a 1:6f2c1c46032b
    29  */
    29  */
    30 
    30 
    31 QCPixSearcher::QCPixSearcher( QString aDefaultSearchField )
    31 QCPixSearcher::QCPixSearcher( QString aDefaultSearchField )
    32     :iPvtImpl( new QCPixSearcherPrivate( this ) )
    32     :iPvtImpl( new QCPixSearcherPrivate( this ) )
    33     {
    33     {
       
    34     PERF_SEARCH_START_TIMER
       
    35     PERF_GETDOC_START_TIMER
    34     }
    36     }
    35 
    37 
    36 QCPixSearcher::~QCPixSearcher()
    38 QCPixSearcher::~QCPixSearcher()
    37     {
    39     {
    38     delete iPvtImpl;
    40     delete iPvtImpl;
    79     QT_TRAP_THROWING( iPvtImpl->iSearcher->OpenDatabaseL( *iPvtImpl, baseAppClass ) );
    81     QT_TRAP_THROWING( iPvtImpl->iSearcher->OpenDatabaseL( *iPvtImpl, baseAppClass ) );
    80     }
    82     }
    81 
    83 
    82 int QCPixSearcher::search( QString aSearchString, QString aDefaultSearchField )
    84 int QCPixSearcher::search( QString aSearchString, QString aDefaultSearchField )
    83     {
    85     {
       
    86     PERF_SEARCH_RESTART_TIMER
    84     TBuf<KMaxStringLength> searchString( aSearchString.utf16() );
    87     TBuf<KMaxStringLength> searchString( aSearchString.utf16() );
    85     TBuf<KMaxStringLength> defaultSearchField( aDefaultSearchField.utf16() );
    88     TBuf<KMaxStringLength> defaultSearchField( aDefaultSearchField.utf16() );
    86     //ideally would have had just the following single line:
    89     //ideally would have had just the following single line:
    87     //QT_TRAP_THROWING( return iPvtImpl->iSearcher->SearchL( searchString, defaultSearchField ) );
    90     //QT_TRAP_THROWING( return iPvtImpl->iSearcher->SearchL( searchString, defaultSearchField ) );
    88     //But the RCVT compiler throws up warnings. The following is just to suppress those warnings.
    91     //But the RCVT compiler throws up warnings. The following is just to suppress those warnings.
    89     int tmp = 0;
    92     int tmp = 0;
    90     QT_TRAP_THROWING( tmp = iPvtImpl->iSearcher->SearchL( searchString, defaultSearchField ) );
    93     QT_TRAP_THROWING( tmp = iPvtImpl->iSearcher->SearchL( searchString, defaultSearchField ) );
       
    94     PERF_SEARCH_ENDLOG
    91     return tmp;
    95     return tmp;
    92     }
    96     }
    93 
    97 
    94 void QCPixSearcher::searchAsync( QString aSearchString, QString aDefaultSearchField )
    98 void QCPixSearcher::searchAsync( QString aSearchString, QString aDefaultSearchField )
    95     {
    99     {
       
   100     PERF_TIME_NOW("Async search start")
    96     TBuf<KMaxStringLength> searchString( aSearchString.utf16() );
   101     TBuf<KMaxStringLength> searchString( aSearchString.utf16() );
    97     TBuf<KMaxStringLength> defaultSearchField( aDefaultSearchField.utf16() );
   102     TBuf<KMaxStringLength> defaultSearchField( aDefaultSearchField.utf16() );
    98     QT_TRAP_THROWING( iPvtImpl->iSearcher->SearchL( *iPvtImpl, searchString, defaultSearchField ) );
   103     QT_TRAP_THROWING( iPvtImpl->iSearcher->SearchL( *iPvtImpl, searchString, defaultSearchField ) );
    99     }
   104     }
   100 
   105 
   101 QCPixDocument* QCPixSearcher::getDocument( int aIndex )
   106 QCPixDocument* QCPixSearcher::getDocument( int aIndex )
   102     {
   107     {
       
   108     PERF_GETDOC_RESTART_TIMER
   103     QCPixDocument* tmp = 0;
   109     QCPixDocument* tmp = 0;
   104     QT_TRAP_THROWING( tmp = QCPixDocFromCPixDoc( iPvtImpl->iSearcher->GetDocumentL( aIndex ) ) );
   110     QT_TRAP_THROWING( tmp = QCPixDocFromCPixDoc( iPvtImpl->iSearcher->GetDocumentL( aIndex ) ) );
       
   111     PERF_GETDOC_ENDLOG
   105     return tmp;
   112     return tmp;
   106     }
   113     }
   107  
   114 
   108 void QCPixSearcher::getDocumentAsync( int aIndex )
   115 void QCPixSearcher::getDocumentAsync( int aIndex )
   109     {
   116     {
       
   117     PERF_TIME_NOW("Async get document start")
   110     QT_TRAP_THROWING( iPvtImpl->iSearcher->GetDocumentL( aIndex, *iPvtImpl ) );
   118     QT_TRAP_THROWING( iPvtImpl->iSearcher->GetDocumentL( aIndex, *iPvtImpl ) );
   111     }
   119     }
   112 
   120 
   113 void QCPixSearcher::cancelSearch()
   121 void QCPixSearcher::cancelSearch()
   114     {
   122     {