From ea3945a9bd8f9830f70b1efa133f9df13b19362f Mon Sep 17 00:00:00 2001 From: mickeyl Date: Tue, 16 Nov 2004 19:14:18 +0000 Subject: libopie1 goes into unsupported --- (limited to 'libopie/pim/test') diff --git a/libopie/pim/test/converter.cpp b/libopie/pim/test/converter.cpp deleted file mode 100644 index bfdb605..0000000 --- a/libopie/pim/test/converter.cpp +++ b/dev/null @@ -1,107 +0,0 @@ -#include "converter.h" - -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include - -// #define _ADDRESSBOOK_ACCESS - -Converter::Converter(){ -} - -void Converter::start_conversion(){ - qWarning("Converting Contacts from XML to SQL.."); - - // Creating backends to the requested databases.. - -#ifdef _ADDRESSBOOK_ACCESS - OContactAccessBackend* xmlBackend = new OContactAccessBackend_XML( "Converter", - QString::null ); - - OContactAccessBackend* sqlBackend = new OContactAccessBackend_SQL( QString::null, - QString::null ); - // Put the created backends into frontends to access them - OContactAccess* xmlAccess = new OContactAccess ( "addressbook_xml", - QString::null , xmlBackend, true ); - - OContactAccess* sqlAccess = new OContactAccess ( "addressbook_sql", - QString::null ); - -#else - ODateBookAccessBackend* xmlBackend = new ODateBookAccessBackend_XML( "Converter", - QString::null ); - - ODateBookAccessBackend* sqlBackend = new ODateBookAccessBackend_SQL( QString::null, - QString::null ); - // Put the created backends into frontends to access them - ODateBookAccess* xmlAccess = new ODateBookAccess ( xmlBackend ); - - ODateBookAccess* sqlAccess = new ODateBookAccess ( sqlBackend ); - - xmlAccess->load(); - -#endif - - QTime t; - t.start(); - -// Clean the sql-database.. - sqlAccess->clear(); - -#ifdef _ADDRESSBOOK_ACCESS - // Now trasmit every contact from the xml database to the sql-database - 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 ){ - sqlAccess->add( *it ); - m_progressBar->setProgress( ++count ); - } - } -#else - // Now transmit every contact from the xml database to the sql-database - ODateBookAccess::List dateList = xmlAccess->allRecords(); - m_progressBar->setTotalSteps( dateList.count() ); - qWarning( "Number of elements to copy: %d", dateList.count() ); - - int count = 0; - if ( sqlAccess && xmlAccess ){ - ODateBookAccess::List::Iterator it; - for ( it = dateList.begin(); it != dateList.end(); ++it ){ - sqlAccess->add( *it ); - m_progressBar->setProgress( ++count ); - } - } - -#endif - // Delete the frontends. Backends will be deleted automatically, too ! - delete sqlAccess; - - qWarning("Conversion is finished and needed %d ms !", t.elapsed()); - - delete xmlAccess; -} - -int main( int argc, char** argv ) { - - QPEApplication a( argc, argv ); - - Converter dlg; - - a.showMainWidget( &dlg ); - // dlg. showMaximized ( ); - - return a.exec(); - -} diff --git a/libopie/pim/test/converter.h b/libopie/pim/test/converter.h deleted file mode 100755 index 1cc2a7c..0000000 --- a/libopie/pim/test/converter.h +++ b/dev/null @@ -1,18 +0,0 @@ -#ifndef _CONVERTER_H_ -#define _CONVERTER_H_ - - -#include "converter_base.h" - - -class Converter: public converter_base { -public: - Converter(); - - void start_conversion(); -private: - -}; - - -#endif diff --git a/libopie/pim/test/converter.pro b/libopie/pim/test/converter.pro deleted file mode 100644 index bd9c7a3..0000000 --- a/libopie/pim/test/converter.pro +++ b/dev/null @@ -1,12 +0,0 @@ -# TEMPLATE = app -CONFIG = qt warn_on debug -# CONFIG = qt warn_on release -#HEADERS = -SOURCES = converter.cpp -INTERFACES = converter_base.ui -INCLUDEPATH += $(OPIEDIR)/include -DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopie -TARGET = converter - -include ( $(OPIEDIR)/include.pro ) diff --git a/libopie/pim/test/converter_base.ui b/libopie/pim/test/converter_base.ui deleted file mode 100644 index e9bf636..0000000 --- a/libopie/pim/test/converter_base.ui +++ b/dev/null @@ -1,238 +0,0 @@ - -converter_base - - QDialog - - name - converter_base - - - geometry - - 0 - 0 - 273 - 324 - - - - caption - PIM-Database Converter - - - layoutMargin - - - - margin - 4 - - - spacing - 6 - - - QGroupBox - - name - GroupBox6 - - - title - Converter - - - layoutMargin - - - layoutSpacing - - - - margin - 4 - - - spacing - 4 - - - QGroupBox - - name - GroupBox1 - - - title - Select Database: - - - - margin - 11 - - - spacing - 6 - - - QComboBox - - - text - Addressbook - - - - - text - TodoList - - - - name - ComboBox1 - - - - - - QGroupBox - - name - GroupBox2 - - - title - Source/Destination: - - - - margin - 11 - - - spacing - 6 - - - QLabel - - name - TextLabel3_2 - - - text - to - - - - QComboBox - - - text - Select - - - - - text - XML - - - - - text - SQL (SQLite) - - - - name - ComboBox2_3 - - - - QLabel - - name - TextLabel2_2 - - - text - Convert from - - - - QComboBox - - - text - XML - - - - - text - SQL (SQLite) - - - - name - ComboBox2_2_2 - - - - - - QGroupBox - - name - GroupBox4 - - - title - Progress: - - - - margin - 11 - - - spacing - 6 - - - QProgressBar - - name - m_progressBar - - - - - - QPushButton - - name - PushButton1 - - - text - Go! - - - - - - - - - PushButton1 - clicked() - converter_base - start_conversion() - - start_conversion() - - diff --git a/libopie/pim/test/oevent_test.cpp b/libopie/pim/test/oevent_test.cpp deleted file mode 100644 index 9f16911..0000000 --- a/libopie/pim/test/oevent_test.cpp +++ b/dev/null @@ -1,35 +0,0 @@ -#include - -#include "../oevent.h" -#include "../odatebookaccess.h" - -int main(int argc, char* argv ) { - ODateBookAccess acc; - if(!acc.load() ) qWarning("could not load"); - - ODateBookAccess::List::Iterator it; - ODateBookAccess::List list = acc.allRecords(); - - for( it = list.begin(); it != list.end(); ++it ){ - OEvent ev = (*it); - qWarning("Summary: %s",ev.description().latin1() ); - qWarning("Start: %s End: %s",ev.startDateTime().toString().latin1(), ev.endDateTime().toString().latin1() ); - qWarning("All Day: %d Recurrence: %d",ev.isAllDay(), ev.hasRecurrence() ); - qWarning("UID %d", ev.uid() ); - - } - QDate date1(2003,02,01 ); - QDate date2(2003,03,01 ); - - OEffectiveEvent::ValueList effList = acc.effectiveEvents( date1,date2 ); - OEffectiveEvent::ValueList::Iterator effIt; - - for( effIt = effList.begin(); effIt != effList.end(); ++effIt ){ - OEffectiveEvent ef = (*effIt); - qWarning("Summary: %s", ef.description().latin1() ); - qWarning("Date: %s", ef.date().toString().latin1() ); - } - acc.save(); - - return 0; -} diff --git a/libopie/pim/test/oevent_test.pro b/libopie/pim/test/oevent_test.pro deleted file mode 100644 index 3365def..0000000 --- a/libopie/pim/test/oevent_test.pro +++ b/dev/null @@ -1,11 +0,0 @@ -TEMPLATE = app -#CONFIG = qt warn_on debug -CONFIG = qt warn_on release -#HEADERS = -SOURCES = oevent_test.cpp -INCLUDEPATH += $(OPIEDIR)/include -DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopie -TARGET = oevent_test - -include ( $(OPIEDIR)/include.pro ) \ No newline at end of file diff --git a/libopie/pim/test/test_todo.cpp b/libopie/pim/test/test_todo.cpp deleted file mode 100644 index 7440503..0000000 --- a/libopie/pim/test/test_todo.cpp +++ b/dev/null @@ -1,36 +0,0 @@ -#include -#include - -#include -#include -#include - -int main(int argc, char* argv[] ) { - - OTodoAccessXML* xml = new OTodoAccessXML("demo"); - OTodoAccess ac(xml); - int elc; - QTime timer; - qWarning("start loading"); - timer.start(); - ac.load(); - elc = timer.elapsed(); - qWarning("Elapsed loading %d %d", elc, elc/1000); - - timer.start(); - OTodoAccess::List lis = ac.allRecords(); - elc = timer.elapsed(); - qWarning("Elapsed allRecords %d %d", elc, elc/1000 ); - OTodoAccess::List::Iterator it; - timer.start(); -ac.save(); -/* - for( it = lis.begin(); it != lis.end(); ++it ) { - qWarning("Desc: " + (*it).summary() ); - qWarning("UID %d", (*it).uid() ); - } - */ -elc = timer.elapsed(); - - qWarning("elapsed iterating %d %d", elc, elc/1000 ); -}; diff --git a/libopie/pim/test/todo_test.pro b/libopie/pim/test/todo_test.pro deleted file mode 100644 index 3d14dda..0000000 --- a/libopie/pim/test/todo_test.pro +++ b/dev/null @@ -1,11 +0,0 @@ -TEMPLATE = app -#CONFIG = qt warn_on debug -CONFIG = qt warn_on release -#HEADERS = -SOURCES = test_todo.cpp -INCLUDEPATH += $(OPIEDIR)/include -DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopie -lopiesql -TARGET = todo_test - -include ( $(OPIEDIR)/ ) \ No newline at end of file -- cgit v0.9.0.2