summaryrefslogtreecommitdiff
Unidiff
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
@@ -8,19 +8,11 @@
8#include <qpe/qpeapplication.h> 8#include <qpe/qpeapplication.h>
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
26Converter::Converter(): 18Converter::Converter():
@@ -61,15 +53,12 @@ void Converter::start_conversion(){
61 switch( m_selectedDatabase ){ 53 switch( m_selectedDatabase ){
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 }
66 break; 57 break;
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 }
75 break; 64 break;
@@ -83,17 +72,13 @@ void Converter::start_conversion(){
83 switch( m_selectedDatabase ){ 72 switch( m_selectedDatabase ){
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;
99 default: 84 default:
@@ -112,16 +97,13 @@ void Converter::start_conversion(){
112 switch( m_selectedDatabase ){ 97 switch( m_selectedDatabase ){
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;
127 default: 109 default:
@@ -134,16 +116,13 @@ void Converter::start_conversion(){
134 switch( m_selectedDatabase ){ 116 switch( m_selectedDatabase ){
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;
149 default: 128 default: