summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/applnkitem.cpp2
-rw-r--r--core/pim/osearch/datebooksearch.cpp2
-rw-r--r--core/pim/osearch/doclnkitem.cpp4
-rw-r--r--core/pim/osearch/mainwindow.cpp2
4 files changed, 5 insertions, 5 deletions
diff --git a/core/pim/osearch/applnkitem.cpp b/core/pim/osearch/applnkitem.cpp
index ca54eef..f9ff565 100644
--- a/core/pim/osearch/applnkitem.cpp
+++ b/core/pim/osearch/applnkitem.cpp
@@ -23,39 +23,39 @@ AppLnkItem::AppLnkItem(OListViewItem* parent, AppLnk *app)
23 _app = app; 23 _app = app;
24 setText(0, _app->name() ); 24 setText(0, _app->name() );
25 setPixmap(0, _app->pixmap() ); 25 setPixmap(0, _app->pixmap() );
26} 26}
27 27
28 28
29AppLnkItem::~AppLnkItem() 29AppLnkItem::~AppLnkItem()
30{ 30{
31} 31}
32 32
33 33
34QString AppLnkItem::toRichText() 34QString AppLnkItem::toRichText()
35{ 35{
36 QString text; 36 QString text;
37 text += "<b><h3>" + _app->name() + "</b></h3><br>"; 37 text += "<b><h3>" + _app->name() + "</b></h3><br>";
38 text += _app->comment() + "<br>"; 38 text += _app->comment() + "<br>";
39 text += "<br>`" + _app->exec() + "`<br>"; 39 text += "<br>`" + _app->exec() + "`<br>";
40 text += "<br>`" + _app->file() + "`<br>"; 40 text += "<br>`" + _app->file() + "`<br>";
41 text += "<br>`" + _app->linkFile() + "`<br>"; 41 text += "<br>`" + _app->linkFile() + "`<br>";
42 return text; 42 return text;
43} 43}
44 44
45void AppLnkItem::action( int act ) 45void AppLnkItem::action( int act )
46{ 46{
47 if (!_app->isValid()) Opie::Core::odebug << "INVALID" << oendl; 47 if (!_app->isValid()) odebug << "INVALID" << oendl;
48 if (act == 0) _app->execute(); 48 if (act == 0) _app->execute();
49 else if (act == 1){ 49 else if (act == 1){
50 QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)"); 50 QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)");
51 e << _app->linkFile(); 51 e << _app->linkFile();
52 } 52 }
53} 53}
54 54
55QIntDict<QString> AppLnkItem::actions() 55QIntDict<QString> AppLnkItem::actions()
56{ 56{
57 QIntDict<QString> result; 57 QIntDict<QString> result;
58 result.insert( 0, new QString( QObject::tr("execute") ) ); 58 result.insert( 0, new QString( QObject::tr("execute") ) );
59 result.insert( 1, new QString( QObject::tr("open in filemanager") ) ); 59 result.insert( 1, new QString( QObject::tr("open in filemanager") ) );
60 return result; 60 return result;
61} 61}
diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp
index af6b194..34cf0ce 100644
--- a/core/pim/osearch/datebooksearch.cpp
+++ b/core/pim/osearch/datebooksearch.cpp
@@ -19,49 +19,49 @@
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 Opie::Core::odebug << "SAVE DATEBOOK SEARCH CONFIG" << oendl; 43 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()
56{ 56{
57 _dates = new ODateBookAccess(); 57 _dates = new ODateBookAccess();
58 _dates->load(); 58 _dates->load();
59} 59}
60 60
61int DatebookSearch::search() 61int DatebookSearch::search()
62{ 62{
63 OPimRecordList<OPimEvent> results = _dates->matchRegexp(_search); 63 OPimRecordList<OPimEvent> results = _dates->matchRegexp(_search);
64 for (uint i = 0; i < results.count(); i++) 64 for (uint i = 0; i < results.count(); i++)
65 insertItem( new OPimEvent( results[i] ) ); 65 insertItem( new OPimEvent( results[i] ) );
66 return _resultCount; 66 return _resultCount;
67} 67}
diff --git a/core/pim/osearch/doclnkitem.cpp b/core/pim/osearch/doclnkitem.cpp
index d908f7c..2e09a63 100644
--- a/core/pim/osearch/doclnkitem.cpp
+++ b/core/pim/osearch/doclnkitem.cpp
@@ -42,40 +42,40 @@ QString DocLnkItem::toRichText()
42 text += QObject::tr("Mimetype: ") + _doc->type() + "<br>"; 42 text += QObject::tr("Mimetype: ") + _doc->type() + "<br>";
43 if ( _doc->type().contains( "text" ) ){ 43 if ( _doc->type().contains( "text" ) ){
44 text += "<br><br><hr><br>"; 44 text += "<br><br><hr><br>";
45 QFile f(_doc->file()); 45 QFile f(_doc->file());
46 if ( f.open(IO_ReadOnly) ) { 46 if ( f.open(IO_ReadOnly) ) {
47 QTextStream t( &f ); 47 QTextStream t( &f );
48 while ( !t.eof() ) 48 while ( !t.eof() )
49 text += t.readLine() + "<br>"; 49 text += t.readLine() + "<br>";
50 } 50 }
51 f.close(); 51 f.close();
52 } 52 }
53 /* text += "<br><br>`"; 53 /* text += "<br><br>`";
54 text += _doc->exec(); 54 text += _doc->exec();
55 text += "`";*/ 55 text += "`";*/
56 QStringList list = _doc->mimeTypes(); 56 QStringList list = _doc->mimeTypes();
57 int i = 0; 57 int i = 0;
58 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { 58 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
59 text += QString::number( i++) + " - " + *it ; 59 text += QString::number( i++) + " - " + *it ;
60 } 60 }
61 return text; 61 return text;
62} 62}
63 63
64void DocLnkItem::action( int act ) 64void DocLnkItem::action( int act )
65{ 65{
66 Opie::Core::odebug << "action" << act << oendl; 66 odebug << "action" << act << oendl;
67 if (!_doc->isValid()) Opie::Core::odebug << "INVALID" << oendl; 67 if (!_doc->isValid()) odebug << "INVALID" << oendl;
68 if (act == 0) _doc->execute(); 68 if (act == 0) _doc->execute();
69 else if (act == 1){ 69 else if (act == 1){
70 QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)"); 70 QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)");
71 e << _doc->file(); 71 e << _doc->file();
72 } 72 }
73} 73}
74 74
75QIntDict<QString> DocLnkItem::actions() 75QIntDict<QString> DocLnkItem::actions()
76{ 76{
77 QIntDict<QString> result; 77 QIntDict<QString> result;
78 result.insert( 0, new QString( QObject::tr("open with ") + _doc->exec() ) ); 78 result.insert( 0, new QString( QObject::tr("open with ") + _doc->exec() ) );
79 result.insert( 1, new QString( QObject::tr("open in filemanager") ) ); 79 result.insert( 1, new QString( QObject::tr("open in filemanager") ) );
80 return result; 80 return result;
81} 81}
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp
index f329e83..3edc8de 100644
--- a/core/pim/osearch/mainwindow.cpp
+++ b/core/pim/osearch/mainwindow.cpp
@@ -209,49 +209,49 @@ void MainWindow::makeMenu()
209 209
210MainWindow::~MainWindow() 210MainWindow::~MainWindow()
211{ 211{
212 Config cfg( "osearch", Config::User ); 212 Config cfg( "osearch", Config::User );
213 cfg.setGroup( "search_settings" ); 213 cfg.setGroup( "search_settings" );
214 cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() ); 214 cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() );
215 cfg.writeEntry( "wildcards", actionWildcards->isOn() ); 215 cfg.writeEntry( "wildcards", actionWildcards->isOn() );
216 //cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() ); 216 //cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() );
217} 217}
218 218
219void MainWindow::setCurrent(QListViewItem *item) 219void MainWindow::setCurrent(QListViewItem *item)
220{ 220{
221 if (!item) return; 221 if (!item) return;
222 _currentItem = (OListViewItem*)item; 222 _currentItem = (OListViewItem*)item;
223 //_currentItem = dynamic_cast<OListViewItem*>(item); 223 //_currentItem = dynamic_cast<OListViewItem*>(item);
224 if (_currentItem->rtti() == OListViewItem::Result){ 224 if (_currentItem->rtti() == OListViewItem::Result){
225 ResultItem *res = (ResultItem*)item; 225 ResultItem *res = (ResultItem*)item;
226 // ResultItem *res = dynamic_cast<ResultItem*>(item); 226 // ResultItem *res = dynamic_cast<ResultItem*>(item);
227 richEdit->setText( res->toRichText() ); 227 richEdit->setText( res->toRichText() );
228 QIntDict<QString> acts = res->actions(); 228 QIntDict<QString> acts = res->actions();
229 QButton *button; 229 QButton *button;
230 for (uint i = 0; i < acts.count(); i++){ 230 for (uint i = 0; i < acts.count(); i++){
231 button = buttonMap[i]; 231 button = buttonMap[i];
232 if (!button) { 232 if (!button) {
233 Opie::Core::owarn << " no button for " << *acts[i] << oendl; 233 owarn << " no button for " << *acts[i] << oendl;
234 button = new QPushButton( buttonBox ); 234 button = new QPushButton( buttonBox );
235 buttonMap.insert( i, button ); 235 buttonMap.insert( i, button );
236 signalMapper->setMapping(button, i ); 236 signalMapper->setMapping(button, i );
237 connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) ); 237 connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) );
238 } 238 }
239 button->setText( *acts[i] ); 239 button->setText( *acts[i] );
240 button->show(); 240 button->show();
241 } 241 }
242 for (uint i = acts.count(); i < _buttonCount; i++){ 242 for (uint i = acts.count(); i < _buttonCount; i++){
243 button = buttonMap[i]; 243 button = buttonMap[i];
244 if (button) button->hide(); 244 if (button) button->hide();
245 } 245 }
246 _buttonCount = acts.count(); 246 _buttonCount = acts.count();
247 detailsFrame->show(); 247 detailsFrame->show();
248 buttonBox->show(); 248 buttonBox->show();
249 249
250 }else { 250 }else {
251 detailsFrame->hide(); 251 detailsFrame->hide();
252 buttonBox->hide(); 252 buttonBox->hide();
253 } 253 }
254 popupTimer->start( 300, true ); 254 popupTimer->start( 300, true );
255} 255}
256 256
257void MainWindow::stopTimer(QListViewItem*) 257void MainWindow::stopTimer(QListViewItem*)