Diffstat (limited to 'core/pim/datebook2/managertemplate.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook2/managertemplate.h | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/core/pim/datebook2/managertemplate.h b/core/pim/datebook2/managertemplate.h index cdf121d..72fab3a 100644 --- a/core/pim/datebook2/managertemplate.h +++ b/core/pim/datebook2/managertemplate.h @@ -13,5 +13,5 @@ namespace Datebook { template<class T> class ManagerTemplate { - typedef typename QMap<QString, T>::Iterator Iterator; + typedef typename QMap<QString, T>::ConstIterator Iterator; public: ManagerTemplate(); @@ -20,17 +20,12 @@ namespace Datebook { virtual void add( const QString&, const T& t ); void remove( const QString& ); - bool load(); - bool save(); + virtual bool load() = 0; + virtual bool save() = 0; - QStringList names(); + QStringList names()const; T value(const QString&)const; protected: QMap<QString, T> m_map; - - private: - virtual bool doSave() = 0; - virtual bool doLoad() = 0; - }; template<class T> @@ -49,13 +44,5 @@ namespace Datebook { } template<class T> - bool ManagerTemplate<T>::load() { - return doLoad(); - } - template<class T> - bool ManagerTemplate<T>::save() { - return doSave(); - } - template<class T> - QStringList ManagerTemplate<T>::names() { + QStringList ManagerTemplate<T>::names()const { QStringList lst; Iterator it; |