summaryrefslogtreecommitdiff
authorwaspe <waspe>2003-11-03 18:35:45 (UTC)
committer waspe <waspe>2003-11-03 18:35:45 (UTC)
commitc0fe2d62abe68de74de6b8bf91635c1cdaf5d239 (patch) (unidiff)
tree396acfe28669ac49037fef03d39f8c0e1d038562
parent3a7d9b9ed8f9cf9c7e3d02f9239f327b2b652b0c (diff)
downloadopie-c0fe2d62abe68de74de6b8bf91635c1cdaf5d239.zip
opie-c0fe2d62abe68de74de6b8bf91635c1cdaf5d239.tar.gz
opie-c0fe2d62abe68de74de6b8bf91635c1cdaf5d239.tar.bz2
reolved merge conflict
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/doclnksearch.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/pim/osearch/doclnksearch.cpp b/core/pim/osearch/doclnksearch.cpp
index 3428798..ef0e482 100644
--- a/core/pim/osearch/doclnksearch.cpp
+++ b/core/pim/osearch/doclnksearch.cpp
@@ -27,65 +27,67 @@
27 27
28DocLnkSearch::DocLnkSearch(QListView* parent, QString name) 28DocLnkSearch::DocLnkSearch(QListView* parent, QString name)
29: AppLnkSearch(parent, name), _popupMenu(0) 29: AppLnkSearch(parent, name), _popupMenu(0)
30{ 30{
31 QIconSet is = Resource::loadIconSet( "osearch/documents" ); 31 QIconSet is = Resource::loadIconSet( "osearch/documents" );
32 setPixmap( 0, is.pixmap( QIconSet::Small, true ) ); 32 setPixmap( 0, is.pixmap( QIconSet::Small, true ) );
33 33
34 actionSearchInFiles = new QAction( QObject::tr("search content"),QString::null, 0, 0, 0, true ); 34 actionSearchInFiles = new QAction( QObject::tr("search content"),QString::null, 0, 0, 0, true );
35 Config cfg( "osearch", Config::User ); 35 Config cfg( "osearch", Config::User );
36 cfg.setGroup( "doclnk_settings" ); 36 cfg.setGroup( "doclnk_settings" );
37 actionSearchInFiles->setOn( cfg.readBoolEntry( "search_content", false ) ); 37 actionSearchInFiles->setOn( cfg.readBoolEntry( "search_content", false ) );
38} 38}
39 39
40 40
41DocLnkSearch::~DocLnkSearch() 41DocLnkSearch::~DocLnkSearch()
42{ 42{
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 );
92 _resultCount++;
91} 93}