author | eilers <eilers> | 2003-09-29 07:41:45 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-09-29 07:41:45 (UTC) |
commit | b2e22408970ef548e23e9bbdcd87302f35fc6d4d (patch) (side-by-side diff) | |
tree | 9dd613f64fb333c3591a4aa2b080d1e9e984cddd /libopie/pim/test/converter.cpp | |
parent | 33a64fac931c3332bce9fb97e9996dc0e4c9d236 (diff) | |
download | opie-b2e22408970ef548e23e9bbdcd87302f35fc6d4d.zip opie-b2e22408970ef548e23e9bbdcd87302f35fc6d4d.tar.gz opie-b2e22408970ef548e23e9bbdcd87302f35fc6d4d.tar.bz2 |
Starting to develop a universal PIM-database converter
Diffstat (limited to 'libopie/pim/test/converter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/pim/test/converter.cpp | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/libopie/pim/test/converter.cpp b/libopie/pim/test/converter.cpp index 0a488f2..650d119 100644 --- a/libopie/pim/test/converter.cpp +++ b/libopie/pim/test/converter.cpp @@ -1 +1,6 @@ +#include "converter.h" + +#include <qdatetime.h> +#include <qprogressbar.h> + #include <qpe/qpeapplication.h> @@ -6,17 +11,6 @@ -#include "converter_base.h" - -class ConvertXMLToSQL: public converter_base { -public: - ConvertXMLToSQL() - { - convertContact(); - } -private: - void convertContact(); - -}; - +Converter::Converter(){ +} -void ConvertXMLToSQL::convertContact(){ +void Converter::start_conversion(){ qWarning("Converting Contacts from XML to SQL.."); @@ -36,2 +30,5 @@ void ConvertXMLToSQL::convertContact(){ + QTime t; + t.start(); + // Clean the sql-database.. @@ -41,6 +38,10 @@ void ConvertXMLToSQL::convertContact(){ OContactAccess::List contactList = xmlAccess->allRecords(); + m_progressBar->setTotalSteps( contactList.count() ); + int count = 0; if ( sqlAccess && xmlAccess ){ OContactAccess::List::Iterator it; - for ( it = contactList.begin(); it != contactList.end(); ++it ) + for ( it = contactList.begin(); it != contactList.end(); ++it ){ sqlAccess->add( *it ); + m_progressBar->setProgress( ++count ); + } } @@ -49,2 +50,5 @@ void ConvertXMLToSQL::convertContact(){ delete sqlAccess; + + qWarning("Conversion is finished and needed %d ms !", t.elapsed()); + delete xmlAccess; @@ -56,3 +60,3 @@ int main( int argc, char** argv ) { - ConvertXMLToSQL dlg; + Converter dlg; |