summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp4
-rw-r--r--libopie2/opiedb/osqlresult.cpp8
-rw-r--r--libopie2/opiedb/osqlresult.h4
-rw-r--r--libopie2/opiepim/TODO1
4 files changed, 11 insertions, 6 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 26c6dca..129215b 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -710,76 +710,80 @@ void ODevice::virtual_hook(int, void* ){
710 710
711} 711}
712 712
713/** 713/**
714 * Sends a QCOP message to channel QPE/System 714 * Sends a QCOP message to channel QPE/System
715 * with the message "aboutToSuspend()" if this 715 * with the message "aboutToSuspend()" if this
716 * is the windowing server 716 * is the windowing server
717 */ 717 */
718void ODevice::sendSuspendmsg() 718void ODevice::sendSuspendmsg()
719{ 719{
720 if ( isQWS() ) 720 if ( isQWS() )
721 return; 721 return;
722 722
723 QCopEnvelope ( "QPE/System", "aboutToSuspend()" ); 723 QCopEnvelope ( "QPE/System", "aboutToSuspend()" );
724} 724}
725 725
726/** 726/**
727 * \brief Prepend the QWSServer::KeyboardFilter to the list of installed KeyFilters 727 * \brief Prepend the QWSServer::KeyboardFilter to the list of installed KeyFilters
728 * 728 *
729 * Prepend a QWSServer::KeyboardFilter to the List of Keyboard 729 * Prepend a QWSServer::KeyboardFilter to the List of Keyboard
730 * Filters. This function is the only way to prepend a KeyFilter. 730 * Filters. This function is the only way to prepend a KeyFilter.
731 * 731 *
732 * @param aFilter The KeyFilter to be prepended to the list of filters 732 * @param aFilter The KeyFilter to be prepended to the list of filters
733 * 733 *
734 * @see Opie::Core::OKeyFilter 734 * @see Opie::Core::OKeyFilter
735 * @see Opie::Core::OKeyFilter::inst() 735 * @see Opie::Core::OKeyFilter::inst()
736 */ 736 */
737void ODevice::addPreHandler(QWSServer::KeyboardFilter*aFilter) 737void ODevice::addPreHandler(QWSServer::KeyboardFilter*aFilter)
738{ 738{
739 Opie::Core::OKeyFilter::inst()->addPreHandler(aFilter); 739 Opie::Core::OKeyFilter::inst()->addPreHandler(aFilter);
740} 740}
741 741
742/** 742/**
743 * \brief Remove the QWSServer::KeyboardFilter in the param from the list 743 * \brief Remove the QWSServer::KeyboardFilter in the param from the list
744 * 744 *
745 * Remove the QWSServer::KeyboardFilter \par aFilter from the List 745 * Remove the QWSServer::KeyboardFilter \par aFilter from the List
746 * of Keyfilters. Call this when you delete the KeyFilter! 746 * of Keyfilters. Call this when you delete the KeyFilter!
747 * 747 *
748 * @param aFilter The filter to be removed from the Opie::Core::OKeyFilter 748 * @param aFilter The filter to be removed from the Opie::Core::OKeyFilter
749 * @see Opie::Core::ODevice::addPreHandler 749 * @see Opie::Core::ODevice::addPreHandler
750 */ 750 */
751void ODevice::remPreHandler(QWSServer::KeyboardFilter*aFilter) 751void ODevice::remPreHandler(QWSServer::KeyboardFilter*aFilter)
752{ 752{
753 Opie::Core::OKeyFilter::inst()->remPreHandler(aFilter); 753 Opie::Core::OKeyFilter::inst()->remPreHandler(aFilter);
754} 754}
755 755
756void ODevice::playingStopped() { 756void ODevice::playingStopped() {
757 const_cast<QObject*>(sender())->disconnect( this ); 757 const_cast<QObject*>(sender())->disconnect( this );
758#ifndef QT_NO_SOUND
758 if ( d->m_sound >= 0 ) { 759 if ( d->m_sound >= 0 ) {
759 ::ioctl ( d->m_sound, MIXER_WRITE( d->m_mixer ), &d->m_vol ); 760 ::ioctl ( d->m_sound, MIXER_WRITE( d->m_mixer ), &d->m_vol );
760 ::close ( d->m_sound ); 761 ::close ( d->m_sound );
761 } 762 }
763#endif
762} 764}
763 765
764void ODevice::changeMixerForAlarm( int mixer, const char* file, Sound *snd ) { 766void ODevice::changeMixerForAlarm( int mixer, const char* file, Sound *snd ) {
767#ifndef QT_NO_SOUND
765 if (( d->m_sound = ::open ( file, O_RDWR )) >= 0 ) { 768 if (( d->m_sound = ::open ( file, O_RDWR )) >= 0 ) {
766 if ( ::ioctl ( d->m_sound, MIXER_READ( mixer ), &d->m_vol ) >= 0 ) { 769 if ( ::ioctl ( d->m_sound, MIXER_READ( mixer ), &d->m_vol ) >= 0 ) {
767 Config cfg ( "qpe" ); 770 Config cfg ( "qpe" );
768 cfg. setGroup ( "Volume" ); 771 cfg. setGroup ( "Volume" );
769 772
770 int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 ); 773 int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 );
771 if ( volalarm < 0 ) 774 if ( volalarm < 0 )
772 volalarm = 0; 775 volalarm = 0;
773 else if ( volalarm > 100 ) 776 else if ( volalarm > 100 )
774 volalarm = 100; 777 volalarm = 100;
775 volalarm |= ( volalarm << 8 ); 778 volalarm |= ( volalarm << 8 );
776 779
777 if ( ::ioctl ( d->m_sound, MIXER_WRITE( mixer ), &volalarm ) >= 0 ) 780 if ( ::ioctl ( d->m_sound, MIXER_WRITE( mixer ), &volalarm ) >= 0 )
778 register_qpe_sound_finished(snd, this, SLOT(playingStopped())); 781 register_qpe_sound_finished(snd, this, SLOT(playingStopped()));
779 } 782 }
780 d->m_mixer = mixer; 783 d->m_mixer = mixer;
781 } 784 }
785#endif
782} 786}
783 787
784} 788}
785} 789}
diff --git a/libopie2/opiedb/osqlresult.cpp b/libopie2/opiedb/osqlresult.cpp
index bad7d8b..268ac8e 100644
--- a/libopie2/opiedb/osqlresult.cpp
+++ b/libopie2/opiedb/osqlresult.cpp
@@ -1,90 +1,90 @@
1 1
2#include "osqlresult.h" 2#include "osqlresult.h"
3 3
4using namespace Opie::DB; 4using namespace Opie::DB;
5 5
6OSQLResultItem::OSQLResultItem( const TableString& string, 6OSQLResultItem::OSQLResultItem( const TableString& string,
7 const TableInt& Int) 7 const TableInt& Int)
8 : m_string( string ), m_int( Int ) 8 : m_string( string ), m_int( Int )
9{ 9{
10 10
11} 11}
12OSQLResultItem::~OSQLResultItem() { 12OSQLResultItem::~OSQLResultItem() {
13} 13}
14OSQLResultItem::OSQLResultItem( const OSQLResultItem& item) { 14OSQLResultItem::OSQLResultItem( const OSQLResultItem& item) {
15 *this = item; 15 *this = item;
16} 16}
17OSQLResultItem &OSQLResultItem::operator=( const OSQLResultItem& other) { 17OSQLResultItem &OSQLResultItem::operator=( const OSQLResultItem& other) {
18 m_string = other.m_string; 18 m_string = other.m_string;
19 m_int = other.m_int; 19 m_int = other.m_int;
20 return *this; 20 return *this;
21} 21}
22OSQLResultItem::TableString OSQLResultItem::tableString()const{ 22OSQLResultItem::TableString OSQLResultItem::tableString()const{
23 return m_string; 23 return m_string;
24} 24}
25OSQLResultItem::TableInt OSQLResultItem::tableInt()const { 25OSQLResultItem::TableInt OSQLResultItem::tableInt()const {
26 return m_int; 26 return m_int;
27} 27}
28QString OSQLResultItem::data( const QString& columnName, bool *ok ) { 28QString OSQLResultItem::data( const QString& columnName, bool *ok ) const {
29 TableString::Iterator it = m_string.find( columnName ); 29 TableString::ConstIterator it = m_string.find( columnName );
30 30
31 /* if found */ 31 /* if found */
32 if ( it != m_string.end() ) { 32 if ( it != m_string.end() ) {
33 if ( ok ) *ok = true; 33 if ( ok ) *ok = true;
34 return it.data(); 34 return it.data();
35 }else{ 35 }else{
36 if ( ok ) *ok = false; 36 if ( ok ) *ok = false;
37 return QString::null; 37 return QString::null;
38 } 38 }
39 39
40} 40}
41QString OSQLResultItem::data( int column, bool *ok ) { 41QString OSQLResultItem::data( int column, bool *ok ) const {
42 TableInt::Iterator it = m_int.find( column ); 42 TableInt::ConstIterator it = m_int.find( column );
43 43
44 /* if found */ 44 /* if found */
45 if ( it != m_int.end() ) { 45 if ( it != m_int.end() ) {
46 if ( ok ) *ok = true; 46 if ( ok ) *ok = true;
47 return it.data(); 47 return it.data();
48 }else{ 48 }else{
49 if ( ok ) *ok = false; 49 if ( ok ) *ok = false;
50 return QString::null; 50 return QString::null;
51 } 51 }
52} 52}
53/* 53/*
54 * DateFormat is 'YYYY-MM-DD' 54 * DateFormat is 'YYYY-MM-DD'
55 */ 55 */
56QDate OSQLResultItem::dataToDate( const QString& column, bool *ok ) { 56QDate OSQLResultItem::dataToDate( const QString& column, bool *ok ) {
57 QDate date = QDate::currentDate(); 57 QDate date = QDate::currentDate();
58 QString str = data( column, ok ); 58 QString str = data( column, ok );
59 if (!str.isEmpty() ) { 59 if (!str.isEmpty() ) {
60 ;// convert 60 ;// convert
61 } 61 }
62 return date; 62 return date;
63} 63}
64QDate OSQLResultItem::dataToDate( int column, bool *ok ) { 64QDate OSQLResultItem::dataToDate( int column, bool *ok ) {
65 QDate date = QDate::currentDate(); 65 QDate date = QDate::currentDate();
66 QString str = data( column, ok ); 66 QString str = data( column, ok );
67 if (!str.isEmpty() ) { 67 if (!str.isEmpty() ) {
68 ;// convert 68 ;// convert
69 } 69 }
70 return date; 70 return date;
71 71
72} 72}
73QDateTime OSQLResultItem::dataToDateTime( const QString& column, bool *ok ) { 73QDateTime OSQLResultItem::dataToDateTime( const QString& column, bool *ok ) {
74 QDateTime time = QDateTime::currentDateTime(); 74 QDateTime time = QDateTime::currentDateTime();
75 return time; 75 return time;
76} 76}
77QDateTime OSQLResultItem::dataToDateTime( int column, bool *ok ) { 77QDateTime OSQLResultItem::dataToDateTime( int column, bool *ok ) {
78 QDateTime time = QDateTime::currentDateTime(); 78 QDateTime time = QDateTime::currentDateTime();
79 return time; 79 return time;
80} 80}
81 81
82OSQLResult::OSQLResult( enum State state, 82OSQLResult::OSQLResult( enum State state,
83 const OSQLResultItem::ValueList& list, 83 const OSQLResultItem::ValueList& list,
84 const OSQLError::ValueList& error ) 84 const OSQLError::ValueList& error )
85 : m_state( state ), m_list( list ), m_error( error ) 85 : m_state( state ), m_list( list ), m_error( error )
86{ 86{
87 87
88} 88}
89OSQLResult::~OSQLResult() { 89OSQLResult::~OSQLResult() {
90 90
diff --git a/libopie2/opiedb/osqlresult.h b/libopie2/opiedb/osqlresult.h
index fc6f01a..92b65a0 100644
--- a/libopie2/opiedb/osqlresult.h
+++ b/libopie2/opiedb/osqlresult.h
@@ -6,102 +6,102 @@
6#include <qvaluelist.h> 6#include <qvaluelist.h>
7 7
8 8
9#include "osqlerror.h" 9#include "osqlerror.h"
10 10
11namespace Opie { 11namespace Opie {
12namespace DB { 12namespace DB {
13 13
14/** 14/**
15 * ResultItem represents one row of the resulting answer 15 * ResultItem represents one row of the resulting answer
16 */ 16 */
17class OSQLResultItem { 17class OSQLResultItem {
18public: 18public:
19 typedef QValueList<OSQLResultItem> ValueList; 19 typedef QValueList<OSQLResultItem> ValueList;
20 /** 20 /**
21 * TableString is used to establish the relations 21 * TableString is used to establish the relations
22 * between the column name and the real item 22 * between the column name and the real item
23 */ 23 */
24 typedef QMap<QString, QString> TableString; 24 typedef QMap<QString, QString> TableString;
25 25
26 /** 26 /**
27 * TableInt is used to establish a relation between a 27 * TableInt is used to establish a relation between a
28 * position of a column and the row value 28 * position of a column and the row value
29 */ 29 */
30 typedef QMap<int, QString> TableInt; 30 typedef QMap<int, QString> TableInt;
31 31
32 /** 32 /**
33 * Default c'tor. It has a TableString and a TableInt 33 * Default c'tor. It has a TableString and a TableInt
34 */ 34 */
35 OSQLResultItem(const TableString& = TableString(), 35 OSQLResultItem(const TableString& = TableString(),
36 const TableInt& = TableInt() ); 36 const TableInt& = TableInt() );
37 OSQLResultItem( const OSQLResultItem& ); 37 OSQLResultItem( const OSQLResultItem& );
38 ~OSQLResultItem(); 38 ~OSQLResultItem();
39 OSQLResultItem &operator=( const OSQLResultItem& ); 39 OSQLResultItem &operator=( const OSQLResultItem& );
40 /** 40 /**
41 * returns the TableString 41 * returns the TableString
42 */ 42 */
43 TableString tableString()const; 43 TableString tableString()const;
44 44
45 /** 45 /**
46 * returns the TableInt 46 * returns the TableInt
47 */ 47 */
48 TableInt tableInt() const; 48 TableInt tableInt() const;
49 49
50 /** 50 /**
51 * retrieves the Data from columnName 51 * retrieves the Data from columnName
52 * 52 *
53 */ 53 */
54 QString data( const QString& columnName, bool *ok = 0); 54 QString data( const QString& columnName, bool *ok = 0) const;
55 55
56 /** 56 /**
57 * QString for column number 57 * QString for column number
58 */ 58 */
59 QString data(int columnNumber, bool *ok = 0); 59 QString data(int columnNumber, bool *ok = 0) const;
60 60
61 /** 61 /**
62 * Date conversion from columnName 62 * Date conversion from columnName
63 */ 63 */
64 QDate dataToDate( const QString& columnName, bool *ok = 0 ); 64 QDate dataToDate( const QString& columnName, bool *ok = 0 );
65 65
66 /** 66 /**
67 * Date conversion from column-number 67 * Date conversion from column-number
68 */ 68 */
69 QDate dataToDate( int columnNumber, bool *ok = 0 ); 69 QDate dataToDate( int columnNumber, bool *ok = 0 );
70 70
71 QDateTime dataToDateTime( const QString& columName, bool *ok = 0 ); 71 QDateTime dataToDateTime( const QString& columName, bool *ok = 0 );
72 QDateTime dataToDateTime( int columnNumber, bool *ok = 0 ); 72 QDateTime dataToDateTime( int columnNumber, bool *ok = 0 );
73private: 73private:
74 TableString m_string; 74 TableString m_string;
75 TableInt m_int; 75 TableInt m_int;
76}; 76};
77 77
78/** 78/**
79 * the OSQLResult 79 * the OSQLResult
80 * either a SQL statement failed or succeeded 80 * either a SQL statement failed or succeeded
81 */ 81 */
82class OSQLResult { 82class OSQLResult {
83public: 83public:
84 /** The State of a Result */ 84 /** The State of a Result */
85 enum State{ Success = 0, Failure,Undefined }; 85 enum State{ Success = 0, Failure,Undefined };
86 86
87 /** 87 /**
88 * default c'tor 88 * default c'tor
89 * @param state The State of the Result 89 * @param state The State of the Result
90 * @param r ResultItems 90 * @param r ResultItems
91 * @prarm errors the Errors a OSQLResult created 91 * @prarm errors the Errors a OSQLResult created
92 */ 92 */
93 OSQLResult( enum State state = Undefined, 93 OSQLResult( enum State state = Undefined,
94 const OSQLResultItem::ValueList& r= OSQLResultItem::ValueList(), 94 const OSQLResultItem::ValueList& r= OSQLResultItem::ValueList(),
95 const OSQLError::ValueList& errors = OSQLError::ValueList() ); 95 const OSQLError::ValueList& errors = OSQLError::ValueList() );
96 ~OSQLResult(); 96 ~OSQLResult();
97 State state()const; 97 State state()const;
98 OSQLError::ValueList errors()const; 98 OSQLError::ValueList errors()const;
99 OSQLResultItem::ValueList results()const; 99 OSQLResultItem::ValueList results()const;
100 100
101 void setState( enum State state ); 101 void setState( enum State state );
102 void setErrors( const OSQLError::ValueList& error ); 102 void setErrors( const OSQLError::ValueList& error );
103 void setResults( const OSQLResultItem::ValueList& result ); 103 void setResults( const OSQLResultItem::ValueList& result );
104 104
105 OSQLResultItem first(); 105 OSQLResultItem first();
106 OSQLResultItem next(); 106 OSQLResultItem next();
107 bool atEnd(); 107 bool atEnd();
diff --git a/libopie2/opiepim/TODO b/libopie2/opiepim/TODO
index c3420cf..b520370 100644
--- a/libopie2/opiepim/TODO
+++ b/libopie2/opiepim/TODO
@@ -1,55 +1,56 @@
1As to popular request.... 1As to popular request....
2 2
31.) fix up the core/backend mess. 31.) fix up the core/backend mess.
4 The actual Backend Implementation + Interface should be there 4 The actual Backend Implementation + Interface should be there
5 The API frontend used by the developer should not be used 5 The API frontend used by the developer should not be used
6 6
7 Rename ODateBookAccess* to OPimDateBookAccess* 7 Rename ODateBookAccess* to OPimDateBookAccess*
8 Rename OContactAccess* to OpimContactAccess*
8 Fix filenames to OPim* ... 9 Fix filenames to OPim* ...
9 10
102.) Move sorting, Query By Example, Exposing of Attributes of a Record 112.) Move sorting, Query By Example, Exposing of Attributes of a Record
11 available to the Ptr base class and have sane implementation 12 available to the Ptr base class and have sane implementation
12 on the template level 13 on the template level
13 14
143.) Have something like QProperty to expose attributes from OPimRecord. 153.) Have something like QProperty to expose attributes from OPimRecord.
15 This would include exporting,importing of data, and translated names. 16 This would include exporting,importing of data, and translated names.
16 This can be used for Cross Reference, Selector Widget, Generic Table 17 This can be used for Cross Reference, Selector Widget, Generic Table
17 Shower 18 Shower
18 19
194.) Marshall/Demarshall all PIM Records correctly 204.) Marshall/Demarshall all PIM Records correctly
20 21
215.) Add the Private Backend to the OPimRecord ( private ) make the base 225.) Add the Private Backend to the OPimRecord ( private ) make the base
22 access class friend and allow retrieving the backend. Make it virtual 23 access class friend and allow retrieving the backend. Make it virtual
23 so the template gets the right pointer. So it can only be accessed from 24 so the template gets the right pointer. So it can only be accessed from
24 the inside 25 the inside
25 26
266.) Add signals for updating/adding/removing records to the access template 276.) Add signals for updating/adding/removing records to the access template
27 Internal connect method 28 Internal connect method
28 29
297.) internal QCOP communication between the interfaces 307.) internal QCOP communication between the interfaces
30 31
318.) GUI:Better and Improved Recurrence Widget 328.) GUI:Better and Improved Recurrence Widget
32 33
339.) GUI:Improved Alarm Widget and handling classes 349.) GUI:Improved Alarm Widget and handling classes
34 35
3510.) GUI:Undo/Redo template look at KDE 3610.) GUI:Undo/Redo template look at KDE
36 37
3711.) GUI: Generic X-Ref Selector using the factory and pointer interface 3811.) GUI: Generic X-Ref Selector using the factory and pointer interface
38 39
3912.) GUI: Factory and also registration of foreign services. generate a records of type 4012.) GUI: Factory and also registration of foreign services. generate a records of type
40 41
4113.) Multiple Backends for an Access Template 4213.) Multiple Backends for an Access Template
42 43
4314.) ReadOnly Access 4414.) ReadOnly Access
44 45
4515.) GUI: Generic Table Widget maybe even baed on Selector with 4615.) GUI: Generic Table Widget maybe even baed on Selector with
46 configuration of shown Attribute 47 configuration of shown Attribute
47 48
4816.) Multiple Categories with Sub Categories including popup selector 4916.) Multiple Categories with Sub Categories including popup selector
49 Widget. Fix Bug with changing visible. Both helper class + gui. 50 Widget. Fix Bug with changing visible. Both helper class + gui.
50 Also group PopupNames Like in Function Menu of XEmacs 51 Also group PopupNames Like in Function Menu of XEmacs
51 52
5217.) ListView for TodolIst At least introduce parents and child 5317.) ListView for TodolIst At least introduce parents and child
53 And query for them 54 And query for them
54 55
5518.) Add querieng to Ptr Level for dates and date ranges. 5618.) Add querieng to Ptr Level for dates and date ranges.