author | eilers <eilers> | 2004-08-29 12:42:03 (UTC) |
---|---|---|
committer | eilers <eilers> | 2004-08-29 12:42:03 (UTC) |
commit | dd159675e6e3c361bc20eaa6994265e73b6599ef (patch) (unidiff) | |
tree | 70cf91b669307ae39e020ce4257b60b2de9acd42 | |
parent | 496157cb35b8f90e73770fc43c9a63534baebf33 (diff) | |
download | opie-dd159675e6e3c361bc20eaa6994265e73b6599ef.zip opie-dd159675e6e3c361bc20eaa6994265e73b6599ef.tar.gz opie-dd159675e6e3c361bc20eaa6994265e73b6599ef.tar.bz2 |
Minor but important changes in API. Improved SQL performance: contactsbackend now
supports look-ahead caching to speed up access.
Fixed and improved look-ahead cache in todo-backend.
Datebook backend will follow, soon !
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiedb/osqlresult.cpp | 8 | ||||
-rw-r--r-- | libopie2/opiedb/osqlresult.h | 4 | ||||
-rw-r--r-- | libopie2/opiepim/TODO | 1 |
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 | |||
@@ -752,19 +752,22 @@ void 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 | ||
756 | void ODevice::playingStopped() { | 756 | void 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 | ||
764 | void ODevice::changeMixerForAlarm( int mixer, const char* file, Sound *snd ) { | 766 | void 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 ); |
@@ -776,10 +779,11 @@ void ODevice::changeMixerForAlarm( int mixer, const char* file, Sound *snd ) { | |||
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 | |||
@@ -22,27 +22,27 @@ OSQLResultItem &OSQLResultItem::operator=( const OSQLResultItem& other) { | |||
22 | OSQLResultItem::TableString OSQLResultItem::tableString()const{ | 22 | OSQLResultItem::TableString OSQLResultItem::tableString()const{ |
23 | return m_string; | 23 | return m_string; |
24 | } | 24 | } |
25 | OSQLResultItem::TableInt OSQLResultItem::tableInt()const { | 25 | OSQLResultItem::TableInt OSQLResultItem::tableInt()const { |
26 | return m_int; | 26 | return m_int; |
27 | } | 27 | } |
28 | QString OSQLResultItem::data( const QString& columnName, bool *ok ) { | 28 | QString 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 | } |
41 | QString OSQLResultItem::data( int column, bool *ok ) { | 41 | QString 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{ |
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 | |||
@@ -48,18 +48,18 @@ public: | |||
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 | ||
diff --git a/libopie2/opiepim/TODO b/libopie2/opiepim/TODO index c3420cf..b520370 100644 --- a/libopie2/opiepim/TODO +++ b/libopie2/opiepim/TODO | |||
@@ -2,12 +2,13 @@ As to popular request.... | |||
2 | 2 | ||
3 | 1.) fix up the core/backend mess. | 3 | 1.) 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 | ||
10 | 2.) Move sorting, Query By Example, Exposing of Attributes of a Record | 11 | 2.) 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 | ||