summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-11-05 10:39:07 (UTC)
committer llornkcor <llornkcor>2003-11-05 10:39:07 (UTC)
commit15163234024750178829812f31a1e7173a66fa1d (patch) (side-by-side diff)
treef5bae5403ebe3194d95a58783f06895659616e8e
parent91369ae9ca93f499fd0883a13f046a4b435d1b56 (diff)
downloadopie-15163234024750178829812f31a1e7173a66fa1d.zip
opie-15163234024750178829812f31a1e7173a66fa1d.tar.gz
opie-15163234024750178829812f31a1e7173a66fa1d.tar.bz2
make compile. needs fixing
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/doclnksearch.cpp4
-rw-r--r--core/pim/osearch/searchgroup.h2
2 files changed, 4 insertions, 2 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
@@ -1,93 +1,95 @@
//
//
// C++ Implementation: $MODULE$
//
// Description:
//
//
// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include <qaction.h>
#include <qfile.h>
#include <qiconset.h>
#include <qpopupmenu.h>
#include <qtextstream.h>
#include <qpe/applnk.h>
#include <qpe/config.h>
#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
#include <opie/owait.h>
#include "doclnkitem.h"
#include "doclnksearch.h"
DocLnkSearch::DocLnkSearch(QListView* parent, QString name)
: AppLnkSearch(parent, name), _popupMenu(0)
{
QIconSet is = Resource::loadIconSet( "osearch/documents" );
setPixmap( 0, is.pixmap( QIconSet::Small, true ) );
actionSearchInFiles = new QAction( QObject::tr("search content"),QString::null, 0, 0, 0, true );
Config cfg( "osearch", Config::User );
cfg.setGroup( "doclnk_settings" );
actionSearchInFiles->setOn( cfg.readBoolEntry( "search_content", false ) );
}
DocLnkSearch::~DocLnkSearch()
{
Config cfg( "osearch", Config::User );
cfg.setGroup( "doclnk_settings" );
cfg.writeEntry( "search_content", actionSearchInFiles->isOn() );
}
void DocLnkSearch::load()
{
_apps = new DocLnkSet(QPEApplication::documentDir());
}
bool DocLnkSearch::searchFile( AppLnk *app )
{
if (!actionSearchInFiles->isOn()) return false;
DocLnk *doc = (DocLnk*)app;
bool found = false;
if ( doc->type().contains( "text" ) ){
#ifdef NEW_OWAIT
QString ouput = QObject::tr("searching %1").arg(doc->file());
OWait( output );
#endif
QFile f(doc->file());
if ( f.open(IO_ReadOnly) ) {
QTextStream t( &f );
while ( !t.eof() )
if (_search.match( t.readLine()) != -1) {
found = true;
break;
}
}
f.close();
}
return found;
}
void DocLnkSearch::insertItem( void *rec )
{
(void)new DocLnkItem( this, (DocLnk*)rec );
_resultCount++;
}
QPopupMenu* DocLnkSearch::popupMenu()
{
if (!_popupMenu){
_popupMenu = new QPopupMenu( 0 );
actionSearchInFiles->addTo( _popupMenu );
}
return _popupMenu;
- (void) new DocLnkItem( this, (DocLnk*)rec );
+// (void) new DocLnkItem( this, (DocLnk*)rec );
+ // rec is undeclared here
+#warning FIXME
_resultCount++;
}
diff --git a/core/pim/osearch/searchgroup.h b/core/pim/osearch/searchgroup.h
index 23aa82a..48097ab 100644
--- a/core/pim/osearch/searchgroup.h
+++ b/core/pim/osearch/searchgroup.h
@@ -1,49 +1,49 @@
//
//
// C++ Interface: $MODULE$
//
// Description:
//
//
// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef SEARCHGROUP_H
#define SEARCHGROUP_H
#include "olistviewitem.h"
class QRegExp;
class QPopupMenu;
/**
@author Patrick S. Vogt
*/
class SearchGroup : public OListViewItem
{
public:
SearchGroup(QListView* parent, QString name);
~SearchGroup();
+ int _resultCount;
virtual void expand();
virtual void doSearch();
virtual void setSearch(QRegExp);
virtual int rtti() { return Searchgroup;}
protected:
virtual void load() = 0;
virtual int search() = 0;
virtual void insertItem( void* ) = 0;
QRegExp _search;
QRegExp _lastSearch;
QString _name;
private:
int realSearch();
bool loaded :1;
- int _resultCount;
};
#endif