summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/applnkitem.cpp5
-rw-r--r--core/pim/osearch/config.in2
-rw-r--r--core/pim/osearch/datebooksearch.cpp4
-rw-r--r--core/pim/osearch/doclnkitem.cpp6
-rw-r--r--core/pim/osearch/mainwindow.cpp5
-rw-r--r--core/pim/osearch/opie-osearch.control2
-rw-r--r--core/pim/osearch/searchgroup.cpp3
7 files changed, 16 insertions, 11 deletions
diff --git a/core/pim/osearch/applnkitem.cpp b/core/pim/osearch/applnkitem.cpp
index 19e765e..ca54eef 100644
--- a/core/pim/osearch/applnkitem.cpp
+++ b/core/pim/osearch/applnkitem.cpp
@@ -3,28 +3,29 @@
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "applnkitem.h" 13#include "applnkitem.h"
14 14
15#include <opie2/odebug.h>
16
15#include <qpe/applnk.h> 17#include <qpe/applnk.h>
16#include <qpe/qcopenvelope_qws.h> 18#include <qpe/qcopenvelope_qws.h>
17 19
18
19AppLnkItem::AppLnkItem(OListViewItem* parent, AppLnk *app) 20AppLnkItem::AppLnkItem(OListViewItem* parent, AppLnk *app)
20 : ResultItem(parent) 21 : ResultItem(parent)
21{ 22{
22 _app = app; 23 _app = app;
23 setText(0, _app->name() ); 24 setText(0, _app->name() );
24 setPixmap(0, _app->pixmap() ); 25 setPixmap(0, _app->pixmap() );
25} 26}
26 27
27 28
28AppLnkItem::~AppLnkItem() 29AppLnkItem::~AppLnkItem()
29{ 30{
30} 31}
@@ -34,25 +35,25 @@ QString AppLnkItem::toRichText()
34{ 35{
35 QString text; 36 QString text;
36 text += "<b><h3>" + _app->name() + "</b></h3><br>"; 37 text += "<b><h3>" + _app->name() + "</b></h3><br>";
37 text += _app->comment() + "<br>"; 38 text += _app->comment() + "<br>";
38 text += "<br>`" + _app->exec() + "`<br>"; 39 text += "<br>`" + _app->exec() + "`<br>";
39 text += "<br>`" + _app->file() + "`<br>"; 40 text += "<br>`" + _app->file() + "`<br>";
40 text += "<br>`" + _app->linkFile() + "`<br>"; 41 text += "<br>`" + _app->linkFile() + "`<br>";
41 return text; 42 return text;
42} 43}
43 44
44void AppLnkItem::action( int act ) 45void AppLnkItem::action( int act )
45{ 46{
46 if (!_app->isValid()) qDebug("INVALID"); 47 if (!_app->isValid()) Opie::Core::odebug << "INVALID" << oendl;
47 if (act == 0) _app->execute(); 48 if (act == 0) _app->execute();
48 else if (act == 1){ 49 else if (act == 1){
49 QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)"); 50 QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)");
50 e << _app->linkFile(); 51 e << _app->linkFile();
51 } 52 }
52} 53}
53 54
54QIntDict<QString> AppLnkItem::actions() 55QIntDict<QString> AppLnkItem::actions()
55{ 56{
56 QIntDict<QString> result; 57 QIntDict<QString> result;
57 result.insert( 0, new QString( QObject::tr("execute") ) ); 58 result.insert( 0, new QString( QObject::tr("execute") ) );
58 result.insert( 1, new QString( QObject::tr("open in filemanager") ) ); 59 result.insert( 1, new QString( QObject::tr("open in filemanager") ) );
diff --git a/core/pim/osearch/config.in b/core/pim/osearch/config.in
index ec0da27..71191ce 100644
--- a/core/pim/osearch/config.in
+++ b/core/pim/osearch/config.in
@@ -1,4 +1,4 @@
1 config OSEARCH 1 config OSEARCH
2 boolean "opie-osearch (searches throught your PDA)" 2 boolean "opie-osearch (searches throught your PDA)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && LIBOPIE2PIM 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && LIBOPIE2PIM
diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp
index eeea54b..af6b194 100644
--- a/core/pim/osearch/datebooksearch.cpp
+++ b/core/pim/osearch/datebooksearch.cpp
@@ -4,52 +4,52 @@
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "datebooksearch.h" 13#include "datebooksearch.h"
14#include "eventitem.h" 14#include "eventitem.h"
15 15
16#include <opie2/odebug.h>
16#include <opie2/opimevent.h> 17#include <opie2/opimevent.h>
17#include <opie2/opimrecurrence.h> 18#include <opie2/opimrecurrence.h>
18 19
19
20#include <qpe/resource.h> 20#include <qpe/resource.h>
21#include <qpe/config.h> 21#include <qpe/config.h>
22 22
23#include <qaction.h> 23#include <qaction.h>
24#include <qpopupmenu.h> 24#include <qpopupmenu.h>
25 25
26 26
27 27
28DatebookSearch::DatebookSearch(QListView* parent, QString name) 28DatebookSearch::DatebookSearch(QListView* parent, QString name)
29: SearchGroup(parent, name), _dates(0), _popupMenu(0) 29: SearchGroup(parent, name), _dates(0), _popupMenu(0)
30{ 30{
31 QIconSet is = Resource::loadIconSet( "datebook/DateBookSmall" ); 31 QIconSet is = Resource::loadIconSet( "datebook/DateBookSmall" );
32 setPixmap( 0, is.pixmap( QIconSet::Large, true ) ); 32 setPixmap( 0, is.pixmap( QIconSet::Large, true ) );
33 actionShowPastEvents = new QAction( QObject::tr("show past events"),QString::null, 0, 0, 0, true ); 33 actionShowPastEvents = new QAction( QObject::tr("show past events"),QString::null, 0, 0, 0, true );
34 actionSearchInDates = new QAction( QObject::tr("search in dates"),QString::null, 0, 0, 0, true ); 34 actionSearchInDates = new QAction( QObject::tr("search in dates"),QString::null, 0, 0, 0, true );
35 Config cfg( "osearch", Config::User ); 35 Config cfg( "osearch", Config::User );
36 cfg.setGroup( "datebook_settings" ); 36 cfg.setGroup( "datebook_settings" );
37 actionShowPastEvents->setOn( cfg.readBoolEntry( "show_past_events", false ) ); 37 actionShowPastEvents->setOn( cfg.readBoolEntry( "show_past_events", false ) );
38 actionSearchInDates->setOn( cfg.readBoolEntry( "search_in_dates", true ) ); 38 actionSearchInDates->setOn( cfg.readBoolEntry( "search_in_dates", true ) );
39} 39}
40 40
41DatebookSearch::~DatebookSearch() 41DatebookSearch::~DatebookSearch()
42{ 42{
43 qDebug("SAVE DATEBOOK SEARCH CONFIG"); 43 Opie::Core::odebug << "SAVE DATEBOOK SEARCH CONFIG" << oendl;
44 Config cfg( "osearch", Config::User ); 44 Config cfg( "osearch", Config::User );
45 cfg.setGroup( "datebook_settings" ); 45 cfg.setGroup( "datebook_settings" );
46 cfg.writeEntry( "show_past_events", actionShowPastEvents->isOn() ); 46 cfg.writeEntry( "show_past_events", actionShowPastEvents->isOn() );
47 cfg.writeEntry( "search_in_dates", actionSearchInDates->isOn() ); 47 cfg.writeEntry( "search_in_dates", actionSearchInDates->isOn() );
48 delete _dates; 48 delete _dates;
49 delete _popupMenu; 49 delete _popupMenu;
50 delete actionShowPastEvents; 50 delete actionShowPastEvents;
51 delete actionSearchInDates; 51 delete actionSearchInDates;
52} 52}
53 53
54 54
55void DatebookSearch::load() 55void DatebookSearch::load()
diff --git a/core/pim/osearch/doclnkitem.cpp b/core/pim/osearch/doclnkitem.cpp
index df8e856..d908f7c 100644
--- a/core/pim/osearch/doclnkitem.cpp
+++ b/core/pim/osearch/doclnkitem.cpp
@@ -3,24 +3,26 @@
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "doclnkitem.h" 13#include "doclnkitem.h"
14 14
15#include <opie2/odebug.h>
16
15#include <qpe/applnk.h> 17#include <qpe/applnk.h>
16#include <qpe/qcopenvelope_qws.h> 18#include <qpe/qcopenvelope_qws.h>
17 19
18#include <qtextstream.h> 20#include <qtextstream.h>
19#include <qfileinfo.h> 21#include <qfileinfo.h>
20 22
21DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app) 23DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app)
22 : ResultItem(parent) 24 : ResultItem(parent)
23{ 25{
24 _doc = app; 26 _doc = app;
25 setText(0, _doc->name() ); 27 setText(0, _doc->name() );
26 setPixmap(0, _doc->pixmap() ); 28 setPixmap(0, _doc->pixmap() );
@@ -52,26 +54,26 @@ QString DocLnkItem::toRichText()
52 text += _doc->exec(); 54 text += _doc->exec();
53 text += "`";*/ 55 text += "`";*/
54 QStringList list = _doc->mimeTypes(); 56 QStringList list = _doc->mimeTypes();
55 int i = 0; 57 int i = 0;
56 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { 58 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
57 text += QString::number( i++) + " - " + *it ; 59 text += QString::number( i++) + " - " + *it ;
58 } 60 }
59 return text; 61 return text;
60} 62}
61 63
62void DocLnkItem::action( int act ) 64void DocLnkItem::action( int act )
63{ 65{
64 qDebug("action %i",act); 66 Opie::Core::odebug << "action" << act << oendl;
65 if (!_doc->isValid()) qDebug("INVALID"); 67 if (!_doc->isValid()) Opie::Core::odebug << "INVALID" << oendl;
66 if (act == 0) _doc->execute(); 68 if (act == 0) _doc->execute();
67 else if (act == 1){ 69 else if (act == 1){
68 QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)"); 70 QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)");
69 e << _doc->file(); 71 e << _doc->file();
70 } 72 }
71} 73}
72 74
73QIntDict<QString> DocLnkItem::actions() 75QIntDict<QString> DocLnkItem::actions()
74{ 76{
75 QIntDict<QString> result; 77 QIntDict<QString> result;
76 result.insert( 0, new QString( QObject::tr("open with ") + _doc->exec() ) ); 78 result.insert( 0, new QString( QObject::tr("open with ") + _doc->exec() ) );
77 result.insert( 1, new QString( QObject::tr("open in filemanager") ) ); 79 result.insert( 1, new QString( QObject::tr("open in filemanager") ) );
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp
index 8b6a5df..f329e83 100644
--- a/core/pim/osearch/mainwindow.cpp
+++ b/core/pim/osearch/mainwindow.cpp
@@ -11,24 +11,25 @@
11 11
12 12
13#include "olistview.h" 13#include "olistview.h"
14#include "olistviewitem.h" 14#include "olistviewitem.h"
15#include "resultitem.h" 15#include "resultitem.h"
16#include "adresssearch.h" 16#include "adresssearch.h"
17#include "todosearch.h" 17#include "todosearch.h"
18#include "datebooksearch.h" 18#include "datebooksearch.h"
19#include "applnksearch.h" 19#include "applnksearch.h"
20#include "doclnksearch.h" 20#include "doclnksearch.h"
21#include "mainwindow.h" 21#include "mainwindow.h"
22 22
23#include <opie2/odebug.h>
23#include <opie2/owait.h> 24#include <opie2/owait.h>
24 25
25#include <qpe/qpemessagebox.h> 26#include <qpe/qpemessagebox.h>
26#include <qpe/resource.h> 27#include <qpe/resource.h>
27#include <qpe/config.h> 28#include <qpe/config.h>
28 29
29 30
30#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
31#include <qpe/global.h> 32#include <qpe/global.h>
32 33
33#include <qtoolbar.h> 34#include <qtoolbar.h>
34#include <qaction.h> 35#include <qaction.h>
@@ -220,25 +221,25 @@ void MainWindow::setCurrent(QListViewItem *item)
220 if (!item) return; 221 if (!item) return;
221 _currentItem = (OListViewItem*)item; 222 _currentItem = (OListViewItem*)item;
222 //_currentItem = dynamic_cast<OListViewItem*>(item); 223 //_currentItem = dynamic_cast<OListViewItem*>(item);
223 if (_currentItem->rtti() == OListViewItem::Result){ 224 if (_currentItem->rtti() == OListViewItem::Result){
224 ResultItem *res = (ResultItem*)item; 225 ResultItem *res = (ResultItem*)item;
225 // ResultItem *res = dynamic_cast<ResultItem*>(item); 226 // ResultItem *res = dynamic_cast<ResultItem*>(item);
226 richEdit->setText( res->toRichText() ); 227 richEdit->setText( res->toRichText() );
227 QIntDict<QString> acts = res->actions(); 228 QIntDict<QString> acts = res->actions();
228 QButton *button; 229 QButton *button;
229 for (uint i = 0; i < acts.count(); i++){ 230 for (uint i = 0; i < acts.count(); i++){
230 button = buttonMap[i]; 231 button = buttonMap[i];
231 if (!button) { 232 if (!button) {
232 qWarning(" no button for %s", (*acts[i]).latin1() ); 233 Opie::Core::owarn << " no button for " << *acts[i] << oendl;
233 button = new QPushButton( buttonBox ); 234 button = new QPushButton( buttonBox );
234 buttonMap.insert( i, button ); 235 buttonMap.insert( i, button );
235 signalMapper->setMapping(button, i ); 236 signalMapper->setMapping(button, i );
236 connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) ); 237 connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) );
237 } 238 }
238 button->setText( *acts[i] ); 239 button->setText( *acts[i] );
239 button->show(); 240 button->show();
240 } 241 }
241 for (uint i = acts.count(); i < _buttonCount; i++){ 242 for (uint i = acts.count(); i < _buttonCount; i++){
242 button = buttonMap[i]; 243 button = buttonMap[i];
243 if (button) button->hide(); 244 if (button) button->hide();
244 } 245 }
@@ -274,25 +275,25 @@ void MainWindow::setSearch( const QString &key )
274} 275}
275 276
276void MainWindow::searchStringChanged() 277void MainWindow::searchStringChanged()
277{ 278{
278#ifdef NEW_OWAIT 279#ifdef NEW_OWAIT
279 OWait("setting search string"); 280 OWait("setting search string");
280#endif 281#endif
281 searchTimer->stop(); 282 searchTimer->stop();
282 QString ss = _searchString; 283 QString ss = _searchString;
283 //ss = Global::stringQuote( _searchString ); 284 //ss = Global::stringQuote( _searchString );
284 //if (actionWholeWordsOnly->isOn()) 285 //if (actionWholeWordsOnly->isOn())
285 // ss = "\\s"+_searchString+"\\s"; 286 // ss = "\\s"+_searchString+"\\s";
286 //qDebug(" set searchString >%s<",ss.latin1()); 287 //Opie:Core::odebug << " set searchString >" << ss << "<" << oendl;
287 QRegExp re( ss ); 288 QRegExp re( ss );
288 re.setCaseSensitive( actionCaseSensitiv->isOn() ); 289 re.setCaseSensitive( actionCaseSensitiv->isOn() );
289 re.setWildcard( actionWildcards->isOn() ); 290 re.setWildcard( actionWildcards->isOn() );
290 for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ) 291 for (SearchGroup *s = searches.first(); s != 0; s = searches.next() )
291 s->setSearch( re ); 292 s->setSearch( re );
292} 293}
293 294
294void MainWindow::searchAll() 295void MainWindow::searchAll()
295{ 296{
296#ifdef NEW_OWAIT 297#ifdef NEW_OWAIT
297 OWait("searching..."); 298 OWait("searching...");
298#endif 299#endif
diff --git a/core/pim/osearch/opie-osearch.control b/core/pim/osearch/opie-osearch.control
index 9bf0607..73838b9 100644
--- a/core/pim/osearch/opie-osearch.control
+++ b/core/pim/osearch/opie-osearch.control
@@ -1,9 +1,9 @@
1Package: opie-osearch 1Package: opie-osearch
2Files: plugins/application/libosearch.so* bin/osearch apps/1Pim/osearch.desktop pics/osearch/*.png 2Files: plugins/application/libosearch.so* bin/osearch apps/1Pim/osearch.desktop pics/osearch/*.png
3Priority: optional 3Priority: optional
4Section: opie/pim 4Section: opie/pim
5Maintainer: Patrick S. Vogt <tille@handhelds.org> 5Maintainer: Patrick S. Vogt <tille@handhelds.org>
6Architecture: arm 6Architecture: arm
7Depends: task-opie-minimal 7Depends: task-opie-minimal, libopiecore2, libopieui2, libopiepim2
8Description: Search through all PIM data 8Description: Search through all PIM data
9Version: $QPE_VERSION$EXTRAVERSION 9Version: $QPE_VERSION$EXTRAVERSION
diff --git a/core/pim/osearch/searchgroup.cpp b/core/pim/osearch/searchgroup.cpp
index 9166f72..2ca37cf 100644
--- a/core/pim/osearch/searchgroup.cpp
+++ b/core/pim/osearch/searchgroup.cpp
@@ -3,24 +3,25 @@
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "searchgroup.h" 13#include "searchgroup.h"
14 14
15#include <opie2/odebug.h>
15#include <opie2/owait.h> 16#include <opie2/owait.h>
16 17
17#include <qapplication.h> 18#include <qapplication.h>
18 19
19#ifndef NEW_OWAIT 20#ifndef NEW_OWAIT
20static Opie::Ui::OWait *wait = 0; 21static Opie::Ui::OWait *wait = 0;
21#endif 22#endif
22 23
23SearchGroup::SearchGroup(QListView* parent, QString name) 24SearchGroup::SearchGroup(QListView* parent, QString name)
24: OListViewItem(parent, name) 25: OListViewItem(parent, name)
25{ 26{
26 _name = name; 27 _name = name;
@@ -63,25 +64,25 @@ void SearchGroup::setSearch(QRegExp re)
63 if (isOpen()) expand(); 64 if (isOpen()) expand();
64 else new OListViewItem( this, "searching..."); 65 else new OListViewItem( this, "searching...");
65} 66}
66 67
67int SearchGroup::realSearch() 68int SearchGroup::realSearch()
68{ 69{
69 if (_lastSearch == _search) return _resultCount; 70 if (_lastSearch == _search) return _resultCount;
70#ifndef NEW_OWAIT 71#ifndef NEW_OWAIT
71 if (!wait) wait = new Opie::Ui::OWait( qApp->mainWidget(), "osearch" ); 72 if (!wait) wait = new Opie::Ui::OWait( qApp->mainWidget(), "osearch" );
72 wait->show(); 73 wait->show();
73 qApp->processEvents(); 74 qApp->processEvents();
74#else 75#else
75 qDebug("********** NEW_OWAIT *************"); 76 Opie:Core::odebug << "********** NEW_OWAIT *************" << oendl;
76 OWait( "searching" ); 77 OWait( "searching" );
77#endif 78#endif
78 if (!loaded) load(); 79 if (!loaded) load();
79 _resultCount = 0; 80 _resultCount = 0;
80 _resultCount = search(); 81 _resultCount = search();
81 _lastSearch = _search; 82 _lastSearch = _search;
82 setText(0, _name + " - " + _search.pattern() + " (" + QString::number( _resultCount ) + ")"); 83 setText(0, _name + " - " + _search.pattern() + " (" + QString::number( _resultCount ) + ")");
83 84
84#ifndef NEW_OWAIT 85#ifndef NEW_OWAIT
85 wait->hide(); 86 wait->hide();
86#endif 87#endif
87 return _resultCount; 88 return _resultCount;