summaryrefslogtreecommitdiff
path: root/library
authorzecke <zecke>2003-04-16 10:57:59 (UTC)
committer zecke <zecke>2003-04-16 10:57:59 (UTC)
commiteeb29547890a2d162de66d7d5b98d3840a7e2d79 (patch) (unidiff)
tree973c6de7aae2fd5ba368efb87fa24234f0e12aa3 /library
parentdfa2d294b3af09bf3757a3c2294a925093e72fc6 (diff)
downloadopie-eeb29547890a2d162de66d7d5b98d3840a7e2d79.zip
opie-eeb29547890a2d162de66d7d5b98d3840a7e2d79.tar.gz
opie-eeb29547890a2d162de66d7d5b98d3840a7e2d79.tar.bz2
Fix API docu
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
@@ -319,33 +319,49 @@ const QArray<int>& AppLnk::categories() const
319 319
320/*! 320/*!
321 \fn int AppLnk::id() const 321 \fn int AppLnk::id() const
322 322
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/*!
348 Loads \a file (e.g. \e app.desktop) as an AppLnk. 364 Loads \a file (e.g. \e app.desktop) as an AppLnk.
349 365
350 \sa writeLink() 366 \sa writeLink()
351*/ 367*/
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
@@ -474,33 +474,33 @@ QString Categories::displaySingle( const QString &app,
474 return tr("Unfiled"); 474 return tr("Unfiled");
475 strs.sort(); 475 strs.sort();
476 QString r; 476 QString r;
477 if ( strs.count() > 1 ) { 477 if ( strs.count() > 1 ) {
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;
503 int i; 503 int i;
504 504
505 for ( i=0, it=labels.begin(); it!=labels.end(); i++, ++it ) { 505 for ( i=0, it=labels.begin(); it!=labels.end(); i++, ++it ) {
506 int value = id( app, *it ); 506 int value = id( app, *it );
@@ -835,62 +835,57 @@ void CheckedListView::setChecked( const QStringList &checked )
835 // make sure it is showing at least one checked item 835 // make sure it is showing at least one checked item
836 if ( !showingChecked ) { 836 if ( !showingChecked ) {
837 ensureItemVisible( i ); 837 ensureItemVisible( i );
838 showingChecked = TRUE; 838 showingChecked = TRUE;
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
893/*! \fn void Categories::categoryRenamed( const Categories &cats, const QString &appname, 888/*! \fn void Categories::categoryRenamed( const Categories &cats, const QString &appname,
894 int uid) 889 int uid)
895 890
896 Emitted if \a uid in the \a appname CategoryGroup is renamed in \a cats 891 Emitted if \a uid in the \a appname CategoryGroup is renamed in \a cats
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
@@ -72,33 +72,33 @@ public:
72 /** Returns a sorted list of labels */ 72 /** Returns a sorted list of labels */
73 QStringList labels() const; 73 QStringList labels() const;
74 74
75 QStringList labels( const QArray<int> &catids ) const; 75 QStringList labels( const QArray<int> &catids ) const;
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 )
101{ mAppCats = c.mAppCats; mGlobalCats = c.mGlobalCats; return *this; } 101{ mAppCats = c.mAppCats; mGlobalCats = c.mGlobalCats; return *this; }
102 102
103 void clear(); 103 void clear();
104 104
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
@@ -154,39 +154,39 @@ Qtopia::UidGen Event::sUidGen( Qtopia::UidGen::Qtopia );
154/*! 154/*!
155 \fn bool Event::isAllDay() const 155 \fn bool Event::isAllDay() const
156 156
157 Returns TRUE if the event is an all day event. Otherwise returns FALSE. 157 Returns TRUE if the event is an all day event. Otherwise returns FALSE.
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
189*/ 189*/
190 190
191/*! 191/*!
192 \fn void Event::setAlarm(int delay, SoundTypeChoice s) 192 \fn void Event::setAlarm(int delay, SoundTypeChoice s)
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
@@ -19,35 +19,47 @@
19**********************************************************************/ 19**********************************************************************/
20#ifndef QTPALMTOP_RECORD_H 20#ifndef QTPALMTOP_RECORD_H
21#define QTPALMTOP_RECORD_H 21#define QTPALMTOP_RECORD_H
22#include <qglobal.h> 22#include <qglobal.h>
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(); }
50 void setCategories( int single ); 62 void setCategories( int single );
51 const QArray<int> &categories() const { return mCats; } 63 const QArray<int> &categories() const { return mCats; }
52 64
53 void reassignCategoryId( int oldId, int newId ) 65 void reassignCategoryId( int oldId, int newId )
diff --git a/library/datebookdb.cpp b/library/datebookdb.cpp
index 0fedfa8..2f33255 100644
--- a/library/datebookdb.cpp
+++ b/library/datebookdb.cpp
@@ -58,33 +58,33 @@ static QString dateBookFilename()
58 58
59/* Calculating the next event of a recuring event is actually 59/* Calculating the next event of a recuring event is actually
60 computationally inexpensive, esp. compared to checking each day 60 computationally inexpensive, esp. compared to checking each day
61 individually. There are bad worse cases for say the 29th of 61 individually. There are bad worse cases for say the 29th of
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 */
87 /* first convert the repeatPattern.Days() mask to the next 87 /* first convert the repeatPattern.Days() mask to the next
88 day of week valid after from */ 88 day of week valid after from */
89 dayOfWeek = from.dayOfWeek(); 89 dayOfWeek = from.dayOfWeek();
90 dayOfWeek--; /* we want 0-6, doco for above specs 1-7 */ 90 dayOfWeek--; /* we want 0-6, doco for above specs 1-7 */
@@ -448,33 +448,33 @@ QValueList<Event> DateBookDB::getEvents( const QDateTime &start )
448 return tmpList; 448 return tmpList;
449} 449}
450 450
451//#### Why is this code duplicated in getEvents ????? 451//#### Why is this code duplicated in getEvents ?????
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) );
477 else 477 else
478 effEv.setEnd( dtEnd.time() ); 478 effEv.setEnd( dtEnd.time() );
479 tmpList.append( effEv ); 479 tmpList.append( effEv );
480 } 480 }
@@ -493,33 +493,33 @@ QValueList<EffectiveEvent> DateBookDB::getEffectiveEvents( const QDate &from,
493 effEv.setDate( dt.date() ); 493 effEv.setDate( dt.date() );
494 if ( dt >= from ) { 494 if ( dt >= from ) {
495 effEv.setStart( QTime(0, 0, 0) ); 495 effEv.setStart( QTime(0, 0, 0) );
496 if ( dt.date() == dtEnd.date() ) 496 if ( dt.date() == dtEnd.date() )
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;
522 } 522 }
523 dummy_event.setRepeat(TRUE, r); 523 dummy_event.setRepeat(TRUE, r);
524 524
525 while (nextOccurance(dummy_event, itDate, repeat)) { 525 while (nextOccurance(dummy_event, itDate, repeat)) {
@@ -610,33 +610,33 @@ void DateBookDB::editEvent( const Event &old, Event &editedEv )
610 int oldIndex=0; 610 int oldIndex=0;
611 bool oldHadRepeat = old.hasRepeat(); 611 bool oldHadRepeat = old.hasRepeat();
612 Event orig; 612 Event orig;
613 613
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 }
639 639
640 // Add new event 640 // Add new event
641 if ( editedEv.hasAlarm() ) 641 if ( editedEv.hasAlarm() )
642 addEventAlarm( editedEv ); 642 addEventAlarm( editedEv );
@@ -659,33 +659,33 @@ void DateBookDB::removeEvent( const Event &ev )
659void DateBookDB::removeJFEvent( const Event&ev ) 659void DateBookDB::removeJFEvent( const Event&ev )
660{ 660{
661 if ( ev.hasAlarm() ) 661 if ( ev.hasAlarm() )
662 delEventAlarm( ev ); 662 delEventAlarm( 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,
688 FRType, 688 FRType,
689 FRWeekdays, 689 FRWeekdays,
690 FRPosition, 690 FRPosition,
691 FRFreq, 691 FRFreq,
@@ -710,33 +710,33 @@ void DateBookDB::loadFile( const QString &strFile )
710 dict.insert( "alarm", new int(FAlarm) ); 710 dict.insert( "alarm", new int(FAlarm) );
711 dict.insert( "sound", new int(FSound) ); 711 dict.insert( "sound", new int(FSound) );
712 dict.insert( "rtype", new int(FRType) ); 712 dict.insert( "rtype", new int(FRType) );
713 dict.insert( "rweekdays", new int(FRWeekdays) ); 713 dict.insert( "rweekdays", new int(FRWeekdays) );
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;
739 // if we are reading in events in the general case, 739 // if we are reading in events in the general case,
740 // we are just adding them, so let the actions represent that... 740 // we are just adding them, so let the actions represent that...
741 currentAction = ACTION_ADD; 741 currentAction = ACTION_ADD;
742 journalKey = -1; 742 journalKey = -1;
diff --git a/library/finddialog.cpp b/library/finddialog.cpp
index d9f430a..ddf41a7 100644
--- a/library/finddialog.cpp
+++ b/library/finddialog.cpp
@@ -15,32 +15,39 @@
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
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&,
43 bool,bool,int)) ); 50 bool,bool,int)) );
44 QObject::connect( fw, SIGNAL(signalFindClicked(const QString&,const QDate&, 51 QObject::connect( fw, SIGNAL(signalFindClicked(const QString&,const QDate&,
45 bool,bool,int)), 52 bool,bool,int)),
46 this, SIGNAL(signalFindClicked(const QString&, 53 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
@@ -97,33 +97,33 @@ private slots:
97 void handleNewChannel( const QString &); 97 void handleNewChannel( const QString &);
98private: 98private:
99 StartingAppList( QObject *parent=0, const char* name=0 ) ; 99 StartingAppList( QObject *parent=0, const char* name=0 ) ;
100 100
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
126} 126}
127 127
128bool StartingAppList::isStarting( const QString name ) 128bool StartingAppList::isStarting( const QString name )
129{ 129{
@@ -375,33 +375,33 @@ QString Global::applicationFileName(const QString& appname, const QString& filen
375*/ 375*/
376void Global::createDocDir() 376void Global::createDocDir()
377{ 377{
378 if ( !docDirCreated ) { 378 if ( !docDirCreated ) {
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()" );
404#else 404#else
405 ((QPEApplication *)qApp)->applyStyle(); // apply without needing QCop for floppy version 405 ((QPEApplication *)qApp)->applyStyle(); // apply without needing QCop for floppy version
406#endif 406#endif
407} 407}
@@ -548,33 +548,33 @@ void Global::terminate( const AppLnk* app )
548 \warning Do not use this function. Use execute instead. 548 \warning Do not use this function. Use execute instead.
549 549
550 \sa execute() 550 \sa execute()
551*/ 551*/
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
577#endif 577#endif
578 578
579#ifdef QT_NO_QWS_MULTIPROCESS 579#ifdef QT_NO_QWS_MULTIPROCESS
580 QMessageBox::warning( 0, "Error", "Could not find the application " + c, "Ok", 0, 0, 0, 1 ); 580 QMessageBox::warning( 0, "Error", "Could not find the application " + c, "Ok", 0, 0, 0, 1 );
@@ -591,82 +591,82 @@ void Global::invoke(const QString &c)
591 args[j] = NULL; 591 args[j] = NULL;
592 592
593#if !defined(QT_NO_COP) 593#if !defined(QT_NO_COP)
594 // an attempt to show a wait... 594 // an attempt to show a wait...
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
669 Note that a better approach might be to send a QCop message to the 669 Note that a better approach might be to send a QCop message to the
670 application's QPE/Application/\e{appname} channel. 670 application's QPE/Application/\e{appname} channel.
671*/ 671*/
672void Global::execute( const QString &c, const QString& document ) 672void Global::execute( const QString &c, const QString& document )
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index c562f6c..2ef60d5 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -437,33 +437,33 @@ static void setTreble( int t = 0, int percent = -1 )
437 \fn void QPEApplication::volumeChanged( bool muted ) 437 \fn void QPEApplication::volumeChanged( bool muted )
438 438
439 This signal is emitted whenever the mute state is changed. If \a 439 This signal is emitted whenever the mute state is changed. If \a
440 muted is TRUE, then sound output has been muted. 440 muted is TRUE, then sound output has been muted.
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()
466 466
467*/ 467*/
468 468
469/*! 469/*!
@@ -1755,32 +1755,33 @@ void* operator new[]( size_t size )
1755 1755
1756void* operator new( size_t size ) 1756void* operator new( size_t size )
1757{ 1757{
1758 return malloc( size ); 1758 return malloc( 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
1783#if ( QT_VERSION <= 230 ) && !defined(SINGLE_APP) 1784#if ( QT_VERSION <= 230 ) && !defined(SINGLE_APP)
1784#include <qwidgetlist.h> 1785#include <qwidgetlist.h>
1785#ifdef QWS 1786#ifdef QWS
1786#include <qgfx_qws.h> 1787#include <qgfx_qws.h>
diff --git a/library/storage.cpp b/library/storage.cpp
index f4c1c02..12f9df9 100644
--- a/library/storage.cpp
+++ b/library/storage.cpp
@@ -187,53 +187,53 @@ bool deviceTab( const char *device) {
187 struct mntent *me; 187 struct mntent *me;
188 FILE *mntfp = setmntent( "/etc/mtab", "r" ); 188 FILE *mntfp = setmntent( "/etc/mtab", "r" );
189 if ( mntfp ) { 189 if ( mntfp ) {
190 while ( (me = getmntent( mntfp )) != 0 ) { 190 while ( (me = getmntent( mntfp )) != 0 ) {
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}
236 236
237 237
238//--------------------------------------------------------------------------- 238//---------------------------------------------------------------------------
239 239