author | zautrix <zautrix> | 2004-08-02 01:14:33 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-02 01:14:33 (UTC) |
commit | f6a823824e6a8be3d842e99b43dacd495bb02ba4 (patch) (unidiff) | |
tree | 09f21069cd63a5e73b9fe735d82487d35e47033b | |
parent | 54157cb44316de72d776cfae70bdadf6c52f4773 (diff) | |
download | kdepimpi-f6a823824e6a8be3d842e99b43dacd495bb02ba4.zip kdepimpi-f6a823824e6a8be3d842e99b43dacd495bb02ba4.tar.gz kdepimpi-f6a823824e6a8be3d842e99b43dacd495bb02ba4.tar.bz2 |
Hack, hack, hack ...
-rw-r--r-- | korganizer/calendarview.cpp | 1 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index cbe2a10..53c079c 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -847,48 +847,49 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b | |||
847 | return 0; | 847 | return 0; |
848 | } | 848 | } |
849 | Event* CalendarView::getLastSyncEvent() | 849 | Event* CalendarView::getLastSyncEvent() |
850 | { | 850 | { |
851 | Event* lse; | 851 | Event* lse; |
852 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); | 852 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); |
853 | lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice ); | 853 | lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice ); |
854 | if (!lse) { | 854 | if (!lse) { |
855 | lse = new Event(); | 855 | lse = new Event(); |
856 | lse->setUid( "last-syncEvent-"+mCurrentSyncDevice ); | 856 | lse->setUid( "last-syncEvent-"+mCurrentSyncDevice ); |
857 | QString sum = ""; | 857 | QString sum = ""; |
858 | if ( KOPrefs::instance()->mExternSyncProfiles.contains( mCurrentSyncDevice ) ) | 858 | if ( KOPrefs::instance()->mExternSyncProfiles.contains( mCurrentSyncDevice ) ) |
859 | sum = "E: "; | 859 | sum = "E: "; |
860 | lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event")); | 860 | lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event")); |
861 | lse->setDtStart( mLastCalendarSync ); | 861 | lse->setDtStart( mLastCalendarSync ); |
862 | lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); | 862 | lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); |
863 | lse->setCategories( i18n("SyncEvent") ); | 863 | lse->setCategories( i18n("SyncEvent") ); |
864 | lse->setReadOnly( true ); | 864 | lse->setReadOnly( true ); |
865 | mCalendar->addEvent( lse ); | 865 | mCalendar->addEvent( lse ); |
866 | } | 866 | } |
867 | 867 | ||
868 | return lse; | 868 | return lse; |
869 | 869 | ||
870 | } | 870 | } |
871 | // probaly useless | ||
871 | void CalendarView::setupExternSyncProfiles() | 872 | void CalendarView::setupExternSyncProfiles() |
872 | { | 873 | { |
873 | Event* lse; | 874 | Event* lse; |
874 | mExternLastSyncEvent.clear(); | 875 | mExternLastSyncEvent.clear(); |
875 | int i; | 876 | int i; |
876 | for ( i = 0; i < KOPrefs::instance()->mExternSyncProfiles.count(); ++i ) { | 877 | for ( i = 0; i < KOPrefs::instance()->mExternSyncProfiles.count(); ++i ) { |
877 | lse = mCalendar->event( "last-syncEvent-"+ KOPrefs::instance()->mExternSyncProfiles[i] ); | 878 | lse = mCalendar->event( "last-syncEvent-"+ KOPrefs::instance()->mExternSyncProfiles[i] ); |
878 | if ( lse ) | 879 | if ( lse ) |
879 | mExternLastSyncEvent.append( lse ); | 880 | mExternLastSyncEvent.append( lse ); |
880 | else | 881 | else |
881 | qDebug("Last Sync event not found for %s ", KOPrefs::instance()->mExternSyncProfiles[i].latin1()); | 882 | qDebug("Last Sync event not found for %s ", KOPrefs::instance()->mExternSyncProfiles[i].latin1()); |
882 | } | 883 | } |
883 | 884 | ||
884 | } | 885 | } |
885 | // we check, if the to delete event has a id for a profile | 886 | // we check, if the to delete event has a id for a profile |
886 | // if yes, we set this id in the profile to delete | 887 | // if yes, we set this id in the profile to delete |
887 | void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) | 888 | void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) |
888 | { | 889 | { |
889 | if ( ! lastSync.count() == 0 ) | 890 | if ( ! lastSync.count() == 0 ) |
890 | return; | 891 | return; |
891 | if ( toDelete->type() == "Journal" ) | 892 | if ( toDelete->type() == "Journal" ) |
892 | return; | 893 | return; |
893 | 894 | ||
894 | Event* eve = lastSync.first(); | 895 | Event* eve = lastSync.first(); |
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 59c8418..67a3f52 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -547,57 +547,63 @@ void KSyncPrefsDialog::usrReadConfig() | |||
547 | mSyncProfileNames =config.readListEntry("SyncProfileNames"); | 547 | mSyncProfileNames =config.readListEntry("SyncProfileNames"); |
548 | mMyMachineName->setText(config.readEntry("LocalMachineName","undefined")); | 548 | mMyMachineName->setText(config.readEntry("LocalMachineName","undefined")); |
549 | int i; | 549 | int i; |
550 | KSyncProfile* temp ; | 550 | KSyncProfile* temp ; |
551 | mSyncProfiles.clear(); | 551 | mSyncProfiles.clear(); |
552 | for ( i = 0; i < mSyncProfileNames.count();++i ) { | 552 | for ( i = 0; i < mSyncProfileNames.count();++i ) { |
553 | temp = new KSyncProfile (); | 553 | temp = new KSyncProfile (); |
554 | temp->setName( mSyncProfileNames[i] ); | 554 | temp->setName( mSyncProfileNames[i] ); |
555 | temp->readConfig( &config ); | 555 | temp->readConfig( &config ); |
556 | mSyncProfiles.append( temp ); | 556 | mSyncProfiles.append( temp ); |
557 | } | 557 | } |
558 | insertProfiles(); | 558 | insertProfiles(); |
559 | //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); | 559 | //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); |
560 | } | 560 | } |
561 | 561 | ||
562 | 562 | ||
563 | void KSyncPrefsDialog::usrWriteConfig() | 563 | void KSyncPrefsDialog::usrWriteConfig() |
564 | { | 564 | { |
565 | saveProfile(); | 565 | saveProfile(); |
566 | if ( currentSelection >= 0 ) | 566 | if ( currentSelection >= 0 ) |
567 | profileChanged(currentSelection); | 567 | profileChanged(currentSelection); |
568 | //KConfig *config = KOGlobals::config(); | 568 | //KConfig *config = KOGlobals::config(); |
569 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 569 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
570 | KSyncProfile* prof = mSyncProfiles.first(); | 570 | KSyncProfile* prof = mSyncProfiles.first(); |
571 | QStringList externalSyncProfileNames; | ||
572 | externalSyncProfileNames.append("Sharp_DTM");; | ||
571 | while ( prof ) { | 573 | while ( prof ) { |
572 | prof->writeConfig(&config); | 574 | prof->writeConfig(&config); |
575 | if ( prof->getIsPhoneSync( ) ) | ||
576 | externalSyncProfileNames.append(prof->getName( ) ); | ||
573 | prof = mSyncProfiles.next(); | 577 | prof = mSyncProfiles.next(); |
574 | } | 578 | } |
575 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; | 579 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; |
576 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); | 580 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); |
577 | config.setGroup("General"); | 581 | config.setGroup("General"); |
578 | config.writeEntry("SyncProfileNames",mSyncProfileNames); | 582 | config.writeEntry("SyncProfileNames",mSyncProfileNames); |
583 | config.writeEntry("ExternSyncProfiles",externalSyncProfileNames); | ||
579 | config.writeEntry("LocalMachineName",mMyMachineName->text()); | 584 | config.writeEntry("LocalMachineName",mMyMachineName->text()); |
585 | config.sync(); | ||
580 | } | 586 | } |
581 | 587 | ||
582 | void KSyncPrefsDialog::helpDevice() | 588 | void KSyncPrefsDialog::helpDevice() |
583 | { | 589 | { |
584 | QString hint = i18n("Insert device where\nphone is connected. E.g.:\n"); | 590 | QString hint = i18n("Insert device where\nphone is connected. E.g.:\n"); |
585 | #ifdef _WIN32_ | 591 | #ifdef _WIN32_ |
586 | hint += "Leave empty for Irda.\n" | 592 | hint += "Leave empty for Irda.\n" |
587 | "com1:\n(first serial port)\n" | 593 | "com1:\n(first serial port)\n" |
588 | "usb not supported\n" | 594 | "usb not supported\n" |
589 | "???\n(bluetooth device address)\n"; | 595 | "???\n(bluetooth device address)\n"; |
590 | 596 | ||
591 | #else | 597 | #else |
592 | hint += "/dev/ircomm\n(Irda)\n" | 598 | hint += "/dev/ircomm\n(Irda)\n" |
593 | "/dev/ttyS0\n(first serial port)\n" | 599 | "/dev/ttyS0\n(first serial port)\n" |
594 | "/dev/ttyUSB0\n(first device usb port)\n" | 600 | "/dev/ttyUSB0\n(first device usb port)\n" |
595 | "???\n(bluetooth device address)\n"; | 601 | "???\n(bluetooth device address)\n"; |
596 | #endif | 602 | #endif |
597 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); | 603 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); |
598 | } | 604 | } |
599 | void KSyncPrefsDialog::helpModel() | 605 | void KSyncPrefsDialog::helpModel() |
600 | { | 606 | { |
601 | QString hint = i18n("Leave empty or\ninsert name of phone model:\n"); | 607 | QString hint = i18n("Leave empty or\ninsert name of phone model:\n"); |
602 | hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection"; | 608 | hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection"; |
603 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); | 609 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); |