author | eilers <eilers> | 2002-10-08 09:27:36 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-10-08 09:27:36 (UTC) |
commit | 21766cbcf4b4ca84da82a83f1b87d1366e75dd86 (patch) (side-by-side diff) | |
tree | 864f72273936128dd3db596e9e535165bf60a7fd | |
parent | f4559c166ae156b14a6cae518ede0496e83dad49 (diff) | |
download | opie-21766cbcf4b4ca84da82a83f1b87d1366e75dd86.zip opie-21766cbcf4b4ca84da82a83f1b87d1366e75dd86.tar.gz opie-21766cbcf4b4ca84da82a83f1b87d1366e75dd86.tar.bz2 |
Fixed libopie.pro to include the new pim-API.
The SQL-Stuff is currently deactivated. Otherwise everyone who wants to
compile itself would need to install libsqlite, libopiesql...
Therefore, the backend currently uses XML only..
-rw-r--r-- | libopie/libopie.pro | 42 | ||||
-rw-r--r-- | libopie/pim/obackendfactory.h | 15 | ||||
-rw-r--r-- | libopie/pim/otodoaccess.cpp | 9 | ||||
-rw-r--r-- | libopie2/opiepim/backend/obackendfactory.h | 15 | ||||
-rw-r--r-- | libopie2/opiepim/core/otodoaccess.cpp | 9 |
5 files changed, 72 insertions, 18 deletions
diff --git a/libopie/libopie.pro b/libopie/libopie.pro index 6a1f1b3..c99db9b 100644 --- a/libopie/libopie.pro +++ b/libopie/libopie.pro @@ -1,34 +1,60 @@ TEMPLATE = lib CONFIG += qte warn_on release -HEADERS = ofontmenu.h ofileselector.h \ - ofiledialog.h tododb.h \ - todoevent.h todoresource.h \ +HEADERS = ofontmenu.h \ + ofiledialog.h ofileselector.h tododb.h \ + ocheckitem.h todoevent.h todoresource.h \ todovcalresource.h xmltree.h \ colordialog.h colorpopupmenu.h \ oclickablelabel.h oprocctrl.h \ oprocess.h odevice.h \ otimepicker.h otabwidget.h \ otabbar.h otabinfo.h \ - ofontselector.h ocolorbutton.h -SOURCES = ofontmenu.cc ofileselector.cc \ - ofiledialog.cc xmltree.cc \ - tododb.cpp todoevent.cpp \ + ofontselector.h \ + pim/opimrecord.h \ + pim/otodo.h \ + pim/orecordlist.h \ + pim/opimaccesstemplate.h \ + pim/opimaccessbackend.h \ + pim/otodoaccess.h \ + pim/otodacessbackend.h \ + pim/ocontact.h \ + pim/ocontactaccess.h \ + pim/ocontactaccessbackend.h \ + pim/ocontactaccessbackend_xml.h \ + pim/obackendfactory.h +# pim/otodoaccesssql.h \ + +SOURCES = ofontmenu.cc \ + xmltree.cc \ + ofiledialog.cc ofileselector.cc \ + ocheckitem.cpp tododb.cpp todoevent.cpp \ todovcalresource.cpp colordialog.cpp \ colorpopupmenu.cpp oclickablelabel.cpp \ oprocctrl.cpp oprocess.cpp \ odevice.cpp otimepicker.cpp \ otabwidget.cpp otabbar.cpp \ - ofontselector.cpp ocolorbutton.cpp + ofontselector.cpp \ + pim/otodo.cpp \ + pim/opimrecord.cpp \ + pim/otodoaccess.cpp \ + pim/otodoaccessbackend.cpp \ + pim/otodoaccessxml.cpp \ + pim/ocontact.cpp \ + pim/ocontactaccess.cpp +# pim/otodoaccesssql.cpp \ + TARGET = opie INCLUDEPATH += $(OPIEDIR)/include DESTDIR = $(QTDIR)/lib$(PROJMAK) #VERSION = 1.0.0 +# LIBS += -lopiesql + INTERFACES = otimepickerbase.ui TRANSLATIONS = ../i18n/de/libopie.ts \ ../i18n/en/libopie.ts \ ../i18n/es/libopie.ts \ ../i18n/fr/libopie.ts \ ../i18n/hu/libopie.ts \ ../i18n/ja/libopie.ts \ diff --git a/libopie/pim/obackendfactory.h b/libopie/pim/obackendfactory.h index 599fbf2..f11f029 100644 --- a/libopie/pim/obackendfactory.h +++ b/libopie/pim/obackendfactory.h @@ -11,33 +11,41 @@ * version. * ===================================================================== * ToDo: Use plugins * ===================================================================== * Version: $Id$ * ===================================================================== * History: * $Log$ + * Revision 1.2 2002/10/08 09:27:36 eilers + * Fixed libopie.pro to include the new pim-API. + * The SQL-Stuff is currently deactivated. Otherwise everyone who wants to + * compile itself would need to install libsqlite, libopiesql... + * Therefore, the backend currently uses XML only.. + * * Revision 1.1 2002/10/07 17:35:01 eilers * added OBackendFactory for advanced backend access * * * ===================================================================== */ #ifndef __OPIE_BACKENDFACTORY_H_ #define __OPIE_BACKENDFACTORY_H_ #include <qstring.h> #include <qasciidict.h> #include <qpe/config.h> #include "otodoaccessxml.h" #include "ocontactaccessbackend_xml.h" -#include "otodoaccesssql.h" +#ifdef __USE_SQL +#include "otodoaccesssql.h" +#endif template<class T> class OBackendFactory { public: OBackendFactory() {}; enum BACKENDS { @@ -59,18 +67,23 @@ class OBackendFactory dict.insert( "todo", new int (TODO) ); dict.insert( "contact", new int (CONTACT) ); qWarning ("TODO is: %d", TODO); qWarning ("CONTACT is: %d", CONTACT); switch ( *dict.take( backendName ) ){ case TODO: +#ifdef __USE_SQL if ( backend == "sql" ) return (T*) new OTodoAccessBackendSQL(""); +#else + if ( backend == "sql" ) + qWarning ("OBackendFactory:: sql Backend not implemented! Using XML instead!"); +#endif return (T*) new OTodoAccessXML( appName ); case CONTACT: if ( backend == "sql" ) qWarning ("OBackendFactory:: sql Backend not implemented! Using XML instead!"); return (T*) new OContactAccessBackend_XML( appName ); case DATE: diff --git a/libopie/pim/otodoaccess.cpp b/libopie/pim/otodoaccess.cpp index 4468812..80424d9 100644 --- a/libopie/pim/otodoaccess.cpp +++ b/libopie/pim/otodoaccess.cpp @@ -4,21 +4,22 @@ #include "otodoaccesssql.h" #include "otodoaccess.h" #include "obackendfactory.h" OTodoAccess::OTodoAccess( OTodoAccessBackend* end ) : QObject(), OPimAccessTemplate<OTodo>( end ), m_todoBackEnd( end ) { - if (end == 0l ) - m_todoBackEnd = new OTodoAccessBackendSQL( QString::null); - // if (end == 0l ) - // m_todoBackEnd = OBackendFactory<OTodoAccessBackend>::Default ("todo", QString::null); +// m_todoBackEnd = new OTodoAccessBackendSQL( QString::null); + + // Zecke: Du musst hier noch für das XML-Backend einen Appnamen übergeben ! + if (end == 0l ) + m_todoBackEnd = OBackendFactory<OTodoAccessBackend>::Default ("todo", QString::null); setBackEnd( m_todoBackEnd ); } OTodoAccess::~OTodoAccess() { // qWarning("~OTodoAccess"); } void OTodoAccess::mergeWith( const QValueList<OTodo>& list ) { QValueList<OTodo>::ConstIterator it; diff --git a/libopie2/opiepim/backend/obackendfactory.h b/libopie2/opiepim/backend/obackendfactory.h index 599fbf2..f11f029 100644 --- a/libopie2/opiepim/backend/obackendfactory.h +++ b/libopie2/opiepim/backend/obackendfactory.h @@ -11,33 +11,41 @@ * version. * ===================================================================== * ToDo: Use plugins * ===================================================================== * Version: $Id$ * ===================================================================== * History: * $Log$ + * Revision 1.2 2002/10/08 09:27:36 eilers + * Fixed libopie.pro to include the new pim-API. + * The SQL-Stuff is currently deactivated. Otherwise everyone who wants to + * compile itself would need to install libsqlite, libopiesql... + * Therefore, the backend currently uses XML only.. + * * Revision 1.1 2002/10/07 17:35:01 eilers * added OBackendFactory for advanced backend access * * * ===================================================================== */ #ifndef __OPIE_BACKENDFACTORY_H_ #define __OPIE_BACKENDFACTORY_H_ #include <qstring.h> #include <qasciidict.h> #include <qpe/config.h> #include "otodoaccessxml.h" #include "ocontactaccessbackend_xml.h" -#include "otodoaccesssql.h" +#ifdef __USE_SQL +#include "otodoaccesssql.h" +#endif template<class T> class OBackendFactory { public: OBackendFactory() {}; enum BACKENDS { @@ -59,18 +67,23 @@ class OBackendFactory dict.insert( "todo", new int (TODO) ); dict.insert( "contact", new int (CONTACT) ); qWarning ("TODO is: %d", TODO); qWarning ("CONTACT is: %d", CONTACT); switch ( *dict.take( backendName ) ){ case TODO: +#ifdef __USE_SQL if ( backend == "sql" ) return (T*) new OTodoAccessBackendSQL(""); +#else + if ( backend == "sql" ) + qWarning ("OBackendFactory:: sql Backend not implemented! Using XML instead!"); +#endif return (T*) new OTodoAccessXML( appName ); case CONTACT: if ( backend == "sql" ) qWarning ("OBackendFactory:: sql Backend not implemented! Using XML instead!"); return (T*) new OContactAccessBackend_XML( appName ); case DATE: diff --git a/libopie2/opiepim/core/otodoaccess.cpp b/libopie2/opiepim/core/otodoaccess.cpp index 4468812..80424d9 100644 --- a/libopie2/opiepim/core/otodoaccess.cpp +++ b/libopie2/opiepim/core/otodoaccess.cpp @@ -4,21 +4,22 @@ #include "otodoaccesssql.h" #include "otodoaccess.h" #include "obackendfactory.h" OTodoAccess::OTodoAccess( OTodoAccessBackend* end ) : QObject(), OPimAccessTemplate<OTodo>( end ), m_todoBackEnd( end ) { - if (end == 0l ) - m_todoBackEnd = new OTodoAccessBackendSQL( QString::null); - // if (end == 0l ) - // m_todoBackEnd = OBackendFactory<OTodoAccessBackend>::Default ("todo", QString::null); +// m_todoBackEnd = new OTodoAccessBackendSQL( QString::null); + + // Zecke: Du musst hier noch für das XML-Backend einen Appnamen übergeben ! + if (end == 0l ) + m_todoBackEnd = OBackendFactory<OTodoAccessBackend>::Default ("todo", QString::null); setBackEnd( m_todoBackEnd ); } OTodoAccess::~OTodoAccess() { // qWarning("~OTodoAccess"); } void OTodoAccess::mergeWith( const QValueList<OTodo>& list ) { QValueList<OTodo>::ConstIterator it; |