summaryrefslogtreecommitdiff
authoreilers <eilers>2004-05-16 15:24:11 (UTC)
committer eilers <eilers>2004-05-16 15:24:11 (UTC)
commit680c8c7a6db8f5b79a6541629f54465709b79b02 (patch) (unidiff)
tree9d9b4c0d913ba14ac73bf5339ce2f259a10b33fa
parent703b468052367682959f0e1494eec4b3d12754a8 (diff)
downloadopie-680c8c7a6db8f5b79a6541629f54465709b79b02.zip
opie-680c8c7a6db8f5b79a6541629f54465709b79b02.tar.gz
opie-680c8c7a6db8f5b79a6541629f54465709b79b02.tar.bz2
Opie PIM-Converter now uses the new OPimAccessFactory template..
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/pimconverter/converter.cpp69
1 files changed, 24 insertions, 45 deletions
diff --git a/noncore/tools/pimconverter/converter.cpp b/noncore/tools/pimconverter/converter.cpp
index 1091f4a..2bd47a4 100644
--- a/noncore/tools/pimconverter/converter.cpp
+++ b/noncore/tools/pimconverter/converter.cpp
@@ -9,17 +9,9 @@
9 9
10#include <opie2/ocontactaccess.h> 10#include <opie2/opimglobal.h>
11#include <opie2/ocontactaccessbackend_xml.h> 11// Include SQL related header files
12#include <opie2/ocontactaccessbackend_sql.h> 12#define __USE_SQL
13 13#include <opie2/opimaccessfactory.h>
14#include <opie2/otodoaccess.h>
15#include <opie2/otodoaccessxml.h>
16#include <opie2/otodoaccesssql.h>
17
18#include <opie2/odatebookaccess.h>
19#include <opie2/odatebookaccessbackend_xml.h>
20#include <opie2/odatebookaccessbackend_sql.h>
21
22// #define _ADDRESSBOOK_ACCESS
23 14
24using namespace Opie; 15using namespace Opie;
16using namespace Pim;
25 17
@@ -62,4 +54,3 @@ void Converter::start_conversion(){
62 case ADDRESSBOOK:{ 54 case ADDRESSBOOK:{
63 OPimContactAccessBackend* sourceBackend = new OPimContactAccessBackend_XML( "Converter", QString::null ); 55 sourceDB = OPimAccessFactory<OPimContactAccess>::create( OPimGlobal::CONTACTLIST, OPimGlobal::XML, "converter" );
64 sourceDB = new OPimContactAccess ( "addressbook_xml", QString::null , sourceBackend, true );
65 } 56 }
@@ -67,8 +58,6 @@ void Converter::start_conversion(){
67 case TODOLIST:{ 58 case TODOLIST:{
68 OPimTodoAccessBackend* sourceBackend = new OPimTodoAccessXML( "Converter" ); 59 sourceDB = OPimAccessFactory<OPimTodoAccess>::create( OPimGlobal::TODOLIST, OPimGlobal::XML, "converter" );
69 sourceDB = new OPimTodoAccess( sourceBackend );
70 }break; 60 }break;
71 case DATEBOOK:{ 61 case DATEBOOK:{
72 ODateBookAccessBackend_XML* sourceBackend = new ODateBookAccessBackend_XML( "Converter", QString::null ); 62 sourceDB = OPimAccessFactory<ODateBookAccess>::create( OPimGlobal::DATEBOOK, OPimGlobal::XML, "converter" );
73 sourceDB = new ODateBookAccess ( sourceBackend );
74 } 63 }
@@ -84,15 +73,11 @@ void Converter::start_conversion(){
84 case ADDRESSBOOK:{ 73 case ADDRESSBOOK:{
85 qDebug("SQLSourceDB = %d", m_selectedDatabase); 74 sourceDB = OPimAccessFactory<OPimContactAccess>::create( OPimGlobal::CONTACTLIST, OPimGlobal::SQL, "converter" );
86 OPimContactAccessBackend* sourceBackend = new OPimContactAccessBackend_SQL( QString::null, QString::null ); 75 }
87 sourceDB = new OPimContactAccess ( "Converter", QString::null, sourceBackend, true );
88 }
89 break; 76 break;
90 case TODOLIST:{ 77 case TODOLIST:{
91 OPimTodoAccessBackend* sourceBackend = new OPimTodoAccessBackendSQL( QString::null ); 78 sourceDB = OPimAccessFactory<OPimTodoAccess>::create( OPimGlobal::TODOLIST, OPimGlobal::SQL, "converter" );
92 sourceDB = new OPimTodoAccess( sourceBackend );
93 }break; 79 }break;
94 case DATEBOOK: { 80 case DATEBOOK:{
95 ODateBookAccessBackend_SQL* sourceBackend = new ODateBookAccessBackend_SQL( "Converter", QString::null ); 81 sourceDB = OPimAccessFactory<ODateBookAccess>::create( OPimGlobal::DATEBOOK, OPimGlobal::SQL, "converter" );
96 sourceDB = new ODateBookAccess ( sourceBackend ); 82 }
97 }
98 break; 83 break;
@@ -113,14 +98,11 @@ void Converter::start_conversion(){
113 case ADDRESSBOOK:{ 98 case ADDRESSBOOK:{
114 OPimContactAccessBackend* destBackend = new OPimContactAccessBackend_XML( "Converter", QString::null ); 99 destDB = OPimAccessFactory<OPimContactAccess>::create( OPimGlobal::CONTACTLIST, OPimGlobal::XML, "converter" );
115 destDB = new OPimContactAccess ( "Converter", QString::null , destBackend, true ); 100 }
116 }
117 break; 101 break;
118 case TODOLIST:{ 102 case TODOLIST:{
119 OPimTodoAccessBackend* destBackend = new OPimTodoAccessXML( "Converter" ); 103 destDB = OPimAccessFactory<OPimTodoAccess>::create( OPimGlobal::TODOLIST, OPimGlobal::XML, "converter" );
120 destDB = new OPimTodoAccess( destBackend );
121 }break; 104 }break;
122 case DATEBOOK:{ 105 case DATEBOOK:{
123 ODateBookAccessBackend_XML* destBackend = new ODateBookAccessBackend_XML( "Converter", QString::null ); 106 destDB = OPimAccessFactory<ODateBookAccess>::create( OPimGlobal::DATEBOOK, OPimGlobal::XML, "converter" );
124 destDB = new ODateBookAccess ( destBackend ); 107 }
125 }
126 break; 108 break;
@@ -135,14 +117,11 @@ void Converter::start_conversion(){
135 case ADDRESSBOOK:{ 117 case ADDRESSBOOK:{
136 OPimContactAccessBackend* destBackend = new OPimContactAccessBackend_SQL( QString::null, QString::null ); 118 destDB = OPimAccessFactory<OPimContactAccess>::create( OPimGlobal::CONTACTLIST, OPimGlobal::SQL, "converter" );
137 destDB = new OPimContactAccess ( "addressbook_xml", QString::null , destBackend, true ); 119 }
138 }
139 break; 120 break;
140 case TODOLIST:{ 121 case TODOLIST:{
141 OPimTodoAccessBackend* destBackend = new OPimTodoAccessBackendSQL( QString::null ); 122 destDB = OPimAccessFactory<OPimTodoAccess>::create( OPimGlobal::TODOLIST, OPimGlobal::SQL, "converter" );
142 destDB = new OPimTodoAccess( destBackend );
143 }break; 123 }break;
144 case DATEBOOK:{ 124 case DATEBOOK:{
145 ODateBookAccessBackend_SQL* destBackend = new ODateBookAccessBackend_SQL( "Converter", QString::null ); 125 destDB = OPimAccessFactory<ODateBookAccess>::create( OPimGlobal::DATEBOOK, OPimGlobal::SQL, "converter" );
146 destDB = new ODateBookAccess ( destBackend ); 126 }
147 }
148 break; 127 break;