author | zecke <zecke> | 2002-11-30 11:28:47 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-11-30 11:28:47 (UTC) |
commit | 9b8b30fa6cbdf1424b29cde21fae112e8bf96e6d (patch) (unidiff) | |
tree | 896dd858dc2ec2f0b7e1b265cae66ccceecc82da /libopie2/opiepim/core/opimaccesstemplate.h | |
parent | 599c58c6ab2ab936890cbbfa4e6299493c141f8a (diff) | |
download | opie-9b8b30fa6cbdf1424b29cde21fae112e8bf96e6d.zip opie-9b8b30fa6cbdf1424b29cde21fae112e8bf96e6d.tar.gz opie-9b8b30fa6cbdf1424b29cde21fae112e8bf96e6d.tar.bz2 |
More infrastructure
ORecur has now the nextOccurence function
exceptions
We've now Notifers like Alarms and DatebookEntries
we may add to execute applications...
AppName replaced with service cause it is a service
Add rtti to OPimRecord as a static function
This is used inside the BackEnd classes to static_cast...
added removeAllCompleted to the todobackends...
add a common Opie PIM mainwindow which takes care of some simple
scripting enchangements..
much more
Diffstat (limited to 'libopie2/opiepim/core/opimaccesstemplate.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimaccesstemplate.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h index 6de68b1..8cf81c8 100644 --- a/libopie2/opiepim/core/opimaccesstemplate.h +++ b/libopie2/opiepim/core/opimaccesstemplate.h | |||
@@ -90,12 +90,13 @@ public: | |||
90 | /** | 90 | /** |
91 | * add T to the backend | 91 | * add T to the backend |
92 | * @param t The item to add. | 92 | * @param t The item to add. |
93 | * @return <i>true</i> if added successfully. | 93 | * @return <i>true</i> if added successfully. |
94 | */ | 94 | */ |
95 | virtual bool add( const T& t ) ; | 95 | virtual bool add( const T& t ) ; |
96 | bool add( const OPimRecord& ); | ||
96 | 97 | ||
97 | /* only the uid matters */ | 98 | /* only the uid matters */ |
98 | /** | 99 | /** |
99 | * remove T from the backend | 100 | * remove T from the backend |
100 | * @param t The item to remove | 101 | * @param t The item to remove |
101 | * @return <i>true</i> if successful. | 102 | * @return <i>true</i> if successful. |
@@ -209,12 +210,21 @@ void OPimAccessTemplate<T>::clear() { | |||
209 | template <class T> | 210 | template <class T> |
210 | bool OPimAccessTemplate<T>::add( const T& t ) { | 211 | bool OPimAccessTemplate<T>::add( const T& t ) { |
211 | cache( t ); | 212 | cache( t ); |
212 | return m_backEnd->add( t ); | 213 | return m_backEnd->add( t ); |
213 | } | 214 | } |
214 | template <class T> | 215 | template <class T> |
216 | bool OPimAccessTemplate<T>::add( const OPimRecord& rec) { | ||
217 | /* same type */ | ||
218 | if ( rec.rtti() == T::rtti() ) { | ||
219 | const T &t = static_cast<const T&>(rec); | ||
220 | return add(t); | ||
221 | } | ||
222 | return false; | ||
223 | } | ||
224 | template <class T> | ||
215 | bool OPimAccessTemplate<T>::remove( const T& t ) { | 225 | bool OPimAccessTemplate<T>::remove( const T& t ) { |
216 | return remove( t.uid() ); | 226 | return remove( t.uid() ); |
217 | } | 227 | } |
218 | template <class T> | 228 | template <class T> |
219 | bool OPimAccessTemplate<T>::remove( int uid ) { | 229 | bool OPimAccessTemplate<T>::remove( int uid ) { |
220 | m_cache.remove( uid ); | 230 | m_cache.remove( uid ); |