From 49615014f281a58bd9bde5543692ffddab052755 Mon Sep 17 00:00:00 2001 From: harlekin Date: Mon, 01 Mar 2004 16:38:12 +0000 Subject: osearch libopie1->libopie2 --- (limited to 'core') diff --git a/core/pim/osearch/adresssearch.cpp b/core/pim/osearch/adresssearch.cpp index 7681ea2..dbd6df6 100644 --- a/core/pim/osearch/adresssearch.cpp +++ b/core/pim/osearch/adresssearch.cpp @@ -11,23 +11,22 @@ // // #include "adresssearch.h" +#include "contactitem.h" + +#include #include #include //#include -#include -#include - -#include "contactitem.h" AdressSearch::AdressSearch(QListView* parent, QString name): SearchGroup(parent, name) { _contacts = 0; - QIconSet is = Resource::loadIconSet( "addressbook/AddressBookSmall" ); + QIconSet is = Resource::loadIconSet( "addressbook/AddressBookSmall" ); setPixmap( 0, is.pixmap( QIconSet::Large, true ) ); - - + + // QWhatsThis::add( this, QObject::tr("Search the addressbook") ); /* QPixmap pix = Resource::loadPixmap( "addressbook/AddressBook" ); QImage img = pix.convertToImage(); @@ -44,14 +43,14 @@ AdressSearch::~AdressSearch() void AdressSearch::load() { - _contacts = new OContactAccess("osearch"); + _contacts = new OPimContactAccess("osearch"); } int AdressSearch::search() { - ORecordList results = _contacts->matchRegexp(_search); + OPimRecordList results = _contacts->matchRegexp(_search); for (uint i = 0; i < results.count(); i++) { - (void)new ContactItem( this, new OContact( results[i] )); + (void)new ContactItem( this, new OPimContact( results[i] )); } return results.count(); } diff --git a/core/pim/osearch/adresssearch.h b/core/pim/osearch/adresssearch.h index d5c7622..028521a 100644 --- a/core/pim/osearch/adresssearch.h +++ b/core/pim/osearch/adresssearch.h @@ -1,5 +1,3 @@ -// -// // C++ Interface: $MODULE$ // // Description: @@ -14,8 +12,10 @@ #define ADRESSSEARCH_H #include "searchgroup.h" +#include + +using namespace Opie; -class OContactAccess; /** @author Patrick S. Vogt @@ -32,7 +32,7 @@ protected: virtual void insertItem( void* ); private: - OContactAccess *_contacts; + OPimContactAccess *_contacts; }; #endif diff --git a/core/pim/osearch/applnkitem.cpp b/core/pim/osearch/applnkitem.cpp index 2c4a4cb..06c2b1e 100644 --- a/core/pim/osearch/applnkitem.cpp +++ b/core/pim/osearch/applnkitem.cpp @@ -13,9 +13,10 @@ #include "applnkitem.h" #include -#include #include +#include + AppLnkItem::AppLnkItem(OListViewItem* parent, AppLnk *app) : ResultItem(parent) { diff --git a/core/pim/osearch/applnksearch.cpp b/core/pim/osearch/applnksearch.cpp index e8170c5..1c84d66 100644 --- a/core/pim/osearch/applnksearch.cpp +++ b/core/pim/osearch/applnksearch.cpp @@ -11,14 +11,13 @@ // // #include "applnksearch.h" +#include "applnkitem.h" #include #include -#include #include -#include "applnkitem.h" - +#include AppLnkSearch::AppLnkSearch(QListView* parent, QString name): SearchGroup(parent, name) { @@ -43,16 +42,16 @@ void AppLnkSearch::load() int AppLnkSearch::search() { QList appList = _apps->children(); - + for ( AppLnk *app = appList.first(); app != 0; app = appList.next() ){ if ( (_search.match( app->name() ) != -1) || (_search.match(app->comment()) != -1) - || (_search.match(app->exec()) != -1) ) { + || (_search.match(app->exec()) != -1) ) { insertItem( app ); }else if (searchFile( app )) - insertItem( app ); - qApp->processEvents( 100 ); + insertItem( app ); + qApp->processEvents( 100 ); } return _resultCount; } diff --git a/core/pim/osearch/contactitem.cpp b/core/pim/osearch/contactitem.cpp index c4738ae..eedc374 100644 --- a/core/pim/osearch/contactitem.cpp +++ b/core/pim/osearch/contactitem.cpp @@ -12,12 +12,13 @@ // #include "contactitem.h" -#include -#include #include #include -ContactItem::ContactItem(OListViewItem* parent, OContact *contact) +#include + + +ContactItem::ContactItem(OListViewItem* parent, OPimContact *contact) : ResultItem(parent) { _contact = contact; diff --git a/core/pim/osearch/contactitem.h b/core/pim/osearch/contactitem.h index d6303e2..3c553fc 100644 --- a/core/pim/osearch/contactitem.h +++ b/core/pim/osearch/contactitem.h @@ -13,9 +13,12 @@ #ifndef CONTACTITEM_H #define CONTACTITEM_H +#include +#include + #include "resultitem.h" -class OContact; +using namespace Opie; /** @author Patrick S. Vogt @@ -23,7 +26,7 @@ class OContact; class ContactItem : public ResultItem { public: - ContactItem(OListViewItem* parent, OContact *contact); + ContactItem(OListViewItem* parent, OPimContact *contact); ~ContactItem(); @@ -34,7 +37,7 @@ public: private: void setIcon(); - OContact *_contact; + OPimContact *_contact; }; diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp index 50c76e0..2b4660a 100644 --- a/core/pim/osearch/datebooksearch.cpp +++ b/core/pim/osearch/datebooksearch.cpp @@ -2,7 +2,7 @@ // // C++ Implementation: $MODULE$ // -// Description: +// Description: // // // Author: Patrick S. Vogt , (C) 2003 @@ -11,19 +11,22 @@ // // #include "datebooksearch.h" - #include "eventitem.h" +#include +#include + + #include #include -#include -#include -#include + #include #include #include #include + + DatebookSearch::DatebookSearch(QListView* parent, QString name) : SearchGroup(parent, name), _dates(0), _popupMenu(0) { @@ -59,15 +62,15 @@ void DatebookSearch::load() int DatebookSearch::search() { - ORecordList results = _dates->matchRegexp(_search); + OPimRecordList results = _dates->matchRegexp(_search); for (uint i = 0; i < results.count(); i++) - insertItem( new OEvent( results[i] ) ); + insertItem( new OPimEvent( results[i] ) ); return _resultCount; } void DatebookSearch::insertItem( void *rec ) { - OEvent *ev = (OEvent*)rec; + OPimEvent *ev = (OPimEvent*)rec; if ( !actionShowPastEvents->isOn() && ev->endDateTime() < QDateTime::currentDateTime() && !ev->recurrence().doesRecur() diff --git a/core/pim/osearch/datebooksearch.h b/core/pim/osearch/datebooksearch.h index a6d115e..2af727d 100644 --- a/core/pim/osearch/datebooksearch.h +++ b/core/pim/osearch/datebooksearch.h @@ -14,8 +14,10 @@ #define DATEBOOKSEARCH_H #include "searchgroup.h" +#include + +using namespace Opie; -class ODateBookAccess; class QAction; /** diff --git a/core/pim/osearch/doclnkitem.cpp b/core/pim/osearch/doclnkitem.cpp index 56eb26a..1516b8e 100644 --- a/core/pim/osearch/doclnkitem.cpp +++ b/core/pim/osearch/doclnkitem.cpp @@ -13,10 +13,11 @@ #include "doclnkitem.h" #include +#include + #include #include #include -#include DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app) : ResultItem(parent) diff --git a/core/pim/osearch/doclnksearch.cpp b/core/pim/osearch/doclnksearch.cpp index b03dbd8..c73dcbf 100644 --- a/core/pim/osearch/doclnksearch.cpp +++ b/core/pim/osearch/doclnksearch.cpp @@ -11,19 +11,23 @@ // // + +#include "doclnkitem.h" +#include "doclnksearch.h" + +#include + +#include +#include +#include +#include + #include #include #include #include #include -#include -#include -#include -#include -#include -#include "doclnkitem.h" -#include "doclnksearch.h" DocLnkSearch::DocLnkSearch(QListView* parent, QString name) : AppLnkSearch(parent, name), _popupMenu(0) diff --git a/core/pim/osearch/eventitem.cpp b/core/pim/osearch/eventitem.cpp index 3228093..f6e34fe 100644 --- a/core/pim/osearch/eventitem.cpp +++ b/core/pim/osearch/eventitem.cpp @@ -12,14 +12,14 @@ // #include "eventitem.h" -#include -#include + #include #include -//#include -#include -EventItem::EventItem(OListViewItem* parent, OEvent *event) +#include +#include + +EventItem::EventItem(OListViewItem* parent, OPimEvent *event) : ResultItem(parent) { _event = event; diff --git a/core/pim/osearch/eventitem.h b/core/pim/osearch/eventitem.h index 5f9c9fc..68923f1 100644 --- a/core/pim/osearch/eventitem.h +++ b/core/pim/osearch/eventitem.h @@ -15,7 +15,9 @@ #include "resultitem.h" -class OEvent; +#include + +using namespace Opie; /** @author Patrick S. Vogt @@ -23,7 +25,7 @@ class OEvent; class EventItem : public ResultItem { public: - EventItem(OListViewItem* parent, OEvent *event); + EventItem(OListViewItem* parent, OPimEvent *event); ~EventItem(); @@ -33,7 +35,7 @@ public: private: void setIcon(); - OEvent *_event; + OPimEvent *_event; }; diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp index 55302cb..95f5967 100644 --- a/core/pim/osearch/mainwindow.cpp +++ b/core/pim/osearch/mainwindow.cpp @@ -10,7 +10,27 @@ // (c) 2002 Patrick S. Vogt +#include "olistview.h" +#include "olistviewitem.h" +#include "resultitem.h" +#include "adresssearch.h" +#include "todosearch.h" +#include "datebooksearch.h" +#include "applnksearch.h" +#include "doclnksearch.h" +#include "mainwindow.h" +#include + +#include +#include +#include + +#include +#include +#include + +#include #include #include #include @@ -29,26 +49,10 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include "olistview.h" -#include "olistviewitem.h" -#include "resultitem.h" -#include "adresssearch.h" -#include "todosearch.h" -#include "datebooksearch.h" -#include "applnksearch.h" -#include "doclnksearch.h" -#include "mainwindow.h" -static const char* const image1_data[] = { + +static const char* const image1_data[] = { "14 14 3 1", ". c None", "# c #000000", @@ -178,25 +182,25 @@ void MainWindow::makeMenu() LabelEnterText = new QLabel( searchBar, "Label" ); LabelEnterText->setAutoMask( FALSE ); LabelEnterText->setText( tr( "Search for: " ) ); - + addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); QWhatsThis::add( searchEdit, tr("Enter your search terms here") ); searchEdit->setFocus(); searchBar->setHorizontalStretchable( TRUE ); searchBar->setStretchableWidget( searchEdit ); - + //Search button SearchAllAction->addTo( searchBar ); - + //image ripped of off opie-login/loginwindow.cpp QPixmap image1( ( const char** ) image1_data ); - + //Clear text ClearSearchText = new QToolButton( searchBar, "ClearSearchText"); ClearSearchText->setText( tr( "" ) ); ClearSearchText->setPixmap( image1 ); - + connect( searchEdit, SIGNAL( textChanged( const QString & ) ),this, SLOT( setSearch( const QString & ) ) ); connect( ClearSearchText, SIGNAL( clicked() ), searchEdit, SLOT( clear() ) ); diff --git a/core/pim/osearch/mainwindow.h b/core/pim/osearch/mainwindow.h index 9886053..bf3081f 100644 --- a/core/pim/osearch/mainwindow.h +++ b/core/pim/osearch/mainwindow.h @@ -16,7 +16,6 @@ #include #include #include - #include #include #include diff --git a/core/pim/osearch/olistview.cpp b/core/pim/osearch/olistview.cpp index e678d63..7a7cb26 100644 --- a/core/pim/osearch/olistview.cpp +++ b/core/pim/osearch/olistview.cpp @@ -10,17 +10,20 @@ #include "olistview.h" #include "olistviewitem.h" -#include + #include +#include + + OListView::OListView(QWidget *parent, const char *name ) : QListView(parent,name) { - setRootIsDecorated( true ); + setRootIsDecorated( true ); addColumn(tr("Results"),qApp->desktop()->width() - 9 ); //setColumnWidthMode(0, Manual); - + setSorting( -1 ); connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*))); } diff --git a/core/pim/osearch/osearch.pro b/core/pim/osearch/osearch.pro index c988f48..7412de9 100644 --- a/core/pim/osearch/osearch.pro +++ b/core/pim/osearch/osearch.pro @@ -35,5 +35,5 @@ TARGET = osearch INCLUDEPATH = $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopie +LIBS += -lqpe -lopiecore2 -lopiepim2 -lopieui2 include ( $(OPIEDIR)/include.pro ) diff --git a/core/pim/osearch/resultitem.cpp b/core/pim/osearch/resultitem.cpp index 2c1e95a..f051b12 100644 --- a/core/pim/osearch/resultitem.cpp +++ b/core/pim/osearch/resultitem.cpp @@ -12,10 +12,8 @@ // #include "resultitem.h" -#include - -#include +#include ResultItem::ResultItem(OListViewItem* parent) : OListViewItem(parent) diff --git a/core/pim/osearch/resultitem.h b/core/pim/osearch/resultitem.h index 9e87f99..1c14e8f 100644 --- a/core/pim/osearch/resultitem.h +++ b/core/pim/osearch/resultitem.h @@ -13,10 +13,10 @@ #ifndef RESULTITEM_H #define RESULTITEM_H -#include - #include "olistviewitem.h" +#include + /** @author Patrick S. Vogt */ diff --git a/core/pim/osearch/searchgroup.cpp b/core/pim/osearch/searchgroup.cpp index 0b58176..5377b9f 100644 --- a/core/pim/osearch/searchgroup.cpp +++ b/core/pim/osearch/searchgroup.cpp @@ -10,14 +10,14 @@ // Copyright: See COPYING file that comes with this distribution // // +#include "olistviewitem.h" +#include "searchgroup.h" + +#include #include #include #include -#include - -#include "olistviewitem.h" -#include "searchgroup.h" #ifndef NEW_OWAIT static OWait *wait = 0; diff --git a/core/pim/osearch/todoitem.cpp b/core/pim/osearch/todoitem.cpp index 9808a04..c20f1fd 100644 --- a/core/pim/osearch/todoitem.cpp +++ b/core/pim/osearch/todoitem.cpp @@ -12,12 +12,14 @@ // #include "todoitem.h" -#include -#include + #include #include -TodoItem::TodoItem(OListViewItem* parent, OTodo *todo) +#include + + +TodoItem::TodoItem(OListViewItem* parent, OPimTodo *todo) : ResultItem(parent) { _todo = todo; @@ -61,16 +63,16 @@ void TodoItem::setIcon() case -1: icon = Resource::loadPixmap( "reset" ); break; - case OTodo::Description: + case OPimTodo::Description: icon = Resource::loadPixmap( "txt" ); break; - case OTodo::Summary: + case OPimTodo::Summary: icon = Resource::loadPixmap( "osearch/summary" ); break; - case OTodo::Priority: + case OPimTodo::Priority: icon = Resource::loadPixmap( "todo/priority1" ); break; - case OTodo::HasDate: + case OPimTodo::HasDate: icon = Resource::loadPixmap( "osearch/clock" ); break; default: diff --git a/core/pim/osearch/todoitem.h b/core/pim/osearch/todoitem.h index cc78e57..7c8537b 100644 --- a/core/pim/osearch/todoitem.h +++ b/core/pim/osearch/todoitem.h @@ -13,8 +13,11 @@ #ifndef TODOITEM_H #define TODOITEM_H + +#include #include "resultitem.h" -class OTodo; + +using namespace Opie; /** @author Patrick S. Vogt @@ -22,7 +25,7 @@ class OTodo; class TodoItem : public ResultItem { public: - TodoItem(OListViewItem* parent, OTodo *todo); + TodoItem(OListViewItem* parent, OPimTodo *todo); ~TodoItem(); virtual QString toRichText(); @@ -31,7 +34,7 @@ public: private: void setIcon(); - OTodo *_todo; + OPimTodo *_todo; }; diff --git a/core/pim/osearch/todosearch.cpp b/core/pim/osearch/todosearch.cpp index 8de875e..5042803 100644 --- a/core/pim/osearch/todosearch.cpp +++ b/core/pim/osearch/todosearch.cpp @@ -11,15 +11,15 @@ // // #include "todosearch.h" +#include "todoitem.h" -#include -#include #include #include + #include #include #include -#include "todoitem.h" + TodoSearch::TodoSearch(QListView* parent, QString name) : SearchGroup(parent, name), _todos(0), _popupMenu(0) @@ -49,21 +49,21 @@ TodoSearch::~TodoSearch() void TodoSearch::load() { - _todos = new OTodoAccess(); + _todos = new OPimTodoAccess(); _todos->load(); } int TodoSearch::search() { - ORecordList results = _todos->matchRegexp(_search); + OPimRecordList results = _todos->matchRegexp(_search); for (uint i = 0; i < results.count(); i++) - insertItem( new OTodo( results[i] )); + insertItem( new OPimTodo( results[i] )); return _resultCount; } void TodoSearch::insertItem( void *rec ) { - OTodo *todo = (OTodo*)rec; + OPimTodo *todo = (OPimTodo*)rec; if (!actionShowCompleted->isOn() && todo->isCompleted() ) return; (void)new TodoItem( this, todo ); diff --git a/core/pim/osearch/todosearch.h b/core/pim/osearch/todosearch.h index ee175da..740e483 100644 --- a/core/pim/osearch/todosearch.h +++ b/core/pim/osearch/todosearch.h @@ -15,9 +15,13 @@ #include "searchgroup.h" -class OTodoAccess; +#include +#include + class QAction; +using namespace Opie; + /** @author Patrick S. Vogt */ @@ -35,7 +39,7 @@ protected: virtual void insertItem( void* ); private: - OTodoAccess *_todos; + OPimTodoAccess *_todos; QAction *actionShowCompleted; QPopupMenu *_popupMenu; }; -- cgit v0.9.0.2