summaryrefslogtreecommitdiff
path: root/library
Unidiff
Diffstat (limited to 'library') (more/less context) (ignore whitespace changes)
-rw-r--r--library/applnk.cpp16
-rw-r--r--library/backend/categories.cpp9
-rw-r--r--library/backend/categories.h2
-rw-r--r--library/backend/event.cpp4
-rw-r--r--library/backend/palmtoprecord.h12
-rw-r--r--library/datebookdb.cpp12
-rw-r--r--library/finddialog.cpp7
-rw-r--r--library/global.cpp28
-rw-r--r--library/qpeapplication.cpp3
-rw-r--r--library/storage.cpp6
10 files changed, 65 insertions, 34 deletions
diff --git a/library/applnk.cpp b/library/applnk.cpp
index 35822dd..00030e8 100644
--- a/library/applnk.cpp
+++ b/library/applnk.cpp
@@ -323,25 +323,41 @@ const QArray<int>& AppLnk::categories() const
323 Returns the id of the AppLnk. If the AppLnk is not in an AppLnkSet, 323 Returns the id of the AppLnk. If the AppLnk is not in an AppLnkSet,
324 this value is 0, otherwise it is a value that is unique for the 324 this value is 0, otherwise it is a value that is unique for the
325 duration of the current process. 325 duration of the current process.
326 326
327 \sa AppLnkSet::find() 327 \sa AppLnkSet::find()
328*/ 328*/
329 329
330/*! 330/*!
331 \fn bool AppLnk::isValid() const 331 \fn bool AppLnk::isValid() const
332 332
333 Returns TRUE if this AppLnk is valid; otherwise returns FALSE. 333 Returns TRUE if this AppLnk is valid; otherwise returns FALSE.
334*/ 334*/
335/*!
336 \fn bool AppLnk::fileKnown() const
337
338 If the with the AppLnk associated file is not equal to QString::null
339*/
340/*!
341 \fn bool AppLnk::linkFileKnown()const
342
343 The filename of the AppLnk
335 344
345*/
346/*!
347 \fn void AppLnk::setRotation( const QString& )
348
349 The default rotation of the associated application. This
350 function is included inline for binary compatible issues
351*/
336/*! 352/*!
337 Creates an invalid AppLnk. 353 Creates an invalid AppLnk.
338 354
339 \sa isValid() 355 \sa isValid()
340*/ 356*/
341AppLnk::AppLnk() 357AppLnk::AppLnk()
342{ 358{
343 mId = 0; 359 mId = 0;
344 d = new AppLnkPrivate(); 360 d = new AppLnkPrivate();
345} 361}
346 362
347/*! 363/*!
diff --git a/library/backend/categories.cpp b/library/backend/categories.cpp
index 2e84089..cce9f38 100644
--- a/library/backend/categories.cpp
+++ b/library/backend/categories.cpp
@@ -478,25 +478,25 @@ QString Categories::displaySingle( const QString &app,
478 switch ( display ) { 478 switch ( display ) {
479 case ShowFirst: 479 case ShowFirst:
480 r = strs.first(); 480 r = strs.first();
481 break; 481 break;
482 case ShowMulti: 482 case ShowMulti:
483 r = strs.first() + tr(" (multi.)"); 483 r = strs.first() + tr(" (multi.)");
484 break; 484 break;
485 case ShowAll: 485 case ShowAll:
486 r = strs.join(" "); 486 r = strs.join(" ");
487 break; 487 break;
488 } 488 }
489 } 489 }
490 else r = strs.first(); 490 else r = strs.first();
491 return r; 491 return r;
492} 492}
493 493
494/*! 494/*!
495 495
496 Returns all ids associated with the application CategoryGroup \a app 496 Returns all ids associated with the application CategoryGroup \a app
497 and the passed in \a labels in that group. 497 and the passed in \a labels in that group.
498*/ 498*/
499QArray<int> Categories::ids( const QString &app, const QStringList &labels) const 499QArray<int> Categories::ids( const QString &app, const QStringList &labels) const
500{ 500{
501 QArray<int> results; 501 QArray<int> results;
502 QStringList::ConstIterator it; 502 QStringList::ConstIterator it;
@@ -839,54 +839,49 @@ void CheckedListView::setChecked( const QStringList &checked )
839 } 839 }
840 } 840 }
841 else 841 else
842 i->setOn( FALSE ); 842 i->setOn( FALSE );
843} 843}
844 844
845/*! \fn Categories &Categories::operator= ( const Categories &c ) 845/*! \fn Categories &Categories::operator= ( const Categories &c )
846 846
847 Performs deep copy. 847 Performs deep copy.
848 */ 848 */
849 849
850 850
851/*! \fn QStringList Categories::labels( const QString & app, const QArray<int> &catids ) const
852
853 Returns list of labels associated with the application and catids
854*/
855
856/*! \fn QStringList Categories::globalCategories() const 851/*! \fn QStringList Categories::globalCategories() const
857 852
858 Returns list of all global category labels 853 Returns list of all global category labels
859*/ 854*/
860 855
861/*! \fn const QMap<QString, CategoryGroup> &Categories::appGroupMap() const 856/*! \fn const QMap<QString, CategoryGroup> &Categories::appGroupMap() const
862 857
863 Returns a map of application names to CategoryGroup. The CategoryGroup 858 Returns a map of application names to CategoryGroup. The CategoryGroup
864 class defines a map of ids to category labels and category labels to ids. 859 class defines a map of ids to category labels and category labels to ids.
865*/ 860*/
866 861
867/*! \fn const CategoryGroup &Categories::globalGroup() const 862/*! \fn const CategoryGroup &Categories::globalGroup() const
868 863
869 Returns the global CategoryGroup. The CategoryGroup 864 Returns the global CategoryGroup. The CategoryGroup
870 class defines a map of ids to category labels and category labels to ids. 865 class defines a map of ids to category labels and category labels to ids.
871*/ 866*/
872 867
873/*! \fn void Categories::categoryAdded( const Categories &cats, const QString &appname, int uid) 868/*! \fn void Categories::categoryAdded( const Categories &cats, const QString &appname, int uid)
874 869
875 Emitted if a category is added. 870 Emitted if a category is added.
876 871
877 \a cats is a const reference to this object 872 \a cats is a const reference to this object
878 \a appname is the CategoryGroup application name that the category was added to or QString::null if it was global 873 \a appname is the CategoryGroup application name that the category was added to or QString::null if it was global
879 \a uid is the unique identifier associated with the added category 874 \a uid is the unique identifier associated with the added category
880 */ 875*/
881 876
882/*! \fn void Categories::categoryRemoved( const Categories &cats, const QString &appname, 877/*! \fn void Categories::categoryRemoved( const Categories &cats, const QString &appname,
883 int uid) 878 int uid)
884 879
885 Emitted if removed category is removed. 880 Emitted if removed category is removed.
886 881
887 \a cats is a const reference to this object 882 \a cats is a const reference to this object
888 \a appname is the CategoryGroup application name that the category was removed from or QString::null if it was the global CategoryGroup 883 \a appname is the CategoryGroup application name that the category was removed from or QString::null if it was the global CategoryGroup
889 \a uid is the unique identifier associated with the removed category 884 \a uid is the unique identifier associated with the removed category
890*/ 885*/
891 886
892 887
diff --git a/library/backend/categories.h b/library/backend/categories.h
index ba65ee3..d5b3669 100644
--- a/library/backend/categories.h
+++ b/library/backend/categories.h
@@ -76,25 +76,25 @@ public:
76 76
77 const QMap<int, QString> &idMap() const { return mIdLabelMap; } 77 const QMap<int, QString> &idMap() const { return mIdLabelMap; }
78 78
79private: 79private:
80 void insert( int uid, const QString &label ); 80 void insert( int uid, const QString &label );
81 QMap<int, QString> mIdLabelMap; 81 QMap<int, QString> mIdLabelMap;
82 QMap<QString, int> mLabelIdMap; 82 QMap<QString, int> mLabelIdMap;
83 83
84 static Qtopia::UidGen &uidGen() { return sUidGen; } 84 static Qtopia::UidGen &uidGen() { return sUidGen; }
85 static Qtopia::UidGen sUidGen; 85 static Qtopia::UidGen sUidGen;
86}; 86};
87 87
88/** Map from application name to categories */ 88/* Map from application name to categories */
89class QPC_EXPORT Categories : public QObject 89class QPC_EXPORT Categories : public QObject
90{ 90{
91 Q_OBJECT 91 Q_OBJECT
92public: 92public:
93 Categories( QObject *parent=0, const char *name = 0 ) 93 Categories( QObject *parent=0, const char *name = 0 )
94 : QObject( parent, name ), mGlobalCats(), mAppCats() { } 94 : QObject( parent, name ), mGlobalCats(), mAppCats() { }
95 Categories( const Categories &copyFrom ) : QObject( copyFrom.parent() ), 95 Categories( const Categories &copyFrom ) : QObject( copyFrom.parent() ),
96 mGlobalCats( copyFrom.mGlobalCats ), 96 mGlobalCats( copyFrom.mGlobalCats ),
97 mAppCats( copyFrom.mAppCats ) { } 97 mAppCats( copyFrom.mAppCats ) { }
98 virtual ~Categories() { } 98 virtual ~Categories() { }
99 99
100 Categories &operator= ( const Categories &c ) 100 Categories &operator= ( const Categories &c )
diff --git a/library/backend/event.cpp b/library/backend/event.cpp
index d906f19..4c24ab3 100644
--- a/library/backend/event.cpp
+++ b/library/backend/event.cpp
@@ -158,31 +158,31 @@ Qtopia::UidGen Event::sUidGen( Qtopia::UidGen::Qtopia );
158*/ 158*/
159 159
160/*! 160/*!
161 \fn void Event::setAllDay(bool allday) 161 \fn void Event::setAllDay(bool allday)
162 162
163 If \a allday is TRUE, will set the event to be an all day event. 163 If \a allday is TRUE, will set the event to be an all day event.
164 Otherwise sets the event to not be an all day event. 164 Otherwise sets the event to not be an all day event.
165 165
166 \warning This function may affect the start and end times of the event. 166 \warning This function may affect the start and end times of the event.
167*/ 167*/
168 168
169/*! 169/*!
170 \fn QDateTime Event::start() const 170 \fn QDateTime Event::start(bool) const
171 171
172 Returns the start date and time of the first occurance of the event. 172 Returns the start date and time of the first occurance of the event.
173*/ 173*/
174 174
175/*! 175/*!
176 \fn QDateTime Event::end() const 176 \fn QDateTime Event::end(bool) const
177 177
178 Returns the end date and time of the first occurance of the event. 178 Returns the end date and time of the first occurance of the event.
179*/ 179*/
180 180
181/*! 181/*!
182 \fn time_t Event::startTime() const 182 \fn time_t Event::startTime() const
183 \internal 183 \internal
184*/ 184*/
185 185
186/*! 186/*!
187 \fn time_t Event::endTime() const 187 \fn time_t Event::endTime() const
188 \internal 188 \internal
diff --git a/library/backend/palmtoprecord.h b/library/backend/palmtoprecord.h
index 72f7d1c..15cdd6a 100644
--- a/library/backend/palmtoprecord.h
+++ b/library/backend/palmtoprecord.h
@@ -23,27 +23,39 @@
23#include "qpcglobal.h" 23#include "qpcglobal.h"
24#include "palmtopuidgen.h" 24#include "palmtopuidgen.h"
25#include <qarray.h> 25#include <qarray.h>
26#include <qmap.h> 26#include <qmap.h>
27 27
28#if defined(QPC_TEMPLATEDLL) 28#if defined(QPC_TEMPLATEDLL)
29// MOC_SKIP_BEGIN 29// MOC_SKIP_BEGIN
30QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<QString, QString>; 30QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<QString, QString>;
31// MOC_SKIP_END 31// MOC_SKIP_END
32#endif 32#endif
33 33
34class QRegExp; 34class QRegExp;
35/**
36 * @short Qtopia namespace
37 * The namespace of Qtopia
38 */
35namespace Qtopia { 39namespace Qtopia {
36 40
37class RecordPrivate; 41class RecordPrivate;
42/**
43 * @short The base class of all Records
44 *
45 * The base class for Records in Qtopia
46 * @see Task
47 * @see Event
48 * @see Contact
49 */
38class QPC_EXPORT Record 50class QPC_EXPORT Record
39{ 51{
40public: 52public:
41 Record() : mUid(0), mCats() { } 53 Record() : mUid(0), mCats() { }
42 Record( const Record &c ) :mUid( c.mUid ), mCats ( c.mCats ), customMap(c.customMap) { } 54 Record( const Record &c ) :mUid( c.mUid ), mCats ( c.mCats ), customMap(c.customMap) { }
43 virtual ~Record() { } 55 virtual ~Record() { }
44 56
45 Record &operator=( const Record &c ); 57 Record &operator=( const Record &c );
46 58
47 virtual bool match( const QRegExp & ) const { return FALSE; } 59 virtual bool match( const QRegExp & ) const { return FALSE; }
48 60
49 void setCategories( const QArray<int> &v ) { mCats = v; mCats.sort(); } 61 void setCategories( const QArray<int> &v ) { mCats = v; mCats.sort(); }
diff --git a/library/datebookdb.cpp b/library/datebookdb.cpp
index 0fedfa8..2f33255 100644
--- a/library/datebookdb.cpp
+++ b/library/datebookdb.cpp
@@ -62,25 +62,25 @@ static QString dateBookFilename()
62 february or the 31st of some other months. However 62 february or the 31st of some other months. However
63 these are still bounded */ 63 these are still bounded */
64bool nextOccurance(const Event &e, const QDate &from, QDateTime &next) 64bool nextOccurance(const Event &e, const QDate &from, QDateTime &next)
65{ 65{
66 // easy checks, first are we too far in the future or too far in the past? 66 // easy checks, first are we too far in the future or too far in the past?
67 QDate tmpDate; 67 QDate tmpDate;
68 int freq = e.repeatPattern().frequency; 68 int freq = e.repeatPattern().frequency;
69 int diff, diff2, a; 69 int diff, diff2, a;
70 int iday, imonth, iyear; 70 int iday, imonth, iyear;
71 int dayOfWeek = 0; 71 int dayOfWeek = 0;
72 int firstOfWeek = 0; 72 int firstOfWeek = 0;
73 int weekOfMonth; 73 int weekOfMonth;
74 74
75 75
76 if (e.repeatPattern().hasEndDate && e.repeatPattern().endDate() < from) 76 if (e.repeatPattern().hasEndDate && e.repeatPattern().endDate() < from)
77 return FALSE; 77 return FALSE;
78 78
79 if (e.start() >= from) { 79 if (e.start() >= from) {
80 next = e.start(); 80 next = e.start();
81 return TRUE; 81 return TRUE;
82 } 82 }
83 83
84 switch ( e.repeatPattern().type ) { 84 switch ( e.repeatPattern().type ) {
85 case Event::Weekly: 85 case Event::Weekly:
86 /* weekly is just daily by 7 */ 86 /* weekly is just daily by 7 */
@@ -452,25 +452,25 @@ QValueList<Event> DateBookDB::getEvents( const QDateTime &start )
452 452
453QValueList<EffectiveEvent> DateBookDB::getEffectiveEvents( const QDate &from, 453QValueList<EffectiveEvent> DateBookDB::getEffectiveEvents( const QDate &from,
454 const QDate &to ) 454 const QDate &to )
455{ 455{
456 QValueList<EffectiveEvent> tmpList; 456 QValueList<EffectiveEvent> tmpList;
457 QValueListIterator<Event> it; 457 QValueListIterator<Event> it;
458 458
459 EffectiveEvent effEv; 459 EffectiveEvent effEv;
460 QDateTime dtTmp, 460 QDateTime dtTmp,
461 dtEnd; 461 dtEnd;
462 462
463 for (it = eventList.begin(); it != eventList.end(); ++it ) { 463 for (it = eventList.begin(); it != eventList.end(); ++it ) {
464 if (!(*it).isValidUid()) 464 if (!(*it).isValidUid())
465 (*it).assignUid(); // FIXME: Hack to restore cleared uids 465 (*it).assignUid(); // FIXME: Hack to restore cleared uids
466 466
467 dtTmp = (*it).start(TRUE); 467 dtTmp = (*it).start(TRUE);
468 dtEnd = (*it).end(TRUE); 468 dtEnd = (*it).end(TRUE);
469 469
470 if ( dtTmp.date() >= from && dtTmp.date() <= to ) { 470 if ( dtTmp.date() >= from && dtTmp.date() <= to ) {
471 Event tmpEv = *it; 471 Event tmpEv = *it;
472 effEv.setEvent(tmpEv); 472 effEv.setEvent(tmpEv);
473 effEv.setDate( dtTmp.date() ); 473 effEv.setDate( dtTmp.date() );
474 effEv.setStart( dtTmp.time() ); 474 effEv.setStart( dtTmp.time() );
475 if ( dtTmp.date() != dtEnd.date() ) 475 if ( dtTmp.date() != dtEnd.date() )
476 effEv.setEnd( QTime(23, 59, 0) ); 476 effEv.setEnd( QTime(23, 59, 0) );
@@ -497,25 +497,25 @@ QValueList<EffectiveEvent> DateBookDB::getEffectiveEvents( const QDate &from,
497 effEv.setEnd( dtEnd.time() ); 497 effEv.setEnd( dtEnd.time() );
498 else 498 else
499 effEv.setEnd( QTime(23, 59, 59) ); 499 effEv.setEnd( QTime(23, 59, 59) );
500 tmpList.append( effEv ); 500 tmpList.append( effEv );
501 } 501 }
502 dt = dt.addDays( 1 ); 502 dt = dt.addDays( 1 );
503 } 503 }
504 } 504 }
505 } 505 }
506 // check for repeating events... 506 // check for repeating events...
507 QDateTime repeat; 507 QDateTime repeat;
508 for ( it = repeatEvents.begin(); it != repeatEvents.end(); ++it ) { 508 for ( it = repeatEvents.begin(); it != repeatEvents.end(); ++it ) {
509 if (!(*it).isValidUid()) 509 if (!(*it).isValidUid())
510 (*it).assignUid(); // FIXME: Hack to restore cleared uids 510 (*it).assignUid(); // FIXME: Hack to restore cleared uids
511 511
512 /* create a false end date, to short circuit on hard 512 /* create a false end date, to short circuit on hard
513 MonthlyDay recurences */ 513 MonthlyDay recurences */
514 Event dummy_event = *it; 514 Event dummy_event = *it;
515 int duration = (*it).start().date().daysTo( (*it).end().date() ); 515 int duration = (*it).start().date().daysTo( (*it).end().date() );
516 QDate itDate = from.addDays(-duration); 516 QDate itDate = from.addDays(-duration);
517 517
518 Event::RepeatPattern r = dummy_event.repeatPattern(); 518 Event::RepeatPattern r = dummy_event.repeatPattern();
519 if ( !r.hasEndDate || r.endDate() > to ) { 519 if ( !r.hasEndDate || r.endDate() > to ) {
520 r.setEndDate( to ); 520 r.setEndDate( to );
521 r.hasEndDate = TRUE; 521 r.hasEndDate = TRUE;
@@ -614,25 +614,25 @@ void DateBookDB::editEvent( const Event &old, Event &editedEv )
614 // write to the journal... 614 // write to the journal...
615 if ( oldHadRepeat ) { 615 if ( oldHadRepeat ) {
616 if ( origRepeat( old, orig ) ) // should work always... 616 if ( origRepeat( old, orig ) ) // should work always...
617 oldIndex = repeatEvents.findIndex( orig ); 617 oldIndex = repeatEvents.findIndex( orig );
618 } else 618 } else
619 oldIndex = eventList.findIndex( old ); 619 oldIndex = eventList.findIndex( old );
620 saveJournalEntry( editedEv, ACTION_REPLACE, oldIndex, oldHadRepeat ); 620 saveJournalEntry( editedEv, ACTION_REPLACE, oldIndex, oldHadRepeat );
621 621
622 // Delete old event 622 // Delete old event
623 if ( old.hasAlarm() ) 623 if ( old.hasAlarm() )
624 delEventAlarm( old ); 624 delEventAlarm( old );
625 if ( oldHadRepeat ) { 625 if ( oldHadRepeat ) {
626 if ( editedEv.hasRepeat() ) { // This mean that origRepeat was run above and 626 if ( editedEv.hasRepeat() ) { // This mean that origRepeat was run above and
627 // orig is initialized 627 // orig is initialized
628 // assumption, when someone edits a repeating event, they 628 // assumption, when someone edits a repeating event, they
629 // want to change them all, maybe not perfect, but it works 629 // want to change them all, maybe not perfect, but it works
630 // for the moment... 630 // for the moment...
631 repeatEvents.remove( orig ); 631 repeatEvents.remove( orig );
632 } else 632 } else
633 removeRepeat( old ); 633 removeRepeat( old );
634 } else { 634 } else {
635 QValueList<Event>::Iterator it = eventList.find( old ); 635 QValueList<Event>::Iterator it = eventList.find( old );
636 if ( it != eventList.end() ) 636 if ( it != eventList.end() )
637 eventList.remove( it ); 637 eventList.remove( it );
638 } 638 }
@@ -663,25 +663,25 @@ void DateBookDB::removeJFEvent( const Event&ev )
663 if ( ev.hasRepeat() ) { 663 if ( ev.hasRepeat() ) {
664 removeRepeat( ev ); 664 removeRepeat( ev );
665 } else { 665 } else {
666 QValueList<Event>::Iterator it = eventList.find( ev ); 666 QValueList<Event>::Iterator it = eventList.find( ev );
667 if ( it != eventList.end() ) 667 if ( it != eventList.end() )
668 eventList.remove( it ); 668 eventList.remove( it );
669 } 669 }
670} 670}
671 671
672// also handles journaling... 672// also handles journaling...
673void DateBookDB::loadFile( const QString &strFile ) 673void DateBookDB::loadFile( const QString &strFile )
674{ 674{
675 675
676 QFile f( strFile ); 676 QFile f( strFile );
677 if ( !f.open( IO_ReadOnly ) ) 677 if ( !f.open( IO_ReadOnly ) )
678 return; 678 return;
679 679
680 enum Attribute { 680 enum Attribute {
681 FDescription = 0, 681 FDescription = 0,
682 FLocation, 682 FLocation,
683 FCategories, 683 FCategories,
684 FUid, 684 FUid,
685 FType, 685 FType,
686 FAlarm, 686 FAlarm,
687 FSound, 687 FSound,
@@ -714,25 +714,25 @@ void DateBookDB::loadFile( const QString &strFile )
714 dict.insert( "rposition", new int(FRPosition) ); 714 dict.insert( "rposition", new int(FRPosition) );
715 dict.insert( "rfreq", new int(FRFreq) ); 715 dict.insert( "rfreq", new int(FRFreq) );
716 dict.insert( "rhasenddate", new int(FRHasEndDate) ); 716 dict.insert( "rhasenddate", new int(FRHasEndDate) );
717 dict.insert( "enddt", new int(FREndDate) ); 717 dict.insert( "enddt", new int(FREndDate) );
718 dict.insert( "start", new int(FRStart) ); 718 dict.insert( "start", new int(FRStart) );
719 dict.insert( "end", new int(FREnd) ); 719 dict.insert( "end", new int(FREnd) );
720 dict.insert( "note", new int(FNote) ); 720 dict.insert( "note", new int(FNote) );
721 dict.insert( "created", new int(FCreated) ); 721 dict.insert( "created", new int(FCreated) );
722 dict.insert( "action", new int(FAction) ); 722 dict.insert( "action", new int(FAction) );
723 dict.insert( "actionkey", new int(FActionKey) ); 723 dict.insert( "actionkey", new int(FActionKey) );
724 dict.insert( "actionorig", new int (FJournalOrigHadRepeat) ); 724 dict.insert( "actionorig", new int (FJournalOrigHadRepeat) );
725 725
726 726
727 QByteArray ba = f.readAll(); 727 QByteArray ba = f.readAll();
728 char* dt = ba.data(); 728 char* dt = ba.data();
729 int len = ba.size(); 729 int len = ba.size();
730 int currentAction, 730 int currentAction,
731 journalKey, 731 journalKey,
732 origHadRepeat; // should be bool, but we need tri-state(not being used) 732 origHadRepeat; // should be bool, but we need tri-state(not being used)
733 733
734 int i = 0; 734 int i = 0;
735 char *point; 735 char *point;
736 // hack to get rid of segfaults after reading </DATEBOOK> 736 // hack to get rid of segfaults after reading </DATEBOOK>
737 while ( (dt+i != 0) && (( point = strstr( dt+i, "<event " ) ) != 0 )) { 737 while ( (dt+i != 0) && (( point = strstr( dt+i, "<event " ) ) != 0 )) {
738 i = point - dt; 738 i = point - dt;
diff --git a/library/finddialog.cpp b/library/finddialog.cpp
index d9f430a..ddf41a7 100644
--- a/library/finddialog.cpp
+++ b/library/finddialog.cpp
@@ -19,24 +19,31 @@
19**********************************************************************/ 19**********************************************************************/
20 20
21// WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT 21// WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT
22// have this class. 22// have this class.
23#define QTOPIA_INTERNAL_FD 23#define QTOPIA_INTERNAL_FD
24 24
25#include "finddialog.h" 25#include "finddialog.h"
26#include "findwidget_p.h" 26#include "findwidget_p.h"
27 27
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30 30
31/*!
32 \class FindDialog finddialog.h
33 \brief A simple FindDialog
34
35 A find dialog. FIXME!!!!
36
37*/
31FindDialog::FindDialog( const QString &appName, QWidget *parent, 38FindDialog::FindDialog( const QString &appName, QWidget *parent,
32 const char *name, bool modal ) 39 const char *name, bool modal )
33 : QDialog( parent, name, modal ) 40 : QDialog( parent, name, modal )
34{ 41{
35 setCaption( tr("Find") ); 42 setCaption( tr("Find") );
36 QVBoxLayout *vb; 43 QVBoxLayout *vb;
37 vb = new QVBoxLayout( this ); 44 vb = new QVBoxLayout( this );
38 fw = new FindWidget( appName, this, "Find Widget" ); 45 fw = new FindWidget( appName, this, "Find Widget" );
39 vb->addWidget( fw ); 46 vb->addWidget( fw );
40 QObject::connect( fw, SIGNAL(signalFindClicked(const QString&, 47 QObject::connect( fw, SIGNAL(signalFindClicked(const QString&,
41 bool,bool,int)), 48 bool,bool,int)),
42 this, SIGNAL(signalFindClicked(const QString&, 49 this, SIGNAL(signalFindClicked(const QString&,
diff --git a/library/global.cpp b/library/global.cpp
index 68a3a75..ce39751 100644
--- a/library/global.cpp
+++ b/library/global.cpp
@@ -101,25 +101,25 @@ private:
101 QDict<QTime> dict; 101 QDict<QTime> dict;
102 static StartingAppList *appl; 102 static StartingAppList *appl;
103}; 103};
104 104
105StartingAppList* StartingAppList::appl = 0; 105StartingAppList* StartingAppList::appl = 0;
106 106
107StartingAppList::StartingAppList( QObject *parent, const char* name ) 107StartingAppList::StartingAppList( QObject *parent, const char* name )
108 :QObject( parent, name ) 108 :QObject( parent, name )
109{ 109{
110#if QT_VERSION >= 232 && defined(QWS) 110#if QT_VERSION >= 232 && defined(QWS)
111 connect( qwsServer, SIGNAL( newChannel(const QString&)), 111 connect( qwsServer, SIGNAL( newChannel(const QString&)),
112 this, SLOT( handleNewChannel(const QString&)) ); 112 this, SLOT( handleNewChannel(const QString&)) );
113 #endif 113#endif
114 dict.setAutoDelete( TRUE ); 114 dict.setAutoDelete( TRUE );
115} 115}
116 116
117void StartingAppList::add( const QString& name ) 117void StartingAppList::add( const QString& name )
118{ 118{
119#if QT_VERSION >= 232 && !defined(QT_NO_COP) 119#if QT_VERSION >= 232 && !defined(QT_NO_COP)
120 if ( !appl ) 120 if ( !appl )
121 appl = new StartingAppList; 121 appl = new StartingAppList;
122 QTime *t = new QTime; 122 QTime *t = new QTime;
123 t->start(); 123 t->start();
124 appl->dict.insert( "QPE/Application/" + name, t ); 124 appl->dict.insert( "QPE/Application/" + name, t );
125#endif 125#endif
@@ -379,25 +379,25 @@ void Global::createDocDir()
379 docDirCreated = TRUE; 379 docDirCreated = TRUE;
380 mkdir( QPEApplication::documentDir().latin1(), 0755 ); 380 mkdir( QPEApplication::documentDir().latin1(), 0755 );
381 } 381 }
382} 382}
383 383
384 384
385/*! 385/*!
386 Displays a status \a message to the user. This usually appears 386 Displays a status \a message to the user. This usually appears
387 in the taskbar for a short amount of time, then disappears. 387 in the taskbar for a short amount of time, then disappears.
388*/ 388*/
389void Global::statusMessage(const QString& message) 389void Global::statusMessage(const QString& message)
390{ 390{
391#if!defined(QT_NO_COP) 391#if !defined(QT_NO_COP)
392 QCopEnvelope e( "QPE/TaskBar", "message(QString)" ); 392 QCopEnvelope e( "QPE/TaskBar", "message(QString)" );
393 e << message; 393 e << message;
394#endif 394#endif
395} 395}
396 396
397/*! 397/*!
398 \internal 398 \internal
399*/ 399*/
400void Global::applyStyle() 400void Global::applyStyle()
401{ 401{
402#if !defined(QT_NO_COP) 402#if !defined(QT_NO_COP)
403 QCopChannel::send( "QPE/System", "applyStyle()" ); 403 QCopChannel::send( "QPE/System", "applyStyle()" );
@@ -552,25 +552,25 @@ void Global::terminate( const AppLnk* app )
552void Global::invoke(const QString &c) 552void Global::invoke(const QString &c)
553{ 553{
554 // Convert the command line in to a list of arguments 554 // Convert the command line in to a list of arguments
555 QStringList list = QStringList::split(QRegExp(" *"),c); 555 QStringList list = QStringList::split(QRegExp(" *"),c);
556 556
557#if !defined(QT_NO_COP) 557#if !defined(QT_NO_COP)
558 QString ap=list[0]; 558 QString ap=list[0];
559 // see if the application is already running 559 // see if the application is already running
560 // XXX should lock file /tmp/qcop-msg-ap 560 // XXX should lock file /tmp/qcop-msg-ap
561 if ( QCopChannel::isRegistered( ("QPE/Application/" + ap).latin1() ) ) { 561 if ( QCopChannel::isRegistered( ("QPE/Application/" + ap).latin1() ) ) {
562 // If the channel is already register, the app is already running, so show it. 562 // If the channel is already register, the app is already running, so show it.
563 { QCopEnvelope env( ("QPE/Application/" + ap).latin1(), "raise()" ); } 563 { QCopEnvelope env( ("QPE/Application/" + ap).latin1(), "raise()" ); }
564 564
565 QCopEnvelope e("QPE/System", "notBusy(QString)" ); 565 QCopEnvelope e("QPE/System", "notBusy(QString)" );
566 e << ap; 566 e << ap;
567 return; 567 return;
568 } 568 }
569 // XXX should unlock file /tmp/qcop-msg-ap 569 // XXX should unlock file /tmp/qcop-msg-ap
570 //see if it is being started 570 //see if it is being started
571 if ( StartingAppList::isStarting( ap ) ) { 571 if ( StartingAppList::isStarting( ap ) ) {
572 QCopEnvelope e("QPE/System", "notBusy(QString)" ); 572 QCopEnvelope e("QPE/System", "notBusy(QString)" );
573 e << ap; 573 e << ap;
574 return; 574 return;
575 } 575 }
576 576
@@ -595,74 +595,74 @@ void Global::invoke(const QString &c)
595 // more logic should be used, but this will be fine for the moment... 595 // more logic should be used, but this will be fine for the moment...
596 QCopEnvelope ( "QPE/System", "busy()" ); 596 QCopEnvelope ( "QPE/System", "busy()" );
597#endif 597#endif
598 598
599#ifdef HAVE_QUICKEXEC 599#ifdef HAVE_QUICKEXEC
600 QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so"; 600 QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so";
601 qDebug("libfile = %s", libexe.latin1() ); 601 qDebug("libfile = %s", libexe.latin1() );
602 if ( QFile::exists( libexe ) ) { 602 if ( QFile::exists( libexe ) ) {
603 qDebug("calling quickexec %s", libexe.latin1() ); 603 qDebug("calling quickexec %s", libexe.latin1() );
604 quickexecv( libexe.utf8().data(), (const char **)args ); 604 quickexecv( libexe.utf8().data(), (const char **)args );
605 } else 605 } else
606#endif 606#endif
607 { 607 {
608 bool success = false; 608 bool success = false;
609 int pfd [2]; 609 int pfd [2];
610 if ( ::pipe ( pfd ) < 0 ) 610 if ( ::pipe ( pfd ) < 0 )
611 pfd [0] = pfd [1] = -1; 611 pfd [0] = pfd [1] = -1;
612 612
613 pid_t pid = ::fork ( ); 613 pid_t pid = ::fork ( );
614 614
615 if ( pid == 0 ) { // child 615 if ( pid == 0 ) { // child
616 for ( int fd = 3; fd < 100; fd++ ) { 616 for ( int fd = 3; fd < 100; fd++ ) {
617 if ( fd != pfd [1] ) 617 if ( fd != pfd [1] )
618 ::close ( fd ); 618 ::close ( fd );
619 } 619 }
620 ::setpgid ( ::getpid ( ), ::getppid ( )); 620 ::setpgid ( ::getpid ( ), ::getppid ( ));
621 621
622 // Closing of fd[1] indicates that the execvp succeeded! 622 // Closing of fd[1] indicates that the execvp succeeded!
623 if ( pfd [1] >= 0 ) 623 if ( pfd [1] >= 0 )
624 ::fcntl ( pfd [1], F_SETFD, FD_CLOEXEC ); 624 ::fcntl ( pfd [1], F_SETFD, FD_CLOEXEC );
625 625
626 // Try bindir first, so that foo/bar works too 626 // Try bindir first, so that foo/bar works too
627 ::execv ( qpeDir ( ) + "/bin/" + args [0], (char * const *) args ); 627 ::execv ( qpeDir ( ) + "/bin/" + args [0], (char * const *) args );
628 ::execvp ( args [0], (char * const *) args ); 628 ::execvp ( args [0], (char * const *) args );
629 629
630 char resultByte = 1; 630 char resultByte = 1;
631 if ( pfd [1] >= 0 ) 631 if ( pfd [1] >= 0 )
632 ::write ( pfd [1], &resultByte, 1 ); 632 ::write ( pfd [1], &resultByte, 1 );
633 ::_exit ( -1 ); 633 ::_exit ( -1 );
634 } 634 }
635 else if ( pid > 0 ) { 635 else if ( pid > 0 ) {
636 success = true; 636 success = true;
637 637
638 if ( pfd [1] >= 0 ) 638 if ( pfd [1] >= 0 )
639 ::close ( pfd [1] ); 639 ::close ( pfd [1] );
640 if ( pfd [0] >= 0 ) { 640 if ( pfd [0] >= 0 ) {
641 while ( true ) { 641 while ( true ) {
642 char resultByte; 642 char resultByte;
643 int n = ::read ( pfd [0], &resultByte, 1 ); 643 int n = ::read ( pfd [0], &resultByte, 1 );
644 if ( n == 1 ) { 644 if ( n == 1 ) {
645 success = false; 645 success = false;
646 break; 646 break;
647 } 647 }
648 if (( n == -1 ) && (( errno == ECHILD ) || ( errno == EINTR ))) 648 if (( n == -1 ) && (( errno == ECHILD ) || ( errno == EINTR )))
649 continue; 649 continue;
650 650
651 break; // success 651 break; // success
652 } 652 }
653 ::close ( pfd [0] ); 653 ::close ( pfd [0] );
654 } 654 }
655 } 655 }
656 if ( success ) 656 if ( success )
657 StartingAppList::add( list[0] ); 657 StartingAppList::add( list[0] );
658 else 658 else
659 QMessageBox::warning( 0, "Error", "Could not start the application " + c, "Ok", 0, 0, 0, 1 ); 659 QMessageBox::warning( 0, "Error", "Could not start the application " + c, "Ok", 0, 0, 0, 1 );
660 } 660 }
661#endif //QT_NO_QWS_MULTIPROCESS 661#endif //QT_NO_QWS_MULTIPROCESS
662} 662}
663 663
664 664
665/*! 665/*!
666 Executes the application identfied by \a c, passing \a 666 Executes the application identfied by \a c, passing \a
667 document if it isn't null. 667 document if it isn't null.
668 668
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index c562f6c..2ef60d5 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -441,25 +441,25 @@ static void setTreble( int t = 0, int percent = -1 )
441*/ 441*/
442 442
443/*! 443/*!
444 \fn void QPEApplication::weekChanged( bool startOnMonday ) 444 \fn void QPEApplication::weekChanged( bool startOnMonday )
445 445
446 This signal is emitted if the week start day is changed. If \a 446 This signal is emitted if the week start day is changed. If \a
447 startOnMonday is TRUE then the first day of the week is Monday; if 447 startOnMonday is TRUE then the first day of the week is Monday; if
448 \a startOnMonday is FALSE then the first day of the week is 448 \a startOnMonday is FALSE then the first day of the week is
449 Sunday. 449 Sunday.
450*/ 450*/
451 451
452/*! 452/*!
453 \fn void QPEApplication::dateFormatChanged() 453 \fn void QPEApplication::dateFormatChanged(DateFormat)
454 454
455 This signal is emitted whenever the date format is changed. 455 This signal is emitted whenever the date format is changed.
456*/ 456*/
457 457
458/*! 458/*!
459 \fn void QPEApplication::flush() 459 \fn void QPEApplication::flush()
460 460
461 ### 461 ###
462*/ 462*/
463 463
464/*! 464/*!
465 \fn void QPEApplication::reload() 465 \fn void QPEApplication::reload()
@@ -1759,24 +1759,25 @@ void* operator new( size_t size )
1759} 1759}
1760 1760
1761void operator delete[]( void* p ) 1761void operator delete[]( void* p )
1762{ 1762{
1763 free( p ); 1763 free( p );
1764} 1764}
1765 1765
1766void operator delete[]( void* p, size_t /*size*/ ) 1766void operator delete[]( void* p, size_t /*size*/ )
1767{ 1767{
1768 free( p ); 1768 free( p );
1769} 1769}
1770 1770
1771
1771void operator delete( void* p ) 1772void operator delete( void* p )
1772{ 1773{
1773 free( p ); 1774 free( p );
1774} 1775}
1775 1776
1776void operator delete( void* p, size_t /*size*/ ) 1777void operator delete( void* p, size_t /*size*/ )
1777{ 1778{
1778 free( p ); 1779 free( p );
1779} 1780}
1780 1781
1781#endif 1782#endif
1782 1783
diff --git a/library/storage.cpp b/library/storage.cpp
index f4c1c02..12f9df9 100644
--- a/library/storage.cpp
+++ b/library/storage.cpp
@@ -191,45 +191,45 @@ bool deviceTab( const char *device) {
191 QString deviceName = me->mnt_fsname; 191 QString deviceName = me->mnt_fsname;
192// qDebug(deviceName); 192// qDebug(deviceName);
193 if( deviceName.left(name.length()) == name) { 193 if( deviceName.left(name.length()) == name) {
194 hasDevice = true; 194 hasDevice = true;
195 } 195 }
196 } 196 }
197 } 197 }
198 endmntent( mntfp ); 198 endmntent( mntfp );
199 return hasDevice; 199 return hasDevice;
200} 200}
201 201
202/*! 202/*!
203 * @fn hasCf() 203 * @fn static bool StorageInfo::hasCf()
204 * @brief returns whether device has Cf mounted 204 * @brief returns whether device has Cf mounted
205 * 205 *
206 */ 206 */
207bool StorageInfo::hasCf() 207bool StorageInfo::hasCf()
208{ 208{
209 return deviceTab("/dev/hd"); 209 return deviceTab("/dev/hd");
210} 210}
211 211
212/*! 212/*!
213 * @fn hasSd() 213 * @fn static bool StorageInfo::hasSd()
214 * @brief returns whether device has SD mounted 214 * @brief returns whether device has SD mounted
215 * 215 *
216 */ 216 */
217bool StorageInfo::hasSd() 217bool StorageInfo::hasSd()
218{ 218{
219 return deviceTab("/dev/mmcd"); 219 return deviceTab("/dev/mmcd");
220} 220}
221 221
222/*! 222/*!
223 * @fn hasMmc() 223 * @fn static bool StorageInfo::hasMmc()
224 * @brief reutrns whether device has mmc mounted 224 * @brief reutrns whether device has mmc mounted
225 * 225 *
226 */ 226 */
227bool StorageInfo::hasMmc() 227bool StorageInfo::hasMmc()
228{ 228{
229 bool hasMmc=false; 229 bool hasMmc=false;
230 if( deviceTab("/dev/mmc/part")) 230 if( deviceTab("/dev/mmc/part"))
231 hasMmc=true; 231 hasMmc=true;
232 if( deviceTab("/dev/mmcd")) 232 if( deviceTab("/dev/mmcd"))
233 hasMmc=true; 233 hasMmc=true;
234 return hasMmc; 234 return hasMmc;
235} 235}