author | zautrix <zautrix> | 2004-08-20 04:28:28 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-20 04:28:28 (UTC) |
commit | 93decd4185adc7197008e8397cf753a5ab674d99 (patch) (side-by-side diff) | |
tree | 0d701d0a687c22cfe2894121f8540d60a5fbe7a9 | |
parent | f7a401f03c18ef96eb40dc5540b31cd10880e845 (diff) | |
download | kdepimpi-93decd4185adc7197008e8397cf753a5ab674d99.zip kdepimpi-93decd4185adc7197008e8397cf753a5ab674d99.tar.gz kdepimpi-93decd4185adc7197008e8397cf753a5ab674d99.tar.bz2 |
Bugfixes for syncing
-rw-r--r-- | Makefile | 428 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 1 | ||||
-rw-r--r-- | libkcal/phoneformat.cpp | 336 | ||||
-rw-r--r-- | libkcal/sharpformat.cpp | 2 | ||||
-rw-r--r-- | libkcal/vcalformat.cpp | 71 | ||||
-rw-r--r-- | microkde/kidmanager.cpp | 14 |
6 files changed, 489 insertions, 363 deletions
@@ -1,271 +1,159 @@ -export KDEPIMDIR = $(shell pwd) +############################################################################# +# Makefile for building: kopi-desktop +# Generated by qmake (1.07a) (Qt 3.3.3) on: Thu Aug 19 22:23:29 2004 +# Project: kopi-desktop.pro +# Template: subdirs +# Command: $(QMAKE) -o Makefile kopi-desktop.pro +############################################################################# + +MAKEFILE = Makefile +QMAKE = qmake +DEL_FILE = rm -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p +INSTALL_FILE= +INSTALL_DIR = +SUBTARGETS = \ + sub-gammu-emb-common \ + sub-libical \ + sub-libkcal \ + sub-microkde \ + sub-libkdepim \ + sub-kabc \ + sub-korganizer \ + sub-kaddressbook \ + sub-kabc-plugins-file \ + sub-kabc-plugins-dir + +first: all + +all: Makefile $(SUBTARGETS) + +gammu/emb/common/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "gammu/emb/common" || $(MKDIR) "gammu/emb/common" + cd gammu/emb/common && $(QMAKE) common.pro -o $(MAKEFILE) +sub-gammu-emb-common: gammu/emb/common/$(MAKEFILE) FORCE + cd gammu/emb/common && $(MAKE) -f $(MAKEFILE) + +libical/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "libical" || $(MKDIR) "libical" + cd libical && $(QMAKE) libical.pro -o $(MAKEFILE) +sub-libical: libical/$(MAKEFILE) FORCE + cd libical && $(MAKE) -f $(MAKEFILE) + +libkcal/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "libkcal" || $(MKDIR) "libkcal" + cd libkcal && $(QMAKE) libkcal.pro -o $(MAKEFILE) +sub-libkcal: libkcal/$(MAKEFILE) FORCE + cd libkcal && $(MAKE) -f $(MAKEFILE) + +microkde/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "microkde" || $(MKDIR) "microkde" + cd microkde && $(QMAKE) microkde.pro -o $(MAKEFILE) +sub-microkde: microkde/$(MAKEFILE) FORCE + cd microkde && $(MAKE) -f $(MAKEFILE) + +libkdepim/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "libkdepim" || $(MKDIR) "libkdepim" + cd libkdepim && $(QMAKE) libkdepim.pro -o $(MAKEFILE) +sub-libkdepim: libkdepim/$(MAKEFILE) FORCE + cd libkdepim && $(MAKE) -f $(MAKEFILE) + +kabc/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "kabc" || $(MKDIR) "kabc" + cd kabc && $(QMAKE) kabc.pro -o $(MAKEFILE) +sub-kabc: kabc/$(MAKEFILE) FORCE + cd kabc && $(MAKE) -f $(MAKEFILE) + +korganizer/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "korganizer" || $(MKDIR) "korganizer" + cd korganizer && $(QMAKE) korganizer.pro -o $(MAKEFILE) +sub-korganizer: korganizer/$(MAKEFILE) FORCE + cd korganizer && $(MAKE) -f $(MAKEFILE) + +kaddressbook/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "kaddressbook" || $(MKDIR) "kaddressbook" + cd kaddressbook && $(QMAKE) kaddressbook.pro -o $(MAKEFILE) +sub-kaddressbook: kaddressbook/$(MAKEFILE) FORCE + cd kaddressbook && $(MAKE) -f $(MAKEFILE) + +kabc/plugins/file/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "kabc/plugins/file" || $(MKDIR) "kabc/plugins/file" + cd kabc/plugins/file && $(QMAKE) file.pro -o $(MAKEFILE) +sub-kabc-plugins-file: kabc/plugins/file/$(MAKEFILE) FORCE + cd kabc/plugins/file && $(MAKE) -f $(MAKEFILE) + +kabc/plugins/dir/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "kabc/plugins/dir" || $(MKDIR) "kabc/plugins/dir" + cd kabc/plugins/dir && $(QMAKE) dir.pro -o $(MAKEFILE) +sub-kabc-plugins-dir: kabc/plugins/dir/$(MAKEFILE) FORCE + cd kabc/plugins/dir && $(MAKE) -f $(MAKEFILE) + +Makefile: kopi-desktop.pro /usr/local/qtgcc/mkspecs/default/qmake.conf + $(QMAKE) -o Makefile kopi-desktop.pro +qmake: qmake_all + @$(QMAKE) -o Makefile kopi-desktop.pro + +all: $(SUBTARGETS) +qmake_all: gammu/emb/common/$(MAKEFILE) libical/$(MAKEFILE) libkcal/$(MAKEFILE) microkde/$(MAKEFILE) libkdepim/$(MAKEFILE) kabc/$(MAKEFILE) korganizer/$(MAKEFILE) kaddressbook/$(MAKEFILE) kabc/plugins/file/$(MAKEFILE) kabc/plugins/dir/$(MAKEFILE) + ( [ -d gammu/emb/common ] && cd gammu/emb/common ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d libical ] && cd libical ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d libkcal ] && cd libkcal ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d microkde ] && cd microkde ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d libkdepim ] && cd libkdepim ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d kabc ] && cd kabc ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d korganizer ] && cd korganizer ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d kaddressbook ] && cd kaddressbook ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true +clean uicables mocables uiclean mocclean lexclean yaccclean : qmake_all FORCE + ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; ) || true +uninstall_subdirs: qmake_all FORCE + ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true +install_subdirs: qmake_all FORCE + ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) install; ) || true +distclean: qmake_all FORCE + ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + +install: install_subdirs + +uninstall: uninstall_subdirs + +FORCE: - -ifeq ($(PLATFORM) , zaurus) - BUILD_NO_LDAP_PLUGIN=1 -endif - -ifneq ($(PLATFORM) , zaurus) - BUILD_NO_SHARP_PLUGIN=1 -endif - -SUBDIRS_MICROKDE = \ - libical/src/libical \ - libical/src/libicalss \ - qtcompat \ - microkde \ - libkcal \ - libkdepim \ - kabc \ - kabc/formats/binary \ - kabc/plugins/file \ - kabc/plugins/dir \ - korganizer \ - kalarmd \ - kaddressbook - -SUBDIRS_QTOPIA_PLUGIN = \ - kabc/plugins/qtopia - -SUBDIRS_OPIE_PLUGIN = \ - kabc/plugins/opie - -SUBDIRS_SHARP_PLUGIN = \ - kabc/plugins/sharpdtm - -SUBDIRS_LDAP_PLUGIN = \ - kabc/plugins/ldap - -SUBDIRS_MICROMAIL = \ - kmicromail/libetpan \ - kmicromail/libmailwrapper \ - kmicromail - -SUBDIRS = \ - $(SUBDIRS_MICROKDE) \ - $(SUBDIRS_QTOPIA_PLUGIN) \ - $(SUBDIRS_OPIE_PLUGIN) \ - $(SUBDIRS_SHARP_PLUGIN) \ - $(SUBDIRS_LDAP_PLUGIN) \ - $(SUBDIRS_MICROMAIL) - - -all: build_microkde \ - build_qtopia_plugin \ - build_opie_plugin \ - build_sharp_plugin \ - build_ldap_plugin \ - build_micromail - - -build_microkde: variable_test tmake - for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - -build_qtopia_plugin: build_microkde - for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - -build_opie_plugin: build_microkde - ifdef BUILD_NO_OPIE_PLUGIN - @echo ---> opie plugin not build. - else - for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - -build_sharp_plugin: build_microkde - ifdef BUILD_NO_SHARP_PLUGIN - @echo ---> ldap plugin not build. - else - for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - -build_ldap_plugin: build_microkde - ifdef BUILD_NO_LDAP_PLUGIN - @echo ---> ldap plugin not build. - else - for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - - -build_micromail: build_microkde - ifdef BUILD_NO_MICROMAIL - @echo ---> micromail not build. - else - for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - - -variable_info: - @echo -------------------------------------- - @echo KDEPIM buildsystem, variableinfo... - @echo KDEPIMDIR=$(KDEPIMDIR) - @echo QTDIR=$(QTDIR) - @echo QPEDIR=$(QPEDIR) - @echo OPIEDIR=$(OPIEDIR) - @echo PLATFORM=$(PLATFORM) - @echo RELEASE_DEBUG=$(RELEASE_DEBUG) - @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) - @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) - @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) - @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) - ifndef BUILD_NO_SHARP_PLUGIN - @echo SHARPDTMSDK=$(SHARPDTMSDK) - endif - @echo -------------------------------------- - -variable_test: variable_info - @echo KDEPIM buildsystem, variablecheck... - ifndef KDEPIMDIR - @echo KDEPIMDIR is not defined. - $(error KDEPIMDIR is not defined) - endif - ifndef PLATFORM - @echo PLATFORM is not defined. - $(error PLATFORM is not defined) - endif - ifdef BUILD_NO_LDAP_PLUGIN - @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) - endif - ifdef BUILD_NO_OPIE_PLUGIN - @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) - endif - ifdef BUILD_NO_MICROMAIL - @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) - endif - ifdef BUILD_NO_SHARP_PLUGIN - @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) - else - ifndef SHARPDTMSDK - @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) - $(error SHARPDTMSDK is not defined) - endif - endif - @echo -------------------------------------- - - -objects: - for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done - for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done - mkdir -p libical/lib/$(PLATFORM) - -clean: - rm -rf libical/lib/$(PLATFORM)/*; - for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ - rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ - done -install: - cd bin/kdepim; make install - cp db2file/db2file $(QPEDIR)/bin/db2file - cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop - cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop - cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kmicromail.desktop - -dist: - @echo Dont forget to do "make install" before "make dist" - rm -f *arm.ipk - rm -f *~ - cd ..; tar czf kdepim.src.tar.gz --exclude=obj --exclude=moc kdepim - ./mkipks kmicrokdelibs.control - ./mkipks korganizer.control - ./mkipks kaddressbook.control - ifndef BUILD_NO_MICROMAIL - ./mkipks kopiemail.control - endif - ./mkipks korganizer-alarm.control - -tmake: objects \ - qtcompat/Makefile$(PLATFORM) \ - microkde/Makefile$(PLATFORM) \ - libkcal/Makefile$(PLATFORM) \ - libkdepim/Makefile$(PLATFORM) \ - korganizer/Makefile$(PLATFORM) \ - kalarmd/Makefile$(PLATFORM) \ - libical/src/libical/Makefile$(PLATFORM) \ - libical/src/libicalss/Makefile$(PLATFORM) \ - kabc/Makefile$(PLATFORM) \ - kabc/formats/binary/Makefile$(PLATFORM) \ - kabc/plugins/file/Makefile$(PLATFORM) \ - kabc/plugins/dir/Makefile$(PLATFORM) \ - kabc/plugins/ldap/Makefile$(PLATFORM) \ - kabc/plugins/opie/Makefile$(PLATFORM) \ - kabc/plugins/qtopia/Makefile$(PLATFORM) \ - kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ - kaddressbook/Makefile$(PLATFORM) \ - kmicromail/Makefile$(PLATFORM) \ - kmicromail/libetpan/Makefile$(PLATFORM) \ - kmicromail/libmailwrapper/Makefile$(PLATFORM) - - - - -qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro - cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" qtcompat.pro -o Makefile$(PLATFORM) - -microkde/Makefile$(PLATFORM): microkde/microkdeE.pro - cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" microkdeE.pro -o Makefile$(PLATFORM) - -libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro - cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" libkcalE.pro -o Makefile$(PLATFORM) - - -libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro - cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" libkdepimE.pro -o Makefile$(PLATFORM) - -kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro - cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" kalarmdE.pro -o Makefile$(PLATFORM) - -korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro - cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" korganizerE.pro -o Makefile$(PLATFORM) - -libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro - cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" libicalE.pro -o Makefile$(PLATFORM) - -libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro - cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" libicalssE.pro -o Makefile$(PLATFORM) - -kabc/Makefile$(PLATFORM): kabc/kabcE.pro - cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" kabcE.pro -o Makefile$(PLATFORM) - -kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro - cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) - -kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro - cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" fileE.pro -o Makefile$(PLATFORM) - -kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro - cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" dirE.pro -o Makefile$(PLATFORM) - -kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro - cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" ldapE.pro -o Makefile$(PLATFORM) - -kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro - cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" opieE.pro -o Makefile$(PLATFORM) - -kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro - cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" qtopiaE.pro -o Makefile$(PLATFORM) - -kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro - cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" sharpdtmE.pro -o Makefile$(PLATFORM) - -kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro - cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" kaddressbookE.pro -o Makefile$(PLATFORM) - -kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro - cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" kmicromailE.pro -o Makefile$(PLATFORM) - -kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro - cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" libetpanE.pro -o Makefile$(PLATFORM) - -kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro - cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" libmailwrapperE.pro -o Makefile$(PLATFORM) diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 547d02b..7eca69d 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -894,96 +894,97 @@ void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* t } if ( toDelete->type() == "Journal" ) return; Event* eve = lastSync.first(); while ( eve ) { QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name if ( !id.isEmpty() ) { QString des = eve->description(); QString pref = "e"; if ( toDelete->type() == "Todo" ) pref = "t"; des += pref+ id + ","; eve->setReadOnly( false ); eve->setDescription( des ); //qDebug("setdes %s ", des.latin1()); eve->setReadOnly( true ); } eve = lastSync.next(); } } void CalendarView::checkExternalId( Incidence * inc ) { QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; checkExternSyncEvent( lastSync, inc ); } bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) { bool syncOK = true; int addedEvent = 0; int addedEventR = 0; int deletedEventR = 0; int deletedEventL = 0; int changedLocal = 0; int changedRemote = 0; //QPtrList<Event> el = local->rawEvents(); Event* eventR; QString uid; int take; Event* eventL; Event* eventRSync; Event* eventLSync; QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); bool fullDateRange = false; + local->resetTempSyncStat(); mLastCalendarSync = QDateTime::currentDateTime(); QDateTime modifiedCalendar = mLastCalendarSync;; eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); if ( eventR ) { eventRSync = (Event*) eventR->clone(); remote->deleteEvent(eventR ); } else { fullDateRange = true; eventRSync = new Event(); eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); eventRSync->setDtStart( mLastCalendarSync ); eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); eventRSync->setCategories( i18n("SyncEvent") ); } eventLSync = getLastSyncEvent(); if ( eventLSync->dtStart() == mLastCalendarSync ) fullDateRange = true; if ( ! fullDateRange ) { if ( eventLSync->dtStart() != eventRSync->dtStart() ) { // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() ); //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec()); fullDateRange = true; } } if ( fullDateRange ) mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); else mLastCalendarSync = eventLSync->dtStart(); // for resyncing if own file has changed if ( mCurrentSyncDevice == "deleteaftersync" ) { mLastCalendarSync = loadedFileVersion; qDebug("setting mLastCalendarSync "); } //qDebug("*************************** "); qDebug("mLastCalendarSync %s ",mLastCalendarSync.toString().latin1() ); QPtrList<Incidence> er = remote->rawIncidences(); Incidence* inR = er.first(); Incidence* inL; QProgressBar bar( er.count(),0 ); bar.setCaption (i18n("Syncing - close to abort!") ); int w = 300; if ( QApplication::desktop()->width() < 320 ) w = 220; diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index 6bbc0a3..6276498 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp @@ -438,97 +438,97 @@ public: } else if ( rtype == 4 ) { if ( hasEndDate ) r->setYearly( Recurrence::rYearlyMonth, freq, endDate ); else r->setYearly( Recurrence::rYearlyMonth, freq, -1 ); r->addYearlyNum( startDate.month() ); } } else { event->recurrence()->unsetRecurs(); } QStringList categoryList; categoryList << getCategory( Note ); event->setCategories( categoryList ); // strange 0 semms to mean: alarm enabled if ( alarm ) { Alarm *alarm; if ( event->alarms().count() > 0 ) alarm = event->alarms().first(); else { alarm = new Alarm( event ); event->addAlarm( alarm ); } alarm->setType( Alarm::Audio ); alarm->setEnabled( true ); int alarmOffset = alarmDt.secsTo( event->dtStart() ); alarm->setStartOffset( -alarmOffset ); } else { Alarm *alarm; if ( event->alarms().count() > 0 ) { alarm = event->alarms().first(); alarm->setType( Alarm::Audio ); alarm->setStartOffset( -60*15 ); alarm->setEnabled( false ); } } // csum ***************************************** uint cSum; cSum = PhoneFormat::getCsumEvent( event ); event->setCsum( mProfileName, QString::number( cSum )); event->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); mCalendar->addEvent( event); return true; } - QDateTime fromGSM ( GSM_DateTime* dtp, bool useTz = true ) { + QDateTime fromGSM ( GSM_DateTime* dtp, bool useTz = false ) { QDateTime dt; int y,m,t,h,min,sec; y = dtp->Year; m = dtp->Month; t = dtp->Day; h = dtp->Hour; min = dtp->Minute; sec = dtp->Second; dt = QDateTime(QDate(y,m,t), QTime(h,min,sec)); // dtp->Timezone: offset in hours int offset = KGlobal::locale()->localTimeOffset( dt ); if ( useTz ) dt = dt.addSecs ( offset*60); return dt; } static QString dtToString( const QDateTime& dti, bool useTZ = false ) { QString datestr; QString timestr; int offset = KGlobal::locale()->localTimeOffset( dti ); QDateTime dt; if (useTZ) dt = dti.addSecs ( -(offset*60)); else dt = dti; if(dt.date().isValid()){ const QDate& date = dt.date(); datestr.sprintf("%04d%02d%02d", date.year(), date.month(), date.day()); } if(dt.time().isValid()){ const QTime& time = dt.time(); timestr.sprintf("T%02d%02d%02d", time.hour(), time.minute(), time.second()); } return datestr + timestr; } QDate datefromGSM ( GSM_DateTime* dtp ) { return QDate ( dtp->Year, dtp->Month, dtp->Day ); } QString getCategory( GSM_CalendarEntry* Note) { QString CATEGORY; switch (Note->Type) { case GSM_CAL_REMINDER : CATEGORY = QString("Reminder"); break; case GSM_CAL_CALL : CATEGORY = QString("Call"); break; @@ -737,303 +737,534 @@ ulong PhoneFormat::getCsumEvent( Event* event ) attList << event->categoriesStr(); attList << event->secrecyStr(); return PhoneFormat::getCsum(attList ); } ulong PhoneFormat::getCsum( const QStringList & attList) { int max = attList.count() -1; ulong cSum = 0; int j,k,i; int add; for ( i = 1; i < max ; ++i ) { QString s = attList[i]; if ( ! s.isEmpty() ){ j = s.length(); for ( k = 0; k < j; ++k ) { int mul = k +1; add = s[k].unicode (); if ( k < 16 ) mul = mul * mul; add = add * mul *i*i*i; cSum += add; } } } return cSum; } //extern "C" GSM_Error GSM_InitConnection(GSM_StateMachine *s, int ReplyNum); #include <stdlib.h> #define DEBUGMODE false bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) { GSM_StateMachine s; qDebug(" load "); s.opened = false; s.msg = NULL; s.ConfigNum = 0; QLabel status ( i18n("Opening device ..."), 0 ); int w = status.sizeHint().width()+20 ; if ( w < 200 ) w = 230; int h = status.sizeHint().height()+20 ; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); status.setCaption(i18n("Reading phone...") ); status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); status.show(); status.raise(); qApp->processEvents(); -#if 0 - static char *cp; - static INI_Section *cfg = NULL; - cfg=GSM_FindGammuRC(); - int i; - for (i = 0; i <= MAX_CONFIG_NUM; i++) { - if (cfg!=NULL) { - cp = (char *)INI_GetValue(cfg, (unsigned char*) "gammu", (unsigned char*)"gammucoding", false); - if (cp) di.coding = cp; - - s.Config[i].Localize = (char *)INI_GetValue(cfg, (unsigned char*) "gammu", (unsigned char*) "gammuloc", false); - if (s.Config[i].Localize) { - s.msg=INI_ReadFile(s.Config[i].Localize, true); - } else { -#if !defined(WIN32) && defined(LOCALE_PATH) - locale = setlocale(LC_MESSAGES, NULL); - if (locale != NULL) { - snprintf(locale_file, 200, "%s/gammu_%c%c.txt", - LOCALE_PATH, - tolower(locale[0]), - tolower(locale[1])); - s.msg = INI_ReadFile(locale_file, true); - } -#endif - } - } - - /* Wanted user specific configuration? */ - - if (!GSM_ReadConfig(cfg, &s.Config[i], i) && i != 0) break; - - s.ConfigNum++; - - /* We want to use only one file descriptor for global and state machine debug output */ - s.Config[i].UseGlobalDebugFile = true; - - - /* We wanted to read just user specified configuration. */ - {break;} - } - -#endif int error=initDevice(&s); qDebug("GSM Init %d (no error is %d)", error, ERR_NONE); if ( error != ERR_NONE ) return false; GSM_Phone_Functions *Phone; GSM_CalendarEntry note; bool start = true; Phone=s.Phone.Functions; bool gshutdown = false; PhoneParser handler( calendar, mProfileName ); int ccc = 0; QString message = i18n(" Reading event # "); int procCount = 0; qDebug("Debug: only 10 calender items are downloaded "); while (!gshutdown && ccc++ < 10) { status.setText ( message + QString::number ( ++procCount ) ); qApp->processEvents(); qDebug("readEvent %d ", ccc); error=Phone->GetNextCalendar(&s,¬e,start); if (error == ERR_EMPTY) break; start = false; handler.readEvent( existingCal, ¬e ); qDebug("Org loc %d ",note.Location); //note.Location = 0; error=Phone->SetCalendar(&s,¬e); qDebug("new loc %d ",note.Location); } start = true; GSM_ToDoEntry ToDo; ccc = 0; message = i18n(" Reading todo # "); procCount = 0; while (!gshutdown && ccc++ < 10) { status.setText ( message + QString::number ( ++procCount ) ); qApp->processEvents(); error = Phone->GetNextToDo(&s, &ToDo, start); if (error == ERR_EMPTY) break; start = false; qDebug("ReadTodo %d ", ccc); handler.readTodo( existingCal, &ToDo, &s); } error=GSM_TerminateConnection(&s); return true; } #include <qcstring.h> void PhoneFormat::event2GSM( Calendar *cal,Event* ev, GSM_CalendarEntry*Note ) { QString eText = vfconverter.eventToString( ev, cal ); int pos = 0; GSM_ToDoEntry dummy; qDebug( "Convert event"); QByteArray ba; QDataStream s ( ba, IO_WriteOnly ); s << eText.utf8(); GSM_DecodeVCALENDAR_VTODO( (unsigned char*) ba.data(), &pos, Note , &dummy, Nokia_VCalendar, Nokia_VToDo ); qDebug( "Convert event done"); Note->Location = 0; QString loc = ev->getID(mProfileName); if ( !loc.isEmpty() ){ Note->Location = loc.toInt(); } } void PhoneFormat::todo2GSM( Calendar *cal, Todo* todo, GSM_ToDoEntry *gsmTodo ) { qDebug( "Convert todo1"); QString tText = vfconverter.todoToString( todo, cal ); int pos = 0; GSM_CalendarEntry dummy; QByteArray ba; QDataStream s ( ba, IO_WriteOnly ); s << tText.utf8(); GSM_DecodeVCALENDAR_VTODO( (unsigned char*) ba.data(), &pos, &dummy, gsmTodo, Nokia_VCalendar, Nokia_VToDo ); qDebug( "Convert todo done "); gsmTodo->Location = 0; QString loc = todo->getID(mProfileName); if ( !loc.isEmpty() ){ gsmTodo->Location = loc.toInt(); } } void PhoneFormat::afterSave( Incidence* inc) { uint csum; + inc->removeID( mProfileName ); if ( inc->type() == "Event") csum = PhoneFormat::getCsumEvent( (Event*) inc ); else csum = PhoneFormat::getCsumTodo( (Todo*) inc ); inc->setCsum( mProfileName, QString::number( csum )); inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); } bool PhoneFormat::save( Calendar *calendar) { - return true; + GSM_StateMachine s; qDebug(" save "); s.opened = false; s.msg = NULL; s.ConfigNum = 0; QLabel status ( i18n(" Opening device ..."), 0 ); int w = status.sizeHint().width()+20 ; if ( w < 200 ) w = 230; int h = status.sizeHint().height()+20 ; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); status.setCaption(i18n("Writing to phone...") ); status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); status.show(); status.raise(); qApp->processEvents(); int error=initDevice(&s); qDebug("GSM Init %d (no error is %d)", error, ERR_NONE); if ( error != ERR_NONE ) return false; GSM_Phone_Functions *Phone; GSM_CalendarEntry Note; bool start = true; Phone=s.Phone.Functions; bool gshutdown = false; QPtrList<Event> er = calendar->rawEvents(); Event* ev = er.first(); - QString message = i18n(" Processing event # "); + QString message = i18n(" Deleting event # "); int procCount = 0; - bool planB = true;// false; + int diffProc = 0; + bool setPossible = true; +#ifdef _WIN32_ + QString fileName = locateLocal("data", "korganizer") + "\\tempfile.vcs"; +#else + QString fileName = "/tmp/kdepimtemp.vcs"; +#endif + //algo 1 delete event + while ( ev ) { + if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { // event was changed during sync or is a new one + + status.setText ( message + QString::number ( ++procCount ) ); + qApp->processEvents(); + qDebug("del event1 %d ", procCount); + //event2GSM( calendar, ev, &Note ); + if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { // delete + + QString loc = ev->getID(mProfileName); + if ( !loc.isEmpty() ){ + Note.Location = loc.toInt(); + } else { + qDebug("error: loc is empty "); + } + error = Phone->DeleteCalendar(&s, &Note); + if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { + qDebug(" e error delete1 planB %d ", error); + break; + } + } + else if ( ev->getID(mProfileName).isEmpty() ) { // add new + // we have to do this later after deleting + + } + else { // change existing + + QString loc = ev->getID(mProfileName); + if ( !loc.isEmpty() ){ + Note.Location = loc.toInt(); + } else { + qDebug("error3: loc is empty "); + } + error = Phone->DeleteCalendar(&s, &Note); + if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { + qDebug(" e error delete2 planB %d ", error); + break; + } + ev->removeID( mProfileName ); + } + } + ev = er.next(); + } + //algo 1 delete todo + GSM_ToDoEntry ToDoEntry; + QPtrList<Todo> tl = calendar->rawTodos(); + Todo* to = tl.first(); + message = i18n(" Deleting todo # "); + procCount = 0; + while ( to ) { + if ( to->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { + qDebug("todo3 %d ", procCount); + status.setText ( message + QString::number ( ++procCount ) ); + qApp->processEvents(); + qDebug("todo5 %d ", procCount); + // todo2GSM( calendar, to, &ToDoEntry ); + QString loc = to->getID(mProfileName); + if ( !loc.isEmpty() ){ + ToDoEntry.Location = loc.toInt(); + } else { + qDebug("error2: loc is empty "); + } + if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { // delete + error=Phone->DeleteToDo(&s,&ToDoEntry); + if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { + qDebug("delete planB %d ", error); + } + } + else if ( to->getID(mProfileName).isEmpty() ) { // add new + ; + } + else { // change existing + error=Phone->DeleteToDo(&s,&ToDoEntry); + if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { + qDebug("set planB %d ", error); + } + to->removeID( mProfileName ); + } + } + to = tl.next(); + } + //algo 2 add event + ev = er.first(); + QString filec; + message = i18n(" Preparing event # "); + procCount = 0; + while ( ev ) { + if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL && ev->tempSyncStat() != SYNC_TEMPSTATE_DELETE) { + if ( ev->getID(mProfileName).isEmpty() ) { + status.setText ( message + QString::number ( ++procCount ) ); + qApp->processEvents(); + filec += vfconverter.eventToString( ev, calendar )+ "\n"; + afterSave ( ev ); + + } + } + ev = er.next(); + } + //algo 2 add todo + to = tl.first(); + procCount = 0; + message = i18n(" Preparing todo # "); + while ( to ) { + qDebug("todo2 %d ", procCount); + if ( to->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL && to->tempSyncStat() != SYNC_TEMPSTATE_DELETE) { + qDebug("todo4 %d ", procCount); + if ( to->getID(mProfileName).isEmpty() ) { + status.setText ( message + QString::number ( ++procCount ) ); + qApp->processEvents(); + filec += vfconverter.todoToString( to, calendar )+ "\n"; + afterSave ( to ); + } + } + to = tl.next(); + } + if ( filec.isEmpty() ) { + qDebug("Nothing to write back.Finished. "); + error=GSM_TerminateConnection(&s); + return true; + } + //algo 3 saving file + message = i18n(" Saving temp file ... "); + status.setText ( message ); + qApp->processEvents(); + QFile file( fileName ); + if (!file.open( IO_WriteOnly ) ) { + qDebug("error open file "); + error=GSM_TerminateConnection(&s); + return false; + } + QTextStream ts( &file ); + ts.setCodec( QTextCodec::codecForName("utf8") ); + ts << filec ; + file.close(); + + + message = i18n(" Parsing temp file ... "); + status.setText ( message ); + qApp->processEvents(); + GSM_Backup Backup; + error=GSM_ReadBackupFile( (char*) fileName.latin1() ,&Backup); + qDebug("Read file result %d ",error ); + //algo 4 writing event + int max, i; + procCount = 0; + message = i18n(" Writing event # "); + if (Backup.Calendar[0] != NULL) { + max = 0; + while (Backup.Calendar[max]!=NULL) max++; + for (i=0;i<max;i++) { + status.setText ( message + QString::number ( ++procCount ) ); + qApp->processEvents(); + Note = *Backup.Calendar[i]; + Note.Location = 0; + error=Phone->AddCalendar(&s,&Note); + qDebug("add event %d %d", error, Note.Location ); + } + } + //algo 4 writing todo + procCount = 0; + message = i18n(" Writing todo # "); + if (Backup.ToDo[0] != NULL) { + max = 0; + while (Backup.ToDo[max]!=NULL) max++; + for (i=0;i<max;i++) { + status.setText ( message + QString::number ( ++procCount ) ); + qApp->processEvents(); + ToDoEntry = *Backup.ToDo[i]; + error = Phone->AddToDo(&s,&ToDoEntry); + qDebug("add todo %d ", error); + } + } + //algo 5 reread + message = i18n(" Rereading all data ... "); + status.setText ( message ); + qApp->processEvents(); + error=GSM_TerminateConnection(&s); + CalendarLocal* calendarTemp = new CalendarLocal(); + calendarTemp->setTimeZoneId( calendar->timeZoneId()); + if ( ! load( calendarTemp,calendar) ){ + qDebug("error reloading calendar "); + delete calendarTemp; + return false; + } + + + //algo 6 compare event + ev = er.first(); + message = i18n(" Comparing event # "); + QPtrList<Event> er1 = calendarTemp->rawEvents(); + Event* ev1; + procCount = 0; + while ( ev ) { + if ( ev->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID) { + qDebug("event new ID "); + status.setText ( message + QString::number ( ++procCount ) ); + qApp->processEvents(); + QString cSum = ev->getCsum(mProfileName); + ev1 = er1.first(); + while ( ev1 ) { + if ( ev1->getCsum( mProfileName ) == cSum ) { + er1.remove( ev1 ); + ev->setID(mProfileName, ev1->getID(mProfileName) ); + break; + } + ev1 = er1.next(); + } + if ( ! ev1 ) { + ev->removeID(mProfileName); + qDebug("ERROR: No event found on phone for %s ", ev->summary().latin1()); + qDebug("Probably writing back of events not supported "); + } + + } + ev = er.next(); + } + //algo 6 compare todo + to = tl.first(); + procCount = 0; + QPtrList<Todo> tl1 = calendarTemp->rawTodos(); + Todo* to1 ; + message = i18n(" Comparing todo # "); + while ( to ) { + qDebug("todo2 %d ", procCount); + if ( to->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID) { + status.setText ( message + QString::number ( ++procCount ) ); + qApp->processEvents(); + QString cSum = to->getCsum(mProfileName); + Todo* to1 = tl1.first(); + while ( to1 ) { + if ( to1->getCsum( mProfileName ) == cSum ) { + tl1.remove( to1 ); + to->setID(mProfileName, to1->getID(mProfileName) ); + break; + } + to1 = tl1.next(); + } + if ( ! to1 ) { + to->removeID(mProfileName); + qDebug("ERROR: No todo found on phone for %s ", to->summary().latin1()); + qDebug("Probably writing back of todos not supported "); + } + } + to = tl.next(); + } + delete calendarTemp; + return true; + // ******************************************************************* + // ******************************************************************* + // ******************************************************************* +#if 0 while ( ev && ! planB) { if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { // event was changed during sync or is a new one status.setText ( message + QString::number ( ++procCount ) ); qApp->processEvents(); qDebug("event1 %d ", procCount); event2GSM( calendar, ev, &Note ); if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { // delete error = Phone->DeleteCalendar(&s, &Note); if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { planB = true; - qDebug(" e delete planB %d ", error); + qDebug(" e delete1 planB %d ", error); break; } } else if ( ev->getID(mProfileName).isEmpty() ) { // add new // we have to do this later after deleting } else { // change existing - error = Phone->SetCalendar(&s, &Note); - if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { - planB = true; - qDebug(" e change planB %d ", error); - break; + if ( setPossible ) { + error = Phone->SetCalendar(&s, &Note); + if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { + setPossible = false; + ++diffProc; + qDebug("Set cal not supported %d ", error); + break; + } + } + if ( ! setPossible) { + ++diffProc; + error = Phone->DeleteCalendar(&s, &Note); + if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { + planB = true; + qDebug(" e delete2 planB %d ", error); + break; + } + ev->removeID( mProfileName ); } qDebug("Change Calendar. Location %d status: %d",Note.Location, error ); } } ev = er.next(); } ev = er.first(); // pending get empty slots int loc = 0; + procCount -= diffProc; while ( ev && ! planB) { if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL && ev->tempSyncStat() != SYNC_TEMPSTATE_DELETE) { qDebug("event2 %d ", procCount); if ( ev->getID(mProfileName).isEmpty() ) { status.setText ( message + QString::number ( ++procCount ) ); qApp->processEvents(); //int newID ;//= pending //ev->setID(mProfileName, QString::number( newID )); event2GSM( calendar, ev, &Note ); ++loc; Note.Location = loc; error = Phone->AddCalendar(&s, &Note); if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { planB = true; qDebug(" e add planB %d ", error); break; } ev->setID( mProfileName, QString::number( Note.Location ) ); qDebug("New Calendar. Location %d stat %d %d",Note.Location ,error, ERR_UNKNOWN); afterSave( ev ); } else { afterSave( ev ); // setting temp sync stat for changed items } } ev = er.next(); } if ( planB ) { qDebug("delete all calendar..."); status.setText ( i18n("Deleting all calendar...")); qApp->processEvents(); error=Phone->DeleteAllCalendar(&s); if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { message = i18n(" Deleting event # "); procCount = 0; while (1) { status.setText ( message + QString::number ( ++procCount ) ); qApp->processEvents(); qDebug("deleting event ... %d", procCount); error = Phone->GetNextCalendar(&s,&Note,true); if (error != ERR_NONE) break; error = Phone->DeleteCalendar(&s,&Note); } qDebug("deleting calendar ... finished"); } else { status.setText ( i18n("All calendar deleted!")); qDebug("all cal deleted"); @@ -1128,96 +1359,97 @@ bool PhoneFormat::save( Calendar *calendar) afterSave( to ); qDebug("New Todo. Location %d %d",ToDoEntry.Location, error ); } else { afterSave( to ); } } to = tl.next(); } if ( planB ) { qDebug("delete all ..."); error=Phone->DeleteAllToDo(&s); if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { while (1) { qDebug("deleting todo ..."); error = Phone->GetNextToDo(&s,&ToDoEntry,true); if (error != ERR_NONE) break; error = Phone->DeleteToDo(&s,&ToDoEntry); } qDebug("deleting todo ... finished"); } else { qDebug("all todo deleted"); } bool planC = false; to = tl.first(); while ( to && ! planC ) { todo2GSM( calendar,to, &ToDoEntry ); ToDoEntry.Location = 0; error=Phone->AddToDo(&s,&ToDoEntry); if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { // we have currently no planC :-( // planC = true; //qDebug("add planC %d ", error); //break; // we remove the ID such that this todo is not deleted after next sync to->removeID(mProfileName); to->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); } else { qDebug("adding %d planB %d ", ToDoEntry.Location ,error); to->setID(mProfileName, QString::number( ToDoEntry.Location )); afterSave( to ); } to = tl.next(); } if ( planC ) { // we have currently no planC :-( } } return true; +#endif } QString PhoneFormat::dtToGSM( const QDateTime& dti, bool useTZ ) { QString datestr; QString timestr; int offset = KGlobal::locale()->localTimeOffset( dti ); QDateTime dt; if (useTZ) dt = dti.addSecs ( -(offset*60)); else dt = dti; if(dt.date().isValid()){ const QDate& date = dt.date(); datestr.sprintf("%04d%02d%02d", date.year(), date.month(), date.day()); } if(dt.time().isValid()){ const QTime& time = dt.time(); timestr.sprintf("T%02d%02d%02d", time.hour(), time.minute(), time.second()); } return datestr + timestr; } QString PhoneFormat::getEventString( Event* event ) { #if 0 QStringList list; list.append( QString::number(event->zaurusId() ) ); list.append( event->categories().join(",") ); if ( !event->summary().isEmpty() ) list.append( event->summary() ); else list.append("" ); if ( !event->location().isEmpty() ) list.append( event->location() ); else list.append("" ); if ( !event->description().isEmpty() ) list.append( event->description() ); else list.append( "" ); if ( event->doesFloat () ) { list.append( dtToString( QDateTime(event->dtStart().date(), QTime(0,0,0)), false )); list.append( dtToString( QDateTime(event->dtEnd().date(),QTime(23,59,59)), false )); //6 list.append( "1" ); } else { diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp index defdb09..820d068 100644 --- a/libkcal/sharpformat.cpp +++ b/libkcal/sharpformat.cpp @@ -462,97 +462,97 @@ int SharpFormat::getNumFromRecord( QString answer, Incidence* inc ) tempString = getPart( answer, ok, start ); if ( start >= len || start == 0 ) { start = 0; ok = false; } if ( tempString.right(1) =="\n" ) tempString = tempString.left( tempString.length()-1); templist.append( tempString ); } ++ccc; if ( ccc == 2 && loopCount < 25 ) { start = 0; bool ok; int newnum = templist[0].toInt( &ok ); if ( ok && newnum > 0) { retval = newnum; inc->setID( "Sharp_DTM",templist[0] ); inc->setCsum( "Sharp_DTM", QString::number( getCsum( templist ) )); inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); } } } //qDebug("getNumFromRecord returning : %d ", retval); return retval; } bool SharpFormat::save( Calendar *calendar) { QLabel status ( i18n("Processing/adding events ..."), 0 ); int w = status.sizeHint().width()+20 ; if ( w < 200 ) w = 200; int h = status.sizeHint().height()+20 ; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); status.setCaption(i18n("Writing DTM Data") ); status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); status.show(); status.raise(); qApp->processEvents(); bool debug = DEBUGMODE; QString codec = "utf8"; QString answer; QString ePrefix = "CARDID,CATEGORY,DSRP,PLCE,MEM1,TIM1,TIM2,ADAY,ARON,ARMN,ARSD,RTYP,RFRQ,RPOS,RDYS,REND,REDT,ALSD,ALED,MDAY\n"; QString tPrefix = "CARDID,CATEGORY,ETDY,LTDY,FNDY,MARK,PRTY,TITL,MEM1\n"; QString command; QPtrList<Event> er = calendar->rawEvents(); Event* ev = er.first(); - QString fileName = "/tmp/kopitempout"; + QString fileName = "/tmp/kdepimtempfile"; int i = 0; QString changeString = ePrefix; QString deleteString = ePrefix; bool deleteEnt = false; bool changeEnt = false; QString message = i18n("Processing event # "); int procCount = 0; while ( ev ) { //qDebug("i %d ", ++i); if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { status.setText ( message + QString::number ( ++procCount ) ); qApp->processEvents(); QString eString = getEventString( ev ); if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { // delete // deleting empty strings does not work. // we write first and x and then delete the record with the x eString = eString.replace( QRegExp(",\"\""),",\"x\"" ); changeString += eString + "\n"; deleteString += eString + "\n"; deleteEnt = true; changeEnt = true; } else if ( ev->getID("Sharp_DTM").isEmpty() ) { // add new command = "(echo \"" + ePrefix + eString + "\" ) | db2file datebook -w -g -c " + codec+ " > "+ fileName; system ( command.utf8() ); QFile file( fileName ); if (!file.open( IO_ReadOnly ) ) { return false; } QTextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); answer = ts.read(); file.close(); //qDebug("answer \n%s ", answer.latin1()); getNumFromRecord( answer, ev ) ; } else { // change existing //qDebug("canging %d %d",ev->zaurusStat() ,ev->zaurusId() ); //command = "(echo \"" + ePrefix + eString + "\" ) | db2file datebook -w -g -c " + codec+ " > "+ fileName; changeString += eString + "\n"; changeEnt = true; } } ev = er.next(); } diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp index 076cd3f..9307f12 100644 --- a/libkcal/vcalformat.cpp +++ b/libkcal/vcalformat.cpp @@ -302,112 +302,114 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent) // status // backward compatibility, KOrganizer used to interpret only these two values addPropValue(vtodo, VCStatusProp, anEvent->isCompleted() ? "COMPLETED" : "NEEDS_ACTION"); // completion date if (anEvent->hasCompletedDate()) { tmpStr = qDateTimeToISO(anEvent->completed()); addPropValue(vtodo, VCCompletedProp, tmpStr.local8Bit()); } // priority tmpStr.sprintf("%i",anEvent->priority()); addPropValue(vtodo, VCPriorityProp, tmpStr.local8Bit()); // related event if (anEvent->relatedTo()) { addPropValue(vtodo, VCRelatedToProp, anEvent->relatedTo()->uid().local8Bit()); } // categories tmpStrList = anEvent->categories(); tmpStr = ""; QString catStr; for ( QStringList::Iterator it = tmpStrList.begin(); it != tmpStrList.end(); ++it ) { catStr = *it; if (catStr[0] == ' ') tmpStr += catStr.mid(1); else tmpStr += catStr; // this must be a ';' character as the vCalendar specification requires! // vcc.y has been hacked to translate the ';' to a ',' when the vcal is // read in. tmpStr += ";"; } if (!tmpStr.isEmpty()) { tmpStr.truncate(tmpStr.length()-1); addPropValue(vtodo, VCCategoriesProp, tmpStr.local8Bit()); } // alarm stuff kdDebug(5800) << "vcalformat::eventToVTodo was called" << endl; QPtrList<Alarm> alarms = anEvent->alarms(); Alarm* alarm; for (alarm = alarms.first(); alarm; alarm = alarms.next()) { if (alarm->enabled()) { - VObject *a = addProp(vtodo, VCDAlarmProp); - tmpStr = qDateTimeToISO(alarm->time()); - addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); - addPropValue(a, VCRepeatCountProp, "1"); - addPropValue(a, VCDisplayStringProp, "beep!"); - if (alarm->type() == Alarm::Audio) { - a = addProp(vtodo, VCAAlarmProp); - addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); - addPropValue(a, VCRepeatCountProp, "1"); - addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile())); - } - else if (alarm->type() == Alarm::Procedure) { - a = addProp(vtodo, VCPAlarmProp); - addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); - addPropValue(a, VCRepeatCountProp, "1"); - addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile())); + VObject *a; + tmpStr = qDateTimeToISO(alarm->time()); + if (alarm->type() == Alarm::Audio) { + a = addProp(vtodo, VCAAlarmProp); + addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); + addPropValue(a, VCRepeatCountProp, "1"); + addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile())); + } + else if (alarm->type() == Alarm::Procedure) { + a = addProp(vtodo, VCPAlarmProp); + addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); + addPropValue(a, VCRepeatCountProp, "1"); + addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile())); + } else { + a = addProp(vtodo, VCDAlarmProp); + addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); + addPropValue(a, VCRepeatCountProp, "1"); + addPropValue(a, VCDisplayStringProp, "beep!"); } } } if (anEvent->pilotId()) { // pilot sync stuff tmpStr.sprintf("%i",anEvent->pilotId()); addPropValue(vtodo, XPilotIdProp, tmpStr.local8Bit()); tmpStr.sprintf("%i",anEvent->syncStatus()); addPropValue(vtodo, XPilotStatusProp, tmpStr.local8Bit()); } return vtodo; } VObject* VCalFormat::eventToVEvent(const Event *anEvent) { VObject *vevent; QString tmpStr; QStringList tmpStrList; vevent = newVObject(VCEventProp); // start and end time tmpStr = qDateTimeToISO(anEvent->dtStart(), !anEvent->doesFloat()); addPropValue(vevent, VCDTstartProp, tmpStr.local8Bit()); // events that have time associated but take up no time should // not have both DTSTART and DTEND. if (anEvent->dtStart() != anEvent->dtEnd()) { tmpStr = qDateTimeToISO(anEvent->dtEnd(), !anEvent->doesFloat()); addPropValue(vevent, VCDTendProp, tmpStr.local8Bit()); } // creation date tmpStr = qDateTimeToISO(anEvent->created()); addPropValue(vevent, VCDCreatedProp, tmpStr.local8Bit()); // unique id addPropValue(vevent, VCUniqueStringProp, anEvent->uid().local8Bit()); // revision tmpStr.sprintf("%i", anEvent->revision()); addPropValue(vevent, VCSequenceProp, tmpStr.local8Bit()); @@ -580,113 +582,116 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent) text = "PRIVATE"; break; case Incidence::SecrecyConfidential: text = "CONFIDENTIAL"; break; } if (text) { addPropValue(vevent, VCClassProp, text); } // categories tmpStrList = anEvent->categories(); tmpStr = ""; QString catStr; for ( QStringList::Iterator it = tmpStrList.begin(); it != tmpStrList.end(); ++it ) { catStr = *it; if (catStr[0] == ' ') tmpStr += catStr.mid(1); else tmpStr += catStr; // this must be a ';' character as the vCalendar specification requires! // vcc.y has been hacked to translate the ';' to a ',' when the vcal is // read in. tmpStr += ";"; } if (!tmpStr.isEmpty()) { tmpStr.truncate(tmpStr.length()-1); addPropValue(vevent, VCCategoriesProp, tmpStr.local8Bit()); } // attachments // TODO: handle binary attachments! QPtrList<Attachment> attachments = anEvent->attachments(); for ( Attachment *at = attachments.first(); at; at = attachments.next() ) addPropValue(vevent, VCAttachProp, at->uri().local8Bit()); // resources tmpStrList = anEvent->resources(); tmpStr = tmpStrList.join(";"); if (!tmpStr.isEmpty()) addPropValue(vevent, VCResourcesProp, tmpStr.local8Bit()); // alarm stuff QPtrList<Alarm> alarms = anEvent->alarms(); Alarm* alarm; for (alarm = alarms.first(); alarm; alarm = alarms.next()) { - if (alarm->enabled()) { - VObject *a = addProp(vevent, VCDAlarmProp); - tmpStr = qDateTimeToISO(alarm->time()); - addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); - addPropValue(a, VCRepeatCountProp, "1"); - addPropValue(a, VCDisplayStringProp, "beep!"); - if (alarm->type() == Alarm::Audio) { - a = addProp(vevent, VCAAlarmProp); - addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); - addPropValue(a, VCRepeatCountProp, "1"); - addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile())); - } - if (alarm->type() == Alarm::Procedure) { - a = addProp(vevent, VCPAlarmProp); - addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); - addPropValue(a, VCRepeatCountProp, "1"); - addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile())); + if (alarm->enabled()) { + VObject *a ; + tmpStr = qDateTimeToISO(alarm->time()); + if (alarm->type() == Alarm::Audio) { + a = addProp(vevent, VCAAlarmProp); + addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); + addPropValue(a, VCRepeatCountProp, "1"); + addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile())); + } + if (alarm->type() == Alarm::Procedure) { + a = addProp(vevent, VCPAlarmProp); + addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); + addPropValue(a, VCRepeatCountProp, "1"); + addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile())); + } else { + a = addProp(vevent, VCDAlarmProp); + addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); + addPropValue(a, VCRepeatCountProp, "1"); + addPropValue(a, VCDisplayStringProp, "beep!"); + } } } // priority tmpStr.sprintf("%i",anEvent->priority()); addPropValue(vevent, VCPriorityProp, tmpStr.local8Bit()); // transparency tmpStr.sprintf("%i",anEvent->transparency()); addPropValue(vevent, VCTranspProp, tmpStr.local8Bit()); // related event if (anEvent->relatedTo()) { addPropValue(vevent, VCRelatedToProp, anEvent->relatedTo()->uid().local8Bit()); } if (anEvent->pilotId()) { // pilot sync stuff tmpStr.sprintf("%i",anEvent->pilotId()); addPropValue(vevent, XPilotIdProp, tmpStr.local8Bit()); tmpStr.sprintf("%i",anEvent->syncStatus()); addPropValue(vevent, XPilotStatusProp, tmpStr.local8Bit()); } return vevent; } Todo *VCalFormat::VTodoToEvent(VObject *vtodo) { VObject *vo; VObjectIterator voi; char *s; Todo *anEvent = new Todo; // creation date if ((vo = isAPropertyOf(vtodo, VCDCreatedProp)) != 0) { anEvent->setCreated(ISOToQDateTime(s = fakeCString(vObjectUStringZValue(vo)))); deleteStr(s); } // unique id vo = isAPropertyOf(vtodo, VCUniqueStringProp); // while the UID property is preferred, it is not required. We'll use the // default Event UID if none is given. if (vo) { diff --git a/microkde/kidmanager.cpp b/microkde/kidmanager.cpp index d24a41f..8cf486a 100644 --- a/microkde/kidmanager.cpp +++ b/microkde/kidmanager.cpp @@ -1,136 +1,136 @@ #include "kidmanager.h" KIdManager::KIdManager() { } // :profilename;12;id_withLen12;123456: // 123456 is the csum QString KIdManager::setId (const QString& idString,const QString& prof,const QString& idvalue ) { int startProf; int startIDnum; int startIDnumlen; int startID; int lenID; int startCsum; int lenCsum; int endall; QString newIDString; if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) ) { newIDString = idString.left(startIDnum ) + QString::number( idvalue.length() ) +";"+idvalue+ ";"+idString.mid( startCsum ); } else { newIDString = idString + prof+";"+ QString::number( idvalue.length() ) +";"+idvalue +";0:"; } - qDebug("setID:profile:%s*retval:%s*idvalue:%s* ", prof.latin1(), newIDString.latin1() ,idvalue.latin1() ); + //qDebug("setID:profile:%s*retval:%s*idvalue:%s* ", prof.latin1(), newIDString.latin1() ,idvalue.latin1() ); return newIDString; } QString KIdManager::getId (const QString& idString,const QString& prof ) { int startProf; int startIDnum; int startIDnumlen; int startID; int lenID; int startCsum; int lenCsum; int endall; QString idval = ""; if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) ) idval = idString.mid( startID, lenID ); - qDebug("getID:profile:%s*retval:%s*idstring:%s* ", prof.latin1(), idval.latin1() ,idString.latin1() ); + //qDebug("getID:profile:%s*retval:%s*idstring:%s* ", prof.latin1(), idval.latin1() ,idString.latin1() ); return idval; } QString KIdManager::removeId (const QString& idString,const QString& prof ) { int startProf; int startIDnum; int startIDnumlen; int startID; int lenID; int startCsum; int lenCsum; int endall; QString newIDString; if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) ) { - newIDString = idString.left(startProf) + idString.mid( endall ); + newIDString = idString.left(startProf) + idString.mid( endall+1 ); } else { newIDString = idString; } - qDebug("removeID:profile:%s*retval:%s*oldidstring:%s* ", prof.latin1(), newIDString.latin1() ,idString.latin1() ); + //qDebug("removeID:profile:%s*retval:%s*oldidstring:%s* ", prof.latin1(), newIDString.latin1() ,idString.latin1() ); return newIDString; } QString KIdManager::setCsum (const QString& idString,const QString& prof,const QString& idCsum ) { int startProf; int startIDnum; int startIDnumlen; int startID; int lenID; int startCsum; int lenCsum; int endall; QString newIDString; if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) ) { newIDString = idString.left(startCsum) + idCsum+ idString.mid( endall +1); } else { newIDString = idString + prof + ";3;_u_;"+ idCsum + ":"; } - qDebug("setCsum:profile:%s*retval:%s*idCsum:%s* ", prof.latin1(), newIDString.latin1() ,idCsum.latin1() ); + //qDebug("setCsum:profile:%s*retval:%s*idCsum:%s* ", prof.latin1(), newIDString.latin1() ,idCsum.latin1() ); return newIDString; } QString KIdManager::getCsum (const QString& idString,const QString& prof ) { int startProf; int startIDnum; int startIDnumlen; int startID; int lenID; int startCsum; int lenCsum; int endall; QString idval = ""; if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) ) idval = idString.mid( startCsum, lenCsum ); - qDebug("getCsum:profile:%s*retval:%s*idstring:%s* ", prof.latin1(), idval.latin1() ,idString.latin1() ); + //qDebug("getCsum:profile:%s*retval:%s*idstring:%s* ", prof.latin1(), idval.latin1() ,idString.latin1() ); return idval; } // :profilename;12;id_withLen12;123456: bool KIdManager::getNumbers (const QString& idString,const QString& prof, int &startProf, int &startIDnum, int &startIDnumlen,int &startID, int& lenID, int &startCsum, int &lenCsum, int & endall) { startProf = idString.find( ":"+prof+";" ); if ( startProf >= 0 ) { startIDnum = prof.length()+2+startProf; startID = idString.find( ";", startIDnum ) +1; startIDnumlen = startID - startIDnum - 1; if ( startIDnum > 0 ) { bool ok; lenID = idString.mid ( startIDnum,startIDnumlen).toInt( &ok ); if (ok) { startCsum = startID+lenID+1; endall = idString.find( ":", startCsum )-1; if ( endall < 0 ) { qDebug("Error getNumbers: andall not found "); return false; } lenCsum = endall-startCsum+1; } else { qDebug("Error getNumbers:length is no number:*%s* ", idString.mid ( startIDnum,startIDnumlen).toInt( &ok )); return false; } } else { qDebug("Error in KIdManager::getNumbers.startIDnum <= 0"); return false; } } else { - qDebug("getnumbers: profile not found *%s* ",prof.latin1() ); + //qDebug("getnumbers: profile not found *%s* ",prof.latin1() ); return false; } return true; } |