summaryrefslogtreecommitdiff
path: root/libopie2/opiepim
Unidiff
Diffstat (limited to 'libopie2/opiepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/obackendfactory.h2
-rw-r--r--libopie2/opiepim/core/ocontactaccess.cpp2
-rw-r--r--libopie2/opiepim/core/odatebookaccess.cpp2
-rw-r--r--libopie2/opiepim/core/opimaccessfactory.h2
-rw-r--r--libopie2/opiepim/core/otodoaccess.cpp2
5 files changed, 5 insertions, 5 deletions
diff --git a/libopie2/opiepim/backend/obackendfactory.h b/libopie2/opiepim/backend/obackendfactory.h
index 993ecb4..4daf861 100644
--- a/libopie2/opiepim/backend/obackendfactory.h
+++ b/libopie2/opiepim/backend/obackendfactory.h
@@ -169,25 +169,25 @@ class OBackendFactory
169 return OPimGlobal::UNKNOWN; 169 return OPimGlobal::UNKNOWN;
170 170
171 return (OPimGlobal::DatabaseStyle) *db_find; 171 return (OPimGlobal::DatabaseStyle) *db_find;
172 } 172 }
173 173
174 174
175 /** 175 /**
176 * Returns the default backend implementation for backendName. Which one is used, is defined 176 * Returns the default backend implementation for backendName. Which one is used, is defined
177 * by the configfile "pimaccess.conf". 177 * by the configfile "pimaccess.conf".
178 * @param backendName the type of the backend (use "todo", "contact" or "datebook" ) 178 * @param backendName the type of the backend (use "todo", "contact" or "datebook" )
179 * @param appName The name of your application. It will be passed on to the backend 179 * @param appName The name of your application. It will be passed on to the backend
180 */ 180 */
181 static T* Default( const QString backendName, const QString& appName ){ 181 static T* defaultBackend( const QString backendName, const QString& appName ){
182 182
183 QAsciiDict<int> dictBackends( OPimGlobal::_END_PimType ); 183 QAsciiDict<int> dictBackends( OPimGlobal::_END_PimType );
184 dictBackends.setAutoDelete ( TRUE ); 184 dictBackends.setAutoDelete ( TRUE );
185 185
186 dictBackends.insert( "todo", new int (OPimGlobal::TODOLIST) ); 186 dictBackends.insert( "todo", new int (OPimGlobal::TODOLIST) );
187 dictBackends.insert( "contact", new int (OPimGlobal::CONTACTLIST) ); 187 dictBackends.insert( "contact", new int (OPimGlobal::CONTACTLIST) );
188 dictBackends.insert( "datebook", new int(OPimGlobal::DATEBOOK) ); 188 dictBackends.insert( "datebook", new int(OPimGlobal::DATEBOOK) );
189 189
190 int* backend_find = dictBackends[ backendName ]; 190 int* backend_find = dictBackends[ backendName ];
191 if ( !backend_find ) return NULL; 191 if ( !backend_find ) return NULL;
192 192
193 OPimGlobal::DatabaseStyle style = defaultDB( static_cast<OPimGlobal::PimType>( *backend_find ) ); 193 OPimGlobal::DatabaseStyle style = defaultDB( static_cast<OPimGlobal::PimType>( *backend_find ) );
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp
index 67f267f..417a954 100644
--- a/libopie2/opiepim/core/ocontactaccess.cpp
+++ b/libopie2/opiepim/core/ocontactaccess.cpp
@@ -56,25 +56,25 @@
56 56
57namespace Opie { 57namespace Opie {
58 58
59OPimContactAccess::OPimContactAccess ( const QString appname, const QString , 59OPimContactAccess::OPimContactAccess ( const QString appname, const QString ,
60 OPimContactAccessBackend* end, bool autosync ): 60 OPimContactAccessBackend* end, bool autosync ):
61 OPimAccessTemplate<OPimContact>( end ) 61 OPimAccessTemplate<OPimContact>( end )
62{ 62{
63 /* take care of the backend. If there is no one defined, we 63 /* take care of the backend. If there is no one defined, we
64 * will use the XML-Backend as default (until we have a cute SQL-Backend..). 64 * will use the XML-Backend as default (until we have a cute SQL-Backend..).
65 */ 65 */
66 if( end == 0 ) { 66 if( end == 0 ) {
67 qWarning ("Using BackendFactory !"); 67 qWarning ("Using BackendFactory !");
68 end = OBackendFactory<OPimContactAccessBackend>::Default( "contact", appname ); 68 end = OBackendFactory<OPimContactAccessBackend>::defaultBackend( "contact", appname );
69 } 69 }
70 // Set backend locally and in template 70 // Set backend locally and in template
71 m_backEnd = end; 71 m_backEnd = end;
72 OPimAccessTemplate<OPimContact>::setBackEnd (end); 72 OPimAccessTemplate<OPimContact>::setBackEnd (end);
73 73
74 74
75 /* Connect signal of external db change to function */ 75 /* Connect signal of external db change to function */
76 QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this ); 76 QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this );
77 connect( dbchannel, SIGNAL(received(const QCString&,const QByteArray&)), 77 connect( dbchannel, SIGNAL(received(const QCString&,const QByteArray&)),
78 this, SLOT(copMessage(const QCString&,const QByteArray&)) ); 78 this, SLOT(copMessage(const QCString&,const QByteArray&)) );
79 if ( autosync ){ 79 if ( autosync ){
80 QCopChannel *syncchannel = new QCopChannel( "QPE/Sync", this ); 80 QCopChannel *syncchannel = new QCopChannel( "QPE/Sync", this );
diff --git a/libopie2/opiepim/core/odatebookaccess.cpp b/libopie2/opiepim/core/odatebookaccess.cpp
index 29298ea..5f471cf 100644
--- a/libopie2/opiepim/core/odatebookaccess.cpp
+++ b/libopie2/opiepim/core/odatebookaccess.cpp
@@ -33,25 +33,25 @@
33namespace Opie { 33namespace Opie {
34/** 34/**
35 * Simple constructor 35 * Simple constructor
36 * It takes a ODateBookAccessBackend as parent. If it is 0 the default implementation 36 * It takes a ODateBookAccessBackend as parent. If it is 0 the default implementation
37 * will be used! 37 * will be used!
38 * @param back The backend to be used or 0 for the default backend 38 * @param back The backend to be used or 0 for the default backend
39 * @param ac What kind of access is intended 39 * @param ac What kind of access is intended
40 */ 40 */
41ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ac ) 41ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ac )
42 : OPimAccessTemplate<OPimEvent>( back ) 42 : OPimAccessTemplate<OPimEvent>( back )
43{ 43{
44 if (!back ) 44 if (!back )
45 back = OBackendFactory<ODateBookAccessBackend>::Default("datebook", QString::null ); 45 back = OBackendFactory<ODateBookAccessBackend>::defaultBackend("datebook", QString::null );
46 46
47 m_backEnd = back; 47 m_backEnd = back;
48 setBackEnd( m_backEnd ); 48 setBackEnd( m_backEnd );
49} 49}
50ODateBookAccess::~ODateBookAccess() { 50ODateBookAccess::~ODateBookAccess() {
51} 51}
52 52
53/** 53/**
54 * @return all events available 54 * @return all events available
55 */ 55 */
56ODateBookAccess::List ODateBookAccess::rawEvents()const { 56ODateBookAccess::List ODateBookAccess::rawEvents()const {
57 QArray<int> ints = m_backEnd->rawEvents(); 57 QArray<int> ints = m_backEnd->rawEvents();
diff --git a/libopie2/opiepim/core/opimaccessfactory.h b/libopie2/opiepim/core/opimaccessfactory.h
index 7d32958..6aaa5e4 100644
--- a/libopie2/opiepim/core/opimaccessfactory.h
+++ b/libopie2/opiepim/core/opimaccessfactory.h
@@ -95,23 +95,23 @@ class OPimAccessFactory
95 95
96 /** 96 /**
97 * Returns the selected PIM access-object, using the default database style 97 * Returns the selected PIM access-object, using the default database style
98 * Which style is selected is defined in the configfile "pimaccess.conf" in 98 * Which style is selected is defined in the configfile "pimaccess.conf" in
99 * the directory "Settings" 99 * the directory "Settings"
100 * @param type Type of the selected database (addressbook, todolist or datebook) 100 * @param type Type of the selected database (addressbook, todolist or datebook)
101 * @param appName "Name" of your application. This should be any constant string which is used 101 * @param appName "Name" of your application. This should be any constant string which is used
102 * by some backends for creating special files (i.e.journal files). Please keep the 102 * by some backends for creating special files (i.e.journal files). Please keep the
103 * string unique for your application ! 103 * string unique for your application !
104 * @see OPimGlobal 104 * @see OPimGlobal
105 * 105 *
106 */ 106 */
107 static T* Default( typename OPimGlobal::PimType type, const QString& appName ){ 107 static T* defaultAccess( typename OPimGlobal::PimType type, const QString& appName ){
108 108
109 return create( type, OPimGlobal::DEFAULT, appName ); 109 return create( type, OPimGlobal::DEFAULT, appName );
110 110
111 } 111 }
112}; 112};
113 113
114} 114}
115 115
116 116
117#endif 117#endif
diff --git a/libopie2/opiepim/core/otodoaccess.cpp b/libopie2/opiepim/core/otodoaccess.cpp
index 6fa0089..87a211f 100644
--- a/libopie2/opiepim/core/otodoaccess.cpp
+++ b/libopie2/opiepim/core/otodoaccess.cpp
@@ -35,25 +35,25 @@
35#include <opie2/obackendfactory.h> 35#include <opie2/obackendfactory.h>
36#include <opie2/opimresolver.h> 36#include <opie2/opimresolver.h>
37 37
38namespace Opie { 38namespace Opie {
39OPimTodoAccess::OPimTodoAccess( OPimTodoAccessBackend* end, enum Access ) 39OPimTodoAccess::OPimTodoAccess( OPimTodoAccessBackend* end, enum Access )
40 : QObject(), OPimAccessTemplate<OPimTodo>( end ), m_todoBackEnd( end ) 40 : QObject(), OPimAccessTemplate<OPimTodo>( end ), m_todoBackEnd( end )
41{ 41{
42// if (end == 0l ) 42// if (end == 0l )
43// m_todoBackEnd = new OPimTodoAccessBackendSQL( QString::null); 43// m_todoBackEnd = new OPimTodoAccessBackendSQL( QString::null);
44 44
45 // Zecke: Du musst hier noch fr das XML-Backend einen Appnamen bergeben ! 45 // Zecke: Du musst hier noch fr das XML-Backend einen Appnamen bergeben !
46 if (end == 0l ) 46 if (end == 0l )
47 m_todoBackEnd = OBackendFactory<OPimTodoAccessBackend>::Default ("todo", QString::null); 47 m_todoBackEnd = OBackendFactory<OPimTodoAccessBackend>::defaultBackend ("todo", QString::null);
48 48
49 setBackEnd( m_todoBackEnd ); 49 setBackEnd( m_todoBackEnd );
50} 50}
51OPimTodoAccess::~OPimTodoAccess() { 51OPimTodoAccess::~OPimTodoAccess() {
52// qWarning("~OPimTodoAccess"); 52// qWarning("~OPimTodoAccess");
53} 53}
54void OPimTodoAccess::mergeWith( const QValueList<OPimTodo>& list ) { 54void OPimTodoAccess::mergeWith( const QValueList<OPimTodo>& list ) {
55 QValueList<OPimTodo>::ConstIterator it; 55 QValueList<OPimTodo>::ConstIterator it;
56 for ( it = list.begin(); it != list.end(); ++it ) { 56 for ( it = list.begin(); it != list.end(); ++it ) {
57 replace( (*it) ); 57 replace( (*it) );
58 } 58 }
59} 59}