summaryrefslogtreecommitdiff
path: root/core/pim/osearch/doclnksearch.cpp
Unidiff
Diffstat (limited to 'core/pim/osearch/doclnksearch.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/doclnksearch.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/pim/osearch/doclnksearch.cpp b/core/pim/osearch/doclnksearch.cpp
index ef0e482..26097a4 100644
--- a/core/pim/osearch/doclnksearch.cpp
+++ b/core/pim/osearch/doclnksearch.cpp
@@ -43,51 +43,53 @@ DocLnkSearch::~DocLnkSearch()
43 Config cfg( "osearch", Config::User ); 43 Config cfg( "osearch", Config::User );
44 cfg.setGroup( "doclnk_settings" ); 44 cfg.setGroup( "doclnk_settings" );
45 cfg.writeEntry( "search_content", actionSearchInFiles->isOn() ); 45 cfg.writeEntry( "search_content", actionSearchInFiles->isOn() );
46} 46}
47 47
48void DocLnkSearch::load() 48void DocLnkSearch::load()
49{ 49{
50 _apps = new DocLnkSet(QPEApplication::documentDir()); 50 _apps = new DocLnkSet(QPEApplication::documentDir());
51} 51}
52 52
53bool DocLnkSearch::searchFile( AppLnk *app ) 53bool DocLnkSearch::searchFile( AppLnk *app )
54{ 54{
55 if (!actionSearchInFiles->isOn()) return false; 55 if (!actionSearchInFiles->isOn()) return false;
56 DocLnk *doc = (DocLnk*)app; 56 DocLnk *doc = (DocLnk*)app;
57 bool found = false; 57 bool found = false;
58 if ( doc->type().contains( "text" ) ){ 58 if ( doc->type().contains( "text" ) ){
59#ifdef NEW_OWAIT 59#ifdef NEW_OWAIT
60 QString ouput = QObject::tr("searching %1").arg(doc->file()); 60 QString ouput = QObject::tr("searching %1").arg(doc->file());
61 OWait( output ); 61 OWait( output );
62#endif 62#endif
63 QFile f(doc->file()); 63 QFile f(doc->file());
64 if ( f.open(IO_ReadOnly) ) { 64 if ( f.open(IO_ReadOnly) ) {
65 QTextStream t( &f ); 65 QTextStream t( &f );
66 while ( !t.eof() ) 66 while ( !t.eof() )
67 if (_search.match( t.readLine()) != -1) { 67 if (_search.match( t.readLine()) != -1) {
68 found = true; 68 found = true;
69 break; 69 break;
70 } 70 }
71 } 71 }
72 f.close(); 72 f.close();
73 } 73 }
74 return found; 74 return found;
75} 75}
76 76
77void DocLnkSearch::insertItem( void *rec ) 77void DocLnkSearch::insertItem( void *rec )
78{ 78{
79 (void)new DocLnkItem( this, (DocLnk*)rec ); 79 (void)new DocLnkItem( this, (DocLnk*)rec );
80 _resultCount++; 80 _resultCount++;
81} 81}
82 82
83 83
84QPopupMenu* DocLnkSearch::popupMenu() 84QPopupMenu* DocLnkSearch::popupMenu()
85{ 85{
86 if (!_popupMenu){ 86 if (!_popupMenu){
87 _popupMenu = new QPopupMenu( 0 ); 87 _popupMenu = new QPopupMenu( 0 );
88 actionSearchInFiles->addTo( _popupMenu ); 88 actionSearchInFiles->addTo( _popupMenu );
89 } 89 }
90 return _popupMenu; 90 return _popupMenu;
91 (void) new DocLnkItem( this, (DocLnk*)rec ); 91 //(void) new DocLnkItem( this, (DocLnk*)rec );
92 // rec is undeclared here
93#warning FIXME
92 _resultCount++; 94 _resultCount++;
93} 95}