author | zecke <zecke> | 2004-08-06 12:10:04 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-08-06 12:10:04 (UTC) |
commit | cf4207c5c299812e46f40aaee307100f58317a97 (patch) (side-by-side diff) | |
tree | 5ddff7987fb9010c2940c3e8b4f68852774c93d6 | |
parent | 20e6c238513eb91f47c3030c2db7ada7cf4b7f25 (diff) | |
download | opie-cf4207c5c299812e46f40aaee307100f58317a97.zip opie-cf4207c5c299812e46f40aaee307100f58317a97.tar.gz opie-cf4207c5c299812e46f40aaee307100f58317a97.tar.bz2 |
Update to the on-server move.
We now have
core/ with DataTypes, PUBLIC API
backend/ for concrete implementation of backends and the 'Interface description'
ui/ For UI related classes
private/ For private implementation details
-rw-r--r-- | Rules.make | 4 | ||||
-rw-r--r-- | libopie2/opiepim/backend/backends.pro | 53 | ||||
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessvcal.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiepim/core/core.pro | 61 | ||||
-rw-r--r-- | libopie2/opiepim/core/ocontactaccess.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiepim/opiepim.pro | 6 | ||||
-rw-r--r-- | libopie2/opiepim/ui/ui.pro | 4 |
8 files changed, 77 insertions, 59 deletions
@@ -60,212 +60,214 @@ ifeq ($(CONFIG_OPIE_NO_BUILTIN_SHUTDOWN),y) echo DEFINES += OPIE_NO_BUILTIN_SHUTDOWN >> $@ endif ifeq ($(CONFIG_OPIE_NO_BUILTIN_CALIBRATE),y) echo DEFINES += OPIE_NO_BUILTIN_CALIBRATE >> $@ endif ifeq ($(CONFIG_USE_REALTIME_AUDIO_THREAD),y) echo DEFINES += USE_REALTIME_AUDIO_THREAD >> $@ endif ifeq ($(CONFIG_USE_FILE_NOTIFICATION),y) echo DEFINES += USE_FILE_NOTIFICATION >> $@ endif ifeq ($(CONFIG_QT_QWS_ALLOW_CLOCK),y) echo DEFINES += QT_QWS_ALLOW_OVERCLOCK >> $@ endif ifeq ($(CONFIG_OPIE_NEW_ALLOC),y) echo DEFINES += OPIE_NEW_MALLOC >> $@ endif ifeq ($(CONFIG_OPIE_NO_SOUND_PCM_READ_BITS),y) echo DEFINES += OPIE_NO_SOUND_PCM_READ_BITS >> $@ endif echo DEFINES += OPIE_SOUND_FRAGMENT_SHIFT=$(CONFIG_OPIE_SOUND_FRAGMENT_SHIFT) >> $@ ifeq ($(CONFIG_OPIE_WE_VERSION_OVERRIDE),y) echo DEFINES += OPIE_WE_VERSION=$(CONFIG_OPIE_WE_VERSION) >> $@ endif ifeq ($(CONFIG_OPIE_TASKBAR_LOCK_KEY_STATE),y) echo DEFINES += OPIE_TASKBAR_LOCK_KEY_STATE >> $@ endif # Write LIB dirs and INC dirs... ifeq ($(CONFIG_LIBETPAN_DEP),y) echo LIBETPAN_LIB_DIR = $(CONFIG_LIBETPAN_LIB_DIR) >> $@ echo LIBETPAN_INC_DIR = $(CONFIG_LIBETPAN_INC_DIR) >> $@ endif ifeq ($(CONFIG_LIBPCAP_DEP),y) echo LIBPCAP_LIB_DIR = $(CONFIG_LIBPCAP_LIB_DIR) >> $@ echo LIBPCAP_INC_DIR = $(CONFIG_LIBPCAP_INC_DIR) >> $@ endif ifeq ($(CONFIG_LIBSQLITE_DEP),y) echo LIBSQLITE_LIB_DIR = $(CONFIG_LIBSQLITE_LIB_DIR) >> $@ echo LIBSQLITE_INC_DIR = $(CONFIG_LIBSQLITE_INC_DIR) >> $@ endif ifeq ($(CONFIG_LIBXINE_DEP),y) echo LIBXINE_LIB_DIR = $(CONFIG_LIBXINE_LIB_DIR) >> $@ echo LIBXINE_INC_DIR = $(CONFIG_LIBXINE_INC_DIR) >> $@ endif ifeq ($(CONFIG_LIBIPK_DEP),y) echo LIBIPK_LIB_DIR = $(CONFIG_LIBIPK_LIB_DIR) >> $@ echo LIBIPK_INC_DIR = $(CONFIG_LIBIPK_INC_DIR) >> $@ endif ifeq ($(CONFIG_LIBSDK_DEP),y) echo LIBSDL_LIB_DIR = $(CONFIG_LIBSDL_LIB_DIR) >> $@ echo LIBSDL_INC_DIR = $(CONFIG_LIBSDL_INC_DIR) >> $@ endif ifeq ($(CONFIG_LIBSWORD_DEP),y) echo LIBSWORD_LIB_DIR = $(CONFIG_LIBSWORD_LIB_DIR) >> $@ echo LIBSWORD_INC_DIR = $(CONFIG_LIBSWORD_INC_DIR) >> $@ endif $(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;) $(TOPDIR)/.config $(TOPDIR)/packages @echo Generating dependency information... # add to subdir-y, and add descend rules @cat $(TOPDIR)/packages | grep -v '^#' | \ awk '{print \ ".PHONY : " $$2 "\n" \ "subdir-$$(" $$1 ") += " $$2 "\n\n"; \ print $$2 " : " $$2 "/Makefile\n\t$$(call descend,$$@,$(filter-out $$@,$$(filter-out $$@,$$(MAKECMDGOALS))))\n"; }' > $(TOPDIR)/.depends cat $(TOPDIR)/packages | grep -v '^#' | \ perl -ne '($$cfg, $$dir, $$pro) = $$_ =~ /^(\S+)\s+(\S+)\s+(\S+)/; if ( -e "$$dir/$$pro" ) { print "$$dir/Makefile : $$dir/$$pro \$$(QMAKE) \$$(OPIEDIR)/gen.pro \$$(OPIEDIR)/.config\n\t\$$(call makefilegen,\$$@)\n\n"; }' \ >> $(TOPDIR)/.depends # interpackage dependency generation @cat $(TOPDIR)/packages | \ $(TOPDIR)/scripts/deps.pl >> $(TOPDIR)/.depends $(TOPDIR)/.depends.cfgs: # config.in interdependencies @echo $(configs) | sed -e 's,/config.in,,g' | ( for i in `cat`; do echo $$i; done ) > dirs @cat dirs | ( for i in `cat`; do if [ "`cat dirs|grep $$i 2>/dev/null|wc -l`" -ne "1" ]; then deps=`cat dirs|grep $$i| grep -v "^$$i$$"|for i in \`cat|sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g'\`; do echo $$i/config.in; done`; echo `echo $$i/config.in|sed -e 's,^$(TOPDIR)/,$$(TOPDIR)/,'` : $$deps; fi; done ) >> $@ @-rm -f dirs $(QTDIR)/stamp-headers : @-rm -f $(QTDIR)/stamp-headers* ( cd $(QTDIR)/include; \ $(patsubst %,ln -sf ../src/kernel/%;,qgfx_qws.h qwsmouse_qws.h \ qcopchannel_qws.h qwindowsystem_qws.h \ qfontmanager_qws.h qwsdefaultdecoration_qws.h)) touch $@ $(QTDIR)/stamp-headers-x11 : @-rm -f $(QTDIR)/stamp-headers* cd $(QTDIR)/include; $(patsubst %,ln -sf $(OPIEDIR)/x11/libqpe-x11/qt/%;,qgfx_qws.h qwsmouse_qws.h qcopchannel_qws.h qwindowsystem_qws.h qfontmanager_qws.h qwsdefaultdecoration_qws.h) touch $@ $(OPIEDIR)/stamp-headers : @-rm -f $(OPIEDIR)/stamp-headers* mkdir -p $(TOPDIR)/include/qpe \ $(TOPDIR)/include/qtopia \ $(TOPDIR)/include/opie \ $(TOPDIR)/include/opie2 \ + $(TOPDIR)/include/opie2/private \ $(TOPDIR)/include/qtopia/private \ $(TOPDIR)/include/sl ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) ifeq ($(CONFIG_LIBOPIE),y) # libopie1 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) ( cd include/opie && ln -sf ../../libopie/big-screen/*.h .; ) endif # libopie2 ( cd include/opie2 && ln -sf ../../libopie2/opiecore/*.h .; ) ( cd include/opie2 && ln -sf ../../libopie2/opiecore/device/*.h .; ) ( cd include/opie2 && ln -sf ../../libopie2/opiemm/*.h .; ) ( cd include/opie2 && ln -sf ../../libopie2/opiedb/*.h .; ) ( cd include/opie2 && ln -sf ../../libopie2/opienet/*.h .; ) ( cd include/opie2 && ln -sf ../../libopie2/opiepim/*.h .; ) ( cd include/opie2 && ln -sf ../../libopie2/opiepim/core/*.h .; ) - ( cd include/opie2 && ln -sf ../../libopie2/opiepim/core/backends/*.h .; ) + ( cd include/opie2 && ln -sf ../../libopie2/opiepim/backend/*.h .; ) + ( cd include/opie2/private && ln -sf ../../../libopie2/opiepim/private/*.h .; ) ( cd include/opie2 && ln -sf ../../libopie2/opiepim/ui/*.h .; ) ( cd include/opie2 && ln -sf ../../libopie2/opieui/*.h .; ) ( cd include/opie2 && ln -sf ../../libopie2/opieui/fileselector/*.h .; ) ( cd include/opie2 && ln -sf ../../libopie2/opieui/big-screen/*.h .; ) ( cd include/opie2 && ln -sf ../../libopie2/opiesecurity/*.h .; ) # auxilliary libraries ( cd include/opie2 && ln -sf ../../libqtaux/*.h .; ) ( cd include/sl && ln -sf ../../libslcompat/*.h .; ) ( cd include/ && ln -sf ../noncore/net/ftplib/*.h .; ) ( cd include/ && ln -sf ../inputmethods/pickboard/pickboardcfg.h .; ) ( cd include/ && ln -sf ../inputmethods/pickboard/pickboardpicks.h .; ) # all ifeq ($(CONFIG_LIBOPIE),y) ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) endif ( cd include/opie2; for generatedHeader in `cd ../../libopie2/opieui; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ ln -sf ../../libopie2/opieui/$$generatedHeader $$generatedHeader; done ) ( cd include/opie2; for generatedHeader in `cd ../../libopie2/opiepim/ui; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ ln -sf ../../libopie2/opiepim/ui/$$generatedHeader $$generatedHeader; done ) ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h touch $@ $(OPIEDIR)/stamp-headers-x11 : @-rm -f $(OPIEDIR)/stamp-headers* mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \ $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) ( cd include/opie && ln -sf ../../libsql/*.h .; ) ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h ( cd include/qpe; ln -sf ../../x11/libqpe-x11/qpe/*.h .; ) touch $@ $(TOPDIR)/library/custom.h : $(TOPDIR)/.config @-rm -f $@ @$(if $(patsubst "%",%,$(CONFIG_CUSTOMFILE)),\ ln -sf $(patsubst "%",%,$(CONFIG_CUSTOMFILE)) $@) @touch $@ $(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/mconf $(TOPDIR)/scripts/kconfig/conf $(TOPDIR)/scripts/kconfig/qconf $(TOPDIR)/scripts/kconfig/libkconfig.so $(TOPDIR)/scripts/kconfig/gconf $(TOPDIR)/qmake/qmake: @$(call descend,$(shell dirname $@),$(shell basename $@)) menuconfig: $(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/mconf ./config.in $(TOPDIR)/scripts/kconfig/mconf ./config.in @touch ./.config.stamp xconfig: $(TOPDIR)/scripts/kconfig/qconf $(TOPDIR)/scripts/kconfig/libkconfig.so ./config.in $(TOPDIR)/scripts/kconfig/qconf ./config.in @touch .config.stamp gconfig: $(TOPDIR)/scripts/kconfig/gconf $(TOPDIR)/scripts/kconfig/libkconfig.so ./config.in $(TOPDIR)/scripts/kconfig/gconf ./config.in @touch .config.stamp config: $(TOPDIR)/scripts/kconfig/conf ./config.in $(TOPDIR)/scripts/kconfig/conf ./config.in @touch .config.stamp oldconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in $(TOPDIR)/scripts/kconfig/conf -o ./config.in @touch .config.stamp randconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in $(TOPDIR)/scripts/kconfig/conf -r ./config.in @touch .config.stamp allyesconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in $(TOPDIR)/scripts/kconfig/conf -y ./config.in @touch .config.stamp allnoconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in $(TOPDIR)/scripts/kconfig/conf -n ./config.in @touch .config.stamp defconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in $(TOPDIR)/scripts/kconfig/conf -d ./config.in @touch .config.stamp $(TOPDIR)/qmake/qmake : $(TOPDIR)/mkspecs/default $(TOPDIR)/mkspecs/default : ln -sf linux-g++ $@ $(TOPDIR)/scripts/subst : force @( \ echo 's,\$$QPE_VERSION,$(QPE_VERSION),g'; \ echo 's,\$$OPIE_VERSION,$(OPIE_VERSION),g'; \ echo 's,\$$QTE_VERSION,$(QTE_VERSION),g'; \ echo 's,\$$QTE_REVISION,$(QTE_REVISION),g'; \ echo 's,\$$SUB_VERSION,$(SUB_VERSION),g'; \ diff --git a/libopie2/opiepim/backend/backends.pro b/libopie2/opiepim/backend/backends.pro index f91e98a..42d807c 100644 --- a/libopie2/opiepim/backend/backends.pro +++ b/libopie2/opiepim/backend/backends.pro @@ -1,44 +1,37 @@ SOURCES += \ - core/backends/ocontactaccessbackend_vcard.cpp \ - core/backends/ocontactaccessbackend_xml.cpp \ - core/backends/ocontactaccess.cpp \ - core/backends/odatebookaccessbackend.cpp \ - core/backends/odatebookaccessbackend_xml.cpp \ - core/backends/otodoaccessbackend.cpp \ - core/backends/otodoaccess.cpp \ - core/backends/otodoaccessvcal.cpp \ - core/backends/otodoaccessxml.cpp \ - core/backends/odatebookaccess.cpp + backend/ocontactaccessbackend_vcard.cpp \ + backend/ocontactaccessbackend_xml.cpp \ + backend/odatebookaccessbackend.cpp \ + backend/odatebookaccessbackend_xml.cpp \ + backend/otodoaccessbackend.cpp \ + backend/otodoaccessvcal.cpp \ + backend/otodoaccessxml.cpp HEADERS += \ - core/backends/obackendfactory.h \ - core/backends/ocontactaccessbackend.h \ - core/backends/ocontactaccessbackend_vcard.h \ - core/backends/ocontactaccessbackend_xml.h \ - core/backends/ocontactaccess.h \ - core/backends/odatebookaccessbackend.h \ - core/backends/odatebookaccessbackend_xml.h \ - core/backends/opimaccessbackend.h \ - core/backends/opimaccesstemplate.h \ - core/backends/otodoaccessbackend.h \ - core/backends/otodoaccess.h \ - core/backends/otodoaccessvcal.h \ - core/backends/otodoaccessxml.h \ - core/backends/odatebookaccess.h + backend/obackendfactory.h \ + backend/ocontactaccessbackend.h \ + backend/ocontactaccessbackend_vcard.h \ + backend/ocontactaccessbackend_xml.h \ + backend/odatebookaccessbackend.h \ + backend/odatebookaccessbackend_xml.h \ + backend/opimaccessbackend.h \ + backend/otodoaccessbackend.h \ + backend/otodoaccessvcal.h \ + backend/otodoaccessxml.h contains( ENABLE_SQL_PIM_BACKEND, y ) { message ( Enabling the SQL Backend for libopiepim2 ) DEFINES += __USE_SQL LIBS += -lopiedb2 - HEADERS += core/backends/otodoaccesssql.h \ - core/backends/ocontactaccessbackend_sql.h \ - core/backends/odatebookaccessbackend_sql.h - SOURCES += core/backends/otodoaccesssql.cpp \ - core/backends/ocontactaccessbackend_sql.cpp \ - core/backends/odatebookaccessbackend_sql.cpp + HEADERS += backend/otodoaccesssql.h \ + backend/ocontactaccessbackend_sql.h \ + backend/odatebookaccessbackend_sql.h + SOURCES += backend/otodoaccesssql.cpp \ + backend/ocontactaccessbackend_sql.cpp \ + backend/odatebookaccessbackend_sql.cpp } !contains( ENABLE_SQL_PIM_BACKEND, y ) { message ( No SQL Backend in libopiepim2 ) } diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp index 6b66814..af77a05 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp @@ -1,130 +1,130 @@ /* This file is part of the Opie Project Copyright (C) The Main Author <main-author@whereever.org> =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * VCard Backend for the OPIE-Contact Database. */ -#include "vobject_p.h" +#include <opie2/private/vobject_p.h> /* OPIE */ #include <opie2/ocontactaccessbackend_vcard.h> #include <opie2/odebug.h> #include <qpe/timeconversion.h> //FIXME: Hack to allow direct access to FILE* fh. Rewrite this! #define protected public #include <qfile.h> #undef protected namespace Opie { OPimContactAccessBackend_VCard::OPimContactAccessBackend_VCard ( const QString& , const QString& filename ): m_dirty( false ), m_file( filename ) { load(); } bool OPimContactAccessBackend_VCard::load () { m_map.clear(); m_dirty = false; VObject* obj = 0l; if ( QFile::exists(m_file) ){ obj = Parse_MIME_FromFileName( QFile::encodeName(m_file).data() ); if ( !obj ) return false; }else{ odebug << "File \"" << m_file << "\" not found !" << oendl; return false; } while ( obj ) { OPimContact con = parseVObject( obj ); /* * if uid is 0 assign a new one * this at least happens on * Nokia6210 */ if ( con.uid() == 0 ){ con.setUid( 1 ); owarn << "assigned new uid " << con.uid() << "" << oendl; } m_map.insert( con.uid(), con ); VObject *t = obj; obj = nextVObjectInList(obj); cleanVObject( t ); } return true; } bool OPimContactAccessBackend_VCard::reload() { return load(); } bool OPimContactAccessBackend_VCard::save() { if (!m_dirty ) return true; QFile file( m_file ); if (!file.open(IO_WriteOnly ) ) return false; VObject *obj; obj = newVObject( VCCalProp ); addPropValue( obj, VCVersionProp, "1.0" ); VObject *vo; for(QMap<int, OPimContact>::ConstIterator it=m_map.begin(); it !=m_map.end(); ++it ){ vo = createVObject( *it ); writeVObject( file.fh, vo ); //FIXME: HACK!!! cleanVObject( vo ); } cleanStrTbl(); deleteVObject( obj ); m_dirty = false; return true; } void OPimContactAccessBackend_VCard::clear () { m_map.clear(); m_dirty = true; // ??? sure ? (se) } diff --git a/libopie2/opiepim/backend/otodoaccessvcal.cpp b/libopie2/opiepim/backend/otodoaccessvcal.cpp index 14a325e..7d58a40 100644 --- a/libopie2/opiepim/backend/otodoaccessvcal.cpp +++ b/libopie2/opiepim/backend/otodoaccessvcal.cpp @@ -1,126 +1,126 @@ /* This file is part of the Opie Project Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de) =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "vobject_p.h" +#include <opie2/private/vobject_p.h> /* OPIE */ #include <opie2/otodoaccessvcal.h> #include <opie2/odebug.h> #include <qpe/timeconversion.h> /* QT */ //FIXME: Hack to allow direct access to FILE* fh. Rewrite this! #define protected public #include <qfile.h> #undef protected using namespace Opie; namespace { static OPimTodo eventByVObj( VObject *obj ){ OPimTodo event; VObject *ob; QCString name; // no uid, attendees, ... and no fun // description if( ( ob = isAPropertyOf( obj, VCDescriptionProp )) != 0 ){ name = vObjectStringZValue( ob ); #if 0 event.setDescription( name ); #else event.setSummary( name ); #endif } // summary if ( ( ob = isAPropertyOf( obj, VCSummaryProp ) ) != 0 ) { name = vObjectStringZValue( ob ); #if 0 event.setSummary( name ); #else event.setDescription( name ); #endif } // completed if( ( ob = isAPropertyOf( obj, VCStatusProp )) != 0 ){ name = vObjectStringZValue( ob ); if( name == "COMPLETED" ){ event.setCompleted( true ); }else{ event.setCompleted( false ); } }else event.setCompleted( false ); // priority if ((ob = isAPropertyOf(obj, VCPriorityProp))) { name = vObjectStringZValue( ob ); bool ok; event.setPriority(name.toInt(&ok) ); } //due date if((ob = isAPropertyOf(obj, VCDueProp)) ){ event.setHasDueDate( true ); name = vObjectStringZValue( ob ); event.setDueDate( TimeConversion::fromISO8601( name).date() ); } // categories if((ob = isAPropertyOf( obj, VCCategoriesProp )) != 0 ){ name = vObjectStringZValue( ob ); owarn << "Categories:" << name.data() << "" << oendl; } event.setUid( 1 ); return event; }; static VObject *vobjByEvent( const OPimTodo &event ) { VObject *task = newVObject( VCTodoProp ); if( task == 0 ) return 0l; if( event.hasDueDate() ) { QTime time(0, 0, 0); QDateTime date(event.dueDate(), time ); addPropValue( task, VCDueProp, TimeConversion::toISO8601( date ) ); } if( event.isCompleted() ) addPropValue( task, VCStatusProp, "COMPLETED"); QString string = QString::number(event.priority() ); addPropValue( task, VCPriorityProp, string.local8Bit() ); addPropValue( task, VCCategoriesProp, event.idsToString( event.categories() ).local8Bit() ); #if 0 // There seems a misrepresentation between summary in otodoevent // and summary in vcard. // The same with description.. diff --git a/libopie2/opiepim/core/core.pro b/libopie2/opiepim/core/core.pro index 597b1e8..b1b5655 100644 --- a/libopie2/opiepim/core/core.pro +++ b/libopie2/opiepim/core/core.pro @@ -1,23 +1,48 @@ HEADERS += \ + core/ocontactaccess.h \ + core/odatebookaccess.h \ + core/opimaccessfactory.h \ + core/opimaccesstemplate.h \ + core/opimcache.h \ + core/opimcontactfields.h \ + core/opimcontact.h \ core/opimdateconversion.h \ - core/opimcache.h \ - core/opimmaintainer.h \ - core/opimresolver.h \ - core/opimstate.h \ - core/opimxref.h \ - core/opimxrefmanager.h \ - core/opimxrefpartner.h \ - core/opimrecurrence.h \ - core/opimtemplatebase.h \ - core/opimtimezone.h + core/opimevent.h \ + core/opimglobal.h \ + core/opimmaintainer.h \ + core/opimnotify.h \ + core/opimnotifymanager.h \ + core/opimrecord.h \ + core/opimrecordlist.h \ + core/opimrecurrence.h \ + core/opimresolver.h \ + core/opimstate.h \ + core/opimtemplatebase.h \ + core/opimtimezone.h \ + core/opimtodo.h \ + core/opimxref.h \ + core/opimxrefmanager.h \ + core/opimxrefpartner.h \ + core/otodoaccess.h SOURCES += \ + core/ocontactaccess.cpp \ + core/odatebookaccess.cpp \ + core/opimcontactfields.cpp \ + core/opimcontact.cpp \ core/opimdateconversion.cpp \ - core/opimmaintainer.cpp \ - core/opimresolver.cpp \ - core/opimstate.cpp \ - core/opimxref.cpp \ - core/opimxrefmanager.cpp \ - core/opimxrefpartner.cpp \ - core/opimrecurrence.cpp \ - core/opimtimezone.cpp + core/opimevent.cpp \ + core/opimmaintainer.cpp \ + core/opimnotify.cpp \ + core/opimnotifymanager.cpp \ + core/opimrecord.cpp \ + core/opimrecurrence.cpp \ + core/opimresolver.cpp \ + core/opimstate.cpp \ + core/opimtimezone.cpp \ + core/opimtodo.cpp \ + core/opimxref.cpp \ + core/opimxrefmanager.cpp \ + core/opimxrefpartner.cpp \ + core/otodoaccess.cpp + diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp index 2602493..771d855 100644 --- a/libopie2/opiepim/core/ocontactaccess.cpp +++ b/libopie2/opiepim/core/ocontactaccess.cpp @@ -1,133 +1,133 @@ /* This file is part of the Opie Project Copyright (C) The Main Author <main-author@whereever.org> =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * ===================================================================== * ToDo: XML-Backend: Automatic reload if something was changed... * * */ -#include "ocontactaccess.h" -#include "obackendfactory.h" +#include <opie2/ocontactaccess.h> +#include <opie2/obackendfactory.h> /* OPIE */ #include <opie2/ocontactaccessbackend_xml.h> #include <opie2/opimresolver.h> #include <opie2/opimglobal.h> #include <opie2/odebug.h> //#include <qpe/qcopenvelope_qws.h> #include <qpe/global.h> /* QT */ #include <qasciidict.h> #include <qdatetime.h> #include <qfile.h> #include <qregexp.h> #include <qlist.h> #include <qcopchannel_qws.h> /* STD */ #include <errno.h> #include <fcntl.h> #include <unistd.h> #include <stdlib.h> namespace Opie { OPimContactAccess::OPimContactAccess ( const QString appname, const QString , OPimContactAccessBackend* end, bool autosync ): OPimAccessTemplate<OPimContact>( end ) { /* take care of the backend. If there is no one defined, we * will use the XML-Backend as default (until we have a cute SQL-Backend..). */ if( end == 0 ) { owarn << "Using BackendFactory !" << oendl; end = OBackendFactory<OPimContactAccessBackend>::defaultBackend( OPimGlobal::CONTACTLIST, appname ); } // Set backend locally and in template m_backEnd = end; OPimAccessTemplate<OPimContact>::setBackEnd (end); /* Connect signal of external db change to function */ QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this ); connect( dbchannel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(copMessage(const QCString&,const QByteArray&)) ); if ( autosync ){ QCopChannel *syncchannel = new QCopChannel( "QPE/Sync", this ); connect( syncchannel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(copMessage(const QCString&,const QByteArray&)) ); } } OPimContactAccess::~OPimContactAccess () { /* The user may forget to save the changed database, therefore try to * do it for him.. */ save(); // delete m_backEnd; is done by template.. } bool OPimContactAccess::save () { /* If the database was changed externally, we could not save the * Data. This will remove added items which is unacceptable ! * Therefore: Reload database and merge the data... */ if ( OPimAccessTemplate<OPimContact>::wasChangedExternally() ) reload(); bool status = OPimAccessTemplate<OPimContact>::save(); if ( !status ) return false; /* Now tell everyone that new data is available. */ QCopEnvelope e( "QPE/PIM", "addressbookUpdated()" ); return true; } const uint OPimContactAccess::querySettings() { return ( m_backEnd->querySettings() ); } bool OPimContactAccess::hasQuerySettings ( int querySettings ) const { return ( m_backEnd->hasQuerySettings ( querySettings ) ); } OPimRecordList<OPimContact> OPimContactAccess::sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const { QArray<int> matchingContacts = m_backEnd -> sorted( ascending, sortOrder, sortFilter, cat ); diff --git a/libopie2/opiepim/opiepim.pro b/libopie2/opiepim/opiepim.pro index 318aecf..af8e63d 100644 --- a/libopie2/opiepim/opiepim.pro +++ b/libopie2/opiepim/opiepim.pro @@ -1,27 +1,23 @@ TEMPLATE = lib CONFIG += qt warn_on DESTDIR = $(OPIEDIR)/lib -HEADERS = opimcontact.h opimcontactfields.h opimrecord.h opimtodo.h opimnotify.h \ - opimnotifymanager.h opimevent.h -SOURCES = opimcontact.cpp opimcontactfields.cpp opimrecord.cpp opimtodo.cpp opimnotify.cpp \ - opimnotifymanager.cpp opimevent.cpp INTERFACES = TARGET = opiepim2 VERSION = 1.8.6 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lopiecore2 include ( $(OPIEDIR)/gen.pro ) include ( core/core.pro ) -include ( core/backends/backends.pro ) +include ( backend/backends.pro ) include ( ui/ui.pro ) !contains( platform, x11 ) { include ( $(OPIEDIR)/include.pro ) } contains( platform, x11 ) { LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib } diff --git a/libopie2/opiepim/ui/ui.pro b/libopie2/opiepim/ui/ui.pro index 530bd9f..6aa01a7 100644 --- a/libopie2/opiepim/ui/ui.pro +++ b/libopie2/opiepim/ui/ui.pro @@ -1,7 +1,9 @@ HEADERS += ui/opimmainwindow.h \ - ui/opimrecurrencewidget.h + ui/opimrecurrencewidget.h \ + ui/todayconfigwidget.h \ + ui/todayplugininterface.h SOURCES += ui/opimmainwindow.cpp \ ui/opimrecurrencewidget.cpp INTERFACES += ui/opimrecurrencebase.ui
\ No newline at end of file |