summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp57
-rw-r--r--kmicromail/viewmail.cpp4
-rw-r--r--korganizer/calendarview.cpp5
-rw-r--r--korganizer/koprefs.cpp6
-rw-r--r--korganizer/mainwindow.cpp4
-rw-r--r--libkcal/phoneformat.cpp4
-rw-r--r--version2
7 files changed, 22 insertions, 60 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 2e408b7..11eeabc 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -663,169 +663,130 @@ void KABCore::beamMySelf()
663 KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); 663 KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI();
664 if (!a.isEmpty()) 664 if (!a.isEmpty())
665 { 665 {
666 QStringList uids; 666 QStringList uids;
667 uids << a.uid(); 667 uids << a.uid();
668 668
669 beamVCard(uids); 669 beamVCard(uids);
670 } else { 670 } else {
671 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); 671 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) );
672 672
673 673
674 } 674 }
675} 675}
676 676
677void KABCore::export2phone() 677void KABCore::export2phone()
678{ 678{
679 679
680 KAex2phonePrefs ex2phone; 680 KAex2phonePrefs ex2phone;
681 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 681 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
682 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 682 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
683 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 683 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
684 684
685 if ( !ex2phone.exec() ) { 685 if ( !ex2phone.exec() ) {
686 return; 686 return;
687 } 687 }
688 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 688 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
689 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 689 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
690 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 690 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
691 691
692 692
693 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 693 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
694 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 694 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
695 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 695 KPimGlobalPrefs::instance()->mEx2PhoneModel );
696 696
697 QStringList uids = mViewManager->selectedUids(); 697 QStringList uids = mViewManager->selectedUids();
698 if ( uids.isEmpty() ) 698 if ( uids.isEmpty() )
699 return; 699 return;
700 700
701 QString fileName = getPhoneFile(); 701 QString fileName = getPhoneFile();
702 if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) 702 if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) )
703 return; 703 return;
704 704
705 message(i18n("Exporting to phone...")); 705 message(i18n("Exporting to phone..."));
706 QTimer::singleShot( 1, this , SLOT ( writeToPhone())); 706 QTimer::singleShot( 1, this , SLOT ( writeToPhone()));
707 707
708} 708}
709QString KABCore::getPhoneFile() 709QString KABCore::getPhoneFile()
710{ 710{
711#ifdef _WIN32_ 711#ifdef DESKTOP_VERSION
712 return locateLocal("tmp", "phonefile.vcf"); 712 return locateLocal("tmp", "phonefile.vcf");
713#else 713#else
714 return "/tmp/phonefile.vcf"; 714 return "/tmp/phonefile.vcf";
715#endif 715#endif
716 716
717} 717}
718void KABCore::writeToPhone( ) 718void KABCore::writeToPhone( )
719{ 719{
720 if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) 720 if ( PhoneAccess::writeToPhone( getPhoneFile() ) )
721 message(i18n("Export to phone finished!")); 721 message(i18n("Export to phone finished!"));
722 else 722 else
723 qDebug(i18n("Error exporting to phone")); 723 qDebug(i18n("Error exporting to phone"));
724} 724}
725void KABCore::beamVCard() 725void KABCore::beamVCard()
726{ 726{
727 QStringList uids = mViewManager->selectedUids(); 727 QStringList uids = mViewManager->selectedUids();
728 if ( !uids.isEmpty() ) 728 if ( !uids.isEmpty() )
729 beamVCard( uids ); 729 beamVCard( uids );
730} 730}
731 731
732 732
733void KABCore::beamVCard(const QStringList& uids) 733void KABCore::beamVCard(const QStringList& uids)
734{ 734{
735/*US
736 QString beamFilename;
737 Opie::OPimContact c;
738 if ( actionPersonal->isOn() ) {
739 beamFilename = addressbookPersonalVCardName();
740 if ( !QFile::exists( beamFilename ) )
741 return; // can't beam a non-existent file
742 Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null,
743 beamFilename );
744 Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true );
745 Opie::OPimContactAccess::List allList = access->allRecords();
746 Opie::OPimContactAccess::List::Iterator it = allList.begin(); // Just take first
747 c = *it;
748
749 delete access;
750 } else {
751 unlink( beamfile ); // delete if exists
752 mkdir("/tmp/obex/", 0755);
753 c = m_abView -> currentEntry();
754 Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null,
755 beamfile );
756 Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true );
757 access->add( c );
758 access->save();
759 delete access;
760
761 beamFilename = beamfile;
762 }
763
764 owarn << "Beaming: " << beamFilename << oendl;
765*/
766
767#if 0
768 QString tmpdir = locateLocal("tmp", KGlobal::getAppName());
769
770 QString dirName = tmpdir + "/" + KApplication::randomString( 8 );
771
772 QString name = "contact.vcf";
773 735
774 QString fileName = dirName + "/" + name; 736 // LR: we should use the /tmp dir on the Zaurus,
775#endif 737 // because: /tmp = RAM, (HOME)/kdepim = flash memory
776 // LR: we should use the /tmp dir, because: /tmp = RAM, (HOME)/kdepim = flash memory 738
777 // 739#ifdef DESKTOP_VERSION
740 QString fileName = locateLocal("tmp", "kapibeamfile.vcf");
741#else
778 QString fileName = "/tmp/kapibeamfile.vcf"; 742 QString fileName = "/tmp/kapibeamfile.vcf";
743#endif
779 744
780
781 //QDir().mkdir( dirName, true );
782
783
784 KABC::VCardConverter converter; 745 KABC::VCardConverter converter;
785 QString description; 746 QString description;
786 QString datastream; 747 QString datastream;
787 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { 748 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) {
788 KABC::Addressee a = mAddressBook->findByUid( *it ); 749 KABC::Addressee a = mAddressBook->findByUid( *it );
789 750
790 if ( a.isEmpty() ) 751 if ( a.isEmpty() )
791 continue; 752 continue;
792 753
793 if (description.isEmpty()) 754 if (description.isEmpty())
794 description = a.formattedName(); 755 description = a.formattedName();
795 756
796 QString vcard; 757 QString vcard;
797 converter.addresseeToVCard( a, vcard ); 758 converter.addresseeToVCard( a, vcard );
798 int start = 0; 759 int start = 0;
799 int next; 760 int next;
800 while ( (next = vcard.find("TYPE=", start) )>= 0 ) { 761 while ( (next = vcard.find("TYPE=", start) )>= 0 ) {
801 int semi = vcard.find(";", next); 762 int semi = vcard.find(";", next);
802 int dopp = vcard.find(":", next); 763 int dopp = vcard.find(":", next);
803 int sep; 764 int sep;
804 if ( semi < dopp && semi >= 0 ) 765 if ( semi < dopp && semi >= 0 )
805 sep = semi ; 766 sep = semi ;
806 else 767 else
807 sep = dopp; 768 sep = dopp;
808 datastream +=vcard.mid( start, next - start); 769 datastream +=vcard.mid( start, next - start);
809 datastream +=vcard.mid( next+5,sep -next -5 ).upper(); 770 datastream +=vcard.mid( next+5,sep -next -5 ).upper();
810 start = sep; 771 start = sep;
811 } 772 }
812 datastream += vcard.mid( start,vcard.length() ); 773 datastream += vcard.mid( start,vcard.length() );
813 } 774 }
814#ifndef DESKTOP_VERSION 775#ifndef DESKTOP_VERSION
815 QFile outFile(fileName); 776 QFile outFile(fileName);
816 if ( outFile.open(IO_WriteOnly) ) { 777 if ( outFile.open(IO_WriteOnly) ) {
817 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); 778 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" );
818 QTextStream t( &outFile ); // use a text stream 779 QTextStream t( &outFile ); // use a text stream
819 //t.setEncoding( QTextStream::UnicodeUTF8 ); 780 //t.setEncoding( QTextStream::UnicodeUTF8 );
820 t.setEncoding( QTextStream::Latin1 ); 781 t.setEncoding( QTextStream::Latin1 );
821 t <<datastream.latin1(); 782 t <<datastream.latin1();
822 outFile.close(); 783 outFile.close();
823 Ir *ir = new Ir( this ); 784 Ir *ir = new Ir( this );
824 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); 785 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) );
825 ir->send( fileName, description, "text/x-vCard" ); 786 ir->send( fileName, description, "text/x-vCard" );
826 } else { 787 } else {
827 qDebug("Error open temp beam file "); 788 qDebug("Error open temp beam file ");
828 return; 789 return;
829 } 790 }
830#endif 791#endif
831 792
@@ -2817,60 +2778,60 @@ void KABCore::message( QString m )
2817bool KABCore::syncPhone() 2778bool KABCore::syncPhone()
2818{ 2779{
2819 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2780 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2820 QString fileName = getPhoneFile(); 2781 QString fileName = getPhoneFile();
2821 if ( !PhoneAccess::readFromPhone( fileName) ) { 2782 if ( !PhoneAccess::readFromPhone( fileName) ) {
2822 message(i18n("Phone access failed!")); 2783 message(i18n("Phone access failed!"));
2823 return false; 2784 return false;
2824 } 2785 }
2825 AddressBook abLocal( fileName,"syncContact"); 2786 AddressBook abLocal( fileName,"syncContact");
2826 bool syncOK = false; 2787 bool syncOK = false;
2827 { 2788 {
2828 abLocal.importFromFile( fileName ); 2789 abLocal.importFromFile( fileName );
2829 qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); 2790 qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1());
2830 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 2791 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
2831 abLocal.preparePhoneSync( mCurrentSyncDevice, true ); 2792 abLocal.preparePhoneSync( mCurrentSyncDevice, true );
2832 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); 2793 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
2833 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 2794 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
2834 if ( syncOK ) { 2795 if ( syncOK ) {
2835 if ( syncManager->mWriteBackFile ) { 2796 if ( syncManager->mWriteBackFile ) {
2836 abLocal.removeSyncAddressees( true ); 2797 abLocal.removeSyncAddressees( true );
2837 abLocal.saveABphone( fileName ); 2798 abLocal.saveABphone( fileName );
2838 abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); 2799 abLocal.findNewExtIds( fileName, mCurrentSyncDevice );
2839 //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); 2800 //abLocal.preparePhoneSync( mCurrentSyncDevice, false );
2840 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); 2801 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice );
2841 } 2802 }
2842 } 2803 }
2843 setModified(); 2804 setModified();
2844 } 2805 }
2845 if ( syncOK ) 2806 if ( syncOK )
2846 mViewManager->refreshView(); 2807 mViewManager->refreshView();
2847 return syncOK; 2808 return syncOK;
2848} 2809}
2849void KABCore::getFile( bool success ) 2810void KABCore::getFile( bool success )
2850{ 2811{
2851 if ( ! success ) { 2812 if ( ! success ) {
2852 message( i18n("Error receiving file. Nothing changed!") ); 2813 message( i18n("Error receiving file. Nothing changed!") );
2853 return; 2814 return;
2854 } 2815 }
2855 mAddressBook->importFromFile( sentSyncFile() , false, true ); 2816 mAddressBook->importFromFile( sentSyncFile() , false, true );
2856 message( i18n("Pi-Sync successful!") ); 2817 message( i18n("Pi-Sync successful!") );
2857 mViewManager->refreshView(); 2818 mViewManager->refreshView();
2858} 2819}
2859void KABCore::syncFileRequest() 2820void KABCore::syncFileRequest()
2860{ 2821{
2861 mAddressBook->export2File( sentSyncFile() ); 2822 mAddressBook->export2File( sentSyncFile() );
2862} 2823}
2863QString KABCore::sentSyncFile() 2824QString KABCore::sentSyncFile()
2864{ 2825{
2865#ifdef _WIN32_ 2826#ifdef DESKTOP_VERSION
2866 return locateLocal( "tmp", "copysyncab.vcf" ); 2827 return locateLocal( "tmp", "copysyncab.vcf" );
2867#else 2828#else
2868 return QString( "/tmp/copysyncab.vcf" ); 2829 return QString( "/tmp/copysyncab.vcf" );
2869#endif 2830#endif
2870} 2831}
2871 2832
2872void KABCore::setCaptionBack() 2833void KABCore::setCaptionBack()
2873{ 2834{
2874 mMessageTimer->stop(); 2835 mMessageTimer->stop();
2875 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); 2836 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") );
2876} 2837}
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index 6e560d7..32a3b7c 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -208,97 +208,101 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
208 if (!item ) 208 if (!item )
209 return; 209 return;
210 210
211 if ( ( ( AttachItem* )item )->Partnumber() == -1 ) 211 if ( ( ( AttachItem* )item )->Partnumber() == -1 )
212 { 212 {
213 setText(); 213 setText();
214 return; 214 return;
215 } 215 }
216 QPopupMenu *menu = new QPopupMenu(); 216 QPopupMenu *menu = new QPopupMenu();
217 int ret=0; 217 int ret=0;
218 218
219 if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) 219 if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" )
220 { 220 {
221 menu->insertItem( tr( "Show Text" ), 1 ); 221 menu->insertItem( tr( "Show Text" ), 1 );
222 } 222 }
223 if (item->text(0).left(6)=="image/") { 223 if (item->text(0).left(6)=="image/") {
224 menu->insertItem(tr("Display image preview"),2); 224 menu->insertItem(tr("Display image preview"),2);
225 } 225 }
226 menu->insertItem( tr( "Save Attachment" ), 0 ); 226 menu->insertItem( tr( "Save Attachment" ), 0 );
227 menu->insertSeparator(1); 227 menu->insertSeparator(1);
228 228
229 ret = menu->exec( point, 0 ); 229 ret = menu->exec( point, 0 );
230 230
231 switch(ret) 231 switch(ret)
232 { 232 {
233 case 0: 233 case 0:
234 { 234 {
235 //MimeTypes types; 235 //MimeTypes types;
236 //types.insert( "all", "*" ); 236 //types.insert( "all", "*" );
237 QString str = KFileDialog::getSaveFileName( "/", item->text( 2 ), this ); 237 QString str = KFileDialog::getSaveFileName( "/", item->text( 2 ), this );
238 238
239 if( !str.isEmpty() ) 239 if( !str.isEmpty() )
240 { 240 {
241 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); 241 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
242 if (content) 242 if (content)
243 { 243 {
244 QFile output(str); 244 QFile output(str);
245 output.open(IO_WriteOnly); 245 output.open(IO_WriteOnly);
246 output.writeBlock(content->Content(),content->Length()); 246 output.writeBlock(content->Content(),content->Length());
247 output.close(); 247 output.close();
248 delete content; 248 delete content;
249 } 249 }
250 } 250 }
251 } 251 }
252 break ; 252 break ;
253 253
254 case 2: 254 case 2:
255 { 255 {
256#ifdef DESKTOP_VERSION
257 QString tmpfile = locateLocal( "tmp", "opiemail-image");
258#else
256 QString tmpfile = "/tmp/opiemail-image"; 259 QString tmpfile = "/tmp/opiemail-image";
260#endif
257 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); 261 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
258 if (content) { 262 if (content) {
259 QFile output(tmpfile); 263 QFile output(tmpfile);
260 output.open(IO_WriteOnly); 264 output.open(IO_WriteOnly);
261 output.writeBlock(content->Content(),content->Length()); 265 output.writeBlock(content->Content(),content->Length());
262 output.close(); 266 output.close();
263 delete content; 267 delete content;
264 MailImageDlg iview(""); 268 MailImageDlg iview("");
265 iview.setName(tmpfile); 269 iview.setName(tmpfile);
266 KApplication::execDialog(&iview); 270 KApplication::execDialog(&iview);
267 output.remove(); 271 output.remove();
268 } 272 }
269 } 273 }
270 break; 274 break;
271 case 1: 275 case 1:
272 if ( ( ( AttachItem* )item )->Partnumber() == -1 ) 276 if ( ( ( AttachItem* )item )->Partnumber() == -1 )
273 { 277 {
274 setText(); 278 setText();
275 } 279 }
276 else 280 else
277 { 281 {
278 if ( m_recMail->Wrapper() != 0l ) 282 if ( m_recMail->Wrapper() != 0l )
279 { // make sure that there is a wrapper , even after delete or simular actions 283 { // make sure that there is a wrapper , even after delete or simular actions
280 browser->setText( m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) ); 284 browser->setText( m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) );
281 } 285 }
282 } 286 }
283 break; 287 break;
284 } 288 }
285 delete menu; 289 delete menu;
286} 290}
287 291
288 292
289void ViewMail::setMail(const RecMailP&mail ) 293void ViewMail::setMail(const RecMailP&mail )
290{ 294{
291 295
292 m_recMail = mail; 296 m_recMail = mail;
293 297
294 m_mail[0] = mail->getFrom(); 298 m_mail[0] = mail->getFrom();
295 m_mail[1] = mail->getSubject(); 299 m_mail[1] = mail->getSubject();
296 m_mail[3] = mail->getDate(); 300 m_mail[3] = mail->getDate();
297 m_mail[4] = mail->Msgid(); 301 m_mail[4] = mail->Msgid();
298 302
299 m_mail2[0] = mail->To(); 303 m_mail2[0] = mail->To();
300 m_mail2[1] = mail->CC(); 304 m_mail2[1] = mail->CC();
301 m_mail2[2] = mail->Bcc(); 305 m_mail2[2] = mail->Bcc();
302 306
303 setText(); 307 setText();
304} 308}
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 290c0b9..884c61a 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2258,98 +2258,101 @@ void CalendarView::manageCategories()
2258{ 2258{
2259 KOCatPrefs* cp = new KOCatPrefs(); 2259 KOCatPrefs* cp = new KOCatPrefs();
2260 cp->show(); 2260 cp->show();
2261 int w =cp->sizeHint().width() ; 2261 int w =cp->sizeHint().width() ;
2262 int h = cp->sizeHint().height() ; 2262 int h = cp->sizeHint().height() ;
2263 int dw = QApplication::desktop()->width(); 2263 int dw = QApplication::desktop()->width();
2264 int dh = QApplication::desktop()->height(); 2264 int dh = QApplication::desktop()->height();
2265 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2265 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2266 if ( !cp->exec() ) { 2266 if ( !cp->exec() ) {
2267 delete cp; 2267 delete cp;
2268 return; 2268 return;
2269 } 2269 }
2270 int count = 0; 2270 int count = 0;
2271 if ( cp->addCat() ) { 2271 if ( cp->addCat() ) {
2272 count = addCategories(); 2272 count = addCategories();
2273 if ( count ) { 2273 if ( count ) {
2274 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); 2274 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! "));
2275 writeSettings(); 2275 writeSettings();
2276 } 2276 }
2277 } else { 2277 } else {
2278 removeCategories(); 2278 removeCategories();
2279 updateView(); 2279 updateView();
2280 } 2280 }
2281 delete cp; 2281 delete cp;
2282} 2282}
2283 2283
2284void CalendarView::beamIncidence(Incidence * Inc) 2284void CalendarView::beamIncidence(Incidence * Inc)
2285{ 2285{
2286 QPtrList<Incidence> delSel ; 2286 QPtrList<Incidence> delSel ;
2287 delSel.append(Inc); 2287 delSel.append(Inc);
2288 beamIncidenceList( delSel ); 2288 beamIncidenceList( delSel );
2289} 2289}
2290void CalendarView::beamCalendar() 2290void CalendarView::beamCalendar()
2291{ 2291{
2292 QPtrList<Incidence> delSel = mCalendar->rawIncidences(); 2292 QPtrList<Incidence> delSel = mCalendar->rawIncidences();
2293 //qDebug("beamCalendar() "); 2293 //qDebug("beamCalendar() ");
2294 beamIncidenceList( delSel ); 2294 beamIncidenceList( delSel );
2295} 2295}
2296void CalendarView::beamFilteredCalendar() 2296void CalendarView::beamFilteredCalendar()
2297{ 2297{
2298 QPtrList<Incidence> delSel = mCalendar->incidences(); 2298 QPtrList<Incidence> delSel = mCalendar->incidences();
2299 //qDebug("beamFilteredCalendar() "); 2299 //qDebug("beamFilteredCalendar() ");
2300 beamIncidenceList( delSel ); 2300 beamIncidenceList( delSel );
2301} 2301}
2302void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) 2302void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
2303{ 2303{
2304 if ( beamDialog->exec () == QDialog::Rejected ) 2304 if ( beamDialog->exec () == QDialog::Rejected )
2305 return; 2305 return;
2306 2306#ifdef DESKTOP_VERSION
2307 QString fn = locateLocal( "tmp", "kopibeamfile" );
2308#else
2307 QString fn = "/tmp/kopibeamfile"; 2309 QString fn = "/tmp/kopibeamfile";
2310#endif
2308 QString mes; 2311 QString mes;
2309 bool createbup = true; 2312 bool createbup = true;
2310 if ( createbup ) { 2313 if ( createbup ) {
2311 QString description = "\n"; 2314 QString description = "\n";
2312 CalendarLocal* cal = new CalendarLocal(); 2315 CalendarLocal* cal = new CalendarLocal();
2313 if ( beamDialog->beamLocal() ) 2316 if ( beamDialog->beamLocal() )
2314 cal->setLocalTime(); 2317 cal->setLocalTime();
2315 else 2318 else
2316 cal->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); 2319 cal->setTimeZoneId(KOPrefs::instance()->mTimeZoneId);
2317 Incidence *incidence = delSel.first(); 2320 Incidence *incidence = delSel.first();
2318 bool addText = false; 2321 bool addText = false;
2319 if ( delSel.count() < 10 ) 2322 if ( delSel.count() < 10 )
2320 addText = true; 2323 addText = true;
2321 else { 2324 else {
2322 description.sprintf(i18n(" %d items?"),delSel.count() ); 2325 description.sprintf(i18n(" %d items?"),delSel.count() );
2323 } 2326 }
2324 while ( incidence ) { 2327 while ( incidence ) {
2325 Incidence *in = incidence->clone(); 2328 Incidence *in = incidence->clone();
2326 if ( ! in->summary().isEmpty() ) { 2329 if ( ! in->summary().isEmpty() ) {
2327 in->setDescription(""); 2330 in->setDescription("");
2328 } else { 2331 } else {
2329 in->setSummary( in->description().left(20)); 2332 in->setSummary( in->description().left(20));
2330 in->setDescription(""); 2333 in->setDescription("");
2331 } 2334 }
2332 if ( addText ) 2335 if ( addText )
2333 description += in->summary() + "\n"; 2336 description += in->summary() + "\n";
2334 cal->addIncidence( in ); 2337 cal->addIncidence( in );
2335 incidence = delSel.next(); 2338 incidence = delSel.next();
2336 } 2339 }
2337 if ( beamDialog->beamVcal() ) { 2340 if ( beamDialog->beamVcal() ) {
2338 fn += ".vcs"; 2341 fn += ".vcs";
2339 FileStorage storage( cal, fn, new VCalFormat ); 2342 FileStorage storage( cal, fn, new VCalFormat );
2340 storage.save(); 2343 storage.save();
2341 } else { 2344 } else {
2342 fn += ".ics"; 2345 fn += ".ics";
2343 FileStorage storage( cal, fn, new ICalFormat( ) ); 2346 FileStorage storage( cal, fn, new ICalFormat( ) );
2344 storage.save(); 2347 storage.save();
2345 } 2348 }
2346 delete cal; 2349 delete cal;
2347 mes = i18n("KO/Pi: Ready for beaming"); 2350 mes = i18n("KO/Pi: Ready for beaming");
2348 topLevelWidget()->setCaption(mes); 2351 topLevelWidget()->setCaption(mes);
2349 KApplication::convert2latin1( fn ); 2352 KApplication::convert2latin1( fn );
2350#ifndef DESKTOP_VERSION 2353#ifndef DESKTOP_VERSION
2351 Ir *ir = new Ir( this ); 2354 Ir *ir = new Ir( this );
2352 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 2355 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
2353 ir->send( fn, description, "text/x-vCalendar" ); 2356 ir->send( fn, description, "text/x-vCalendar" );
2354#endif 2357#endif
2355 } 2358 }
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 651442b..258f738 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -157,102 +157,96 @@ KOPrefs::KOPrefs() :
157 addItemInt("Daylight Savings",&mDaylightSavings,0); 157 addItemInt("Daylight Savings",&mDaylightSavings,0);
158 KPrefs::setCurrentGroup("AlarmSettings"); 158 KPrefs::setCurrentGroup("AlarmSettings");
159 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 159 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
160 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 160 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
161 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 161 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
162 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 162 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
163 163
164 164
165 KPrefs::setCurrentGroup("Calendar"); 165 KPrefs::setCurrentGroup("Calendar");
166 166
167 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 167 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
168 168
169 KPrefs::setCurrentGroup("Fonts"); 169 KPrefs::setCurrentGroup("Fonts");
170 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 170 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
171 addItemFont("TimeBar Font",&mTimeBarFont); 171 addItemFont("TimeBar Font",&mTimeBarFont);
172 addItemFont("MonthView Font",&mMonthViewFont); 172 addItemFont("MonthView Font",&mMonthViewFont);
173 addItemFont("AgendaView Font",&mAgendaViewFont); 173 addItemFont("AgendaView Font",&mAgendaViewFont);
174 addItemFont("MarcusBains Font",&mMarcusBainsFont); 174 addItemFont("MarcusBains Font",&mMarcusBainsFont);
175 addItemFont("TimeLabels Font",&mTimeLabelsFont); 175 addItemFont("TimeLabels Font",&mTimeLabelsFont);
176 addItemFont("TodoView Font",&mTodoViewFont); 176 addItemFont("TodoView Font",&mTodoViewFont);
177 addItemFont("ListView Font",&mListViewFont); 177 addItemFont("ListView Font",&mListViewFont);
178 addItemFont("DateNavigator Font",&mDateNavigatorFont); 178 addItemFont("DateNavigator Font",&mDateNavigatorFont);
179 addItemFont("EditBox Font",&mEditBoxFont); 179 addItemFont("EditBox Font",&mEditBoxFont);
180 addItemFont("JournalView Font",&mJornalViewFont); 180 addItemFont("JournalView Font",&mJornalViewFont);
181 addItemFont("WhatsNextView Font",&mWhatsNextFont); 181 addItemFont("WhatsNextView Font",&mWhatsNextFont);
182 addItemFont("EventView Font",&mEventViewFont); 182 addItemFont("EventView Font",&mEventViewFont);
183 183
184// KPrefs::setCurrentGroup("SyncProfiles"); 184// KPrefs::setCurrentGroup("SyncProfiles");
185// addItemString("LocalMachineName",&mLocalMachineName, "undefined"); 185// addItemString("LocalMachineName",&mLocalMachineName, "undefined");
186// addItemStringList("SyncProfileNames",&mSyncProfileNames); 186// addItemStringList("SyncProfileNames",&mSyncProfileNames);
187// addItemStringList("ExternSyncProfiles",&mExternSyncProfileNames); 187// addItemStringList("ExternSyncProfiles",&mExternSyncProfileNames);
188 188
189 KPrefs::setCurrentGroup("RemoteSyncing"); 189 KPrefs::setCurrentGroup("RemoteSyncing");
190// addItemBool("UsePasswd",&mUsePassWd,false); 190// addItemBool("UsePasswd",&mUsePassWd,false);
191// addItemBool("WriteBackFile",&mWriteBackFile,true); 191// addItemBool("WriteBackFile",&mWriteBackFile,true);
192// addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false); 192// addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false);
193// addItemBool("AskForPreferences",&mAskForPreferences,true); 193// addItemBool("AskForPreferences",&mAskForPreferences,true);
194// addItemBool("ShowSyncSummary",&mShowSyncSummary,true); 194// addItemBool("ShowSyncSummary",&mShowSyncSummary,true);
195 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 195 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
196 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 196 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
197 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 197 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
198 addItemInt("LastSyncTime",&mLastSyncTime,0); 198 addItemInt("LastSyncTime",&mLastSyncTime,0);
199 199
200#ifdef _WIN32_ 200#ifdef _WIN32_
201 QString hdp= locateLocal("data","korganizer")+"\\\\"; 201 QString hdp= locateLocal("data","korganizer")+"\\\\";
202#else 202#else
203 QString hdp= locateLocal("data","korganizer")+"/"; 203 QString hdp= locateLocal("data","korganizer")+"/";
204#endif 204#endif
205// addItemString("RemoteIP",&mRemoteIP, "192.168.0.65");
206// addItemString("RemoteUser",&mRemoteUser, "zaurus");
207// addItemString("RemotePassWd",&mRemotePassWd, "");
208// addItemString("RemoteFile", &mRemoteFile, hdp+"mycalendar.ics");
209// addItemString("LocalTempFile",&mLocalTempFile, "/tmp/tempsyncfile.ics" );
210
211 205
212 KPrefs::setCurrentGroup("LoadSaveFileNames"); 206 KPrefs::setCurrentGroup("LoadSaveFileNames");
213 207
214 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 208 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
215 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 209 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
216 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 210 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
217 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 211 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
218 212
219 213
220 KPrefs::setCurrentGroup("Locale"); 214 KPrefs::setCurrentGroup("Locale");
221 addItemInt("PreferredLanguage",&mPreferredLanguage,0); 215 addItemInt("PreferredLanguage",&mPreferredLanguage,0);
222 addItemInt("PreferredTime",&mPreferredTime,0); 216 addItemInt("PreferredTime",&mPreferredTime,0);
223 addItemInt("PreferredDate",&mPreferredDate,0); 217 addItemInt("PreferredDate",&mPreferredDate,0);
224 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); 218 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false);
225 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 219 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
226 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); 220 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y");
227 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y"); 221 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y");
228 222
229 223
230 KPrefs::setCurrentGroup("Colors"); 224 KPrefs::setCurrentGroup("Colors");
231 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 225 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
232 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 226 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
233 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 227 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
234 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 228 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
235 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 229 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
236 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 230 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
237 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 231 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
238 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 232 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
239 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 233 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
240 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 234 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
241 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 235 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
242 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 236 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
243 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 237 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
244 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 238 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
245 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 239 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
246 addItemBool("UseAppColors",&mUseAppColors,false); 240 addItemBool("UseAppColors",&mUseAppColors,false);
247 241
248 242
249 243
250 KPrefs::setCurrentGroup("Views"); 244 KPrefs::setCurrentGroup("Views");
251 addItemInt("Hour Size",&mHourSize,8); 245 addItemInt("Hour Size",&mHourSize,8);
252 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 246 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
253 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 247 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
254 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 248 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
255 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 249 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
256 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 250 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
257 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 251 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
258 addItemBool("Enable ToolTips",&mEnableToolTips,false); 252 addItemBool("Enable ToolTips",&mEnableToolTips,false);
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 06470b8..c3e9f75 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1169,100 +1169,100 @@ void MainWindow::keyBindings()
1169 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1169 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1170 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1170 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1171 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1171 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1172 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1172 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1173 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1173 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1174 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1174 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1175 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1175 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1176 i18n("<p><b>White</b>: Item readonly</p>\n"); 1176 i18n("<p><b>White</b>: Item readonly</p>\n");
1177 displayText( text, cap); 1177 displayText( text, cap);
1178 1178
1179} 1179}
1180void MainWindow::aboutAutoSaving() 1180void MainWindow::aboutAutoSaving()
1181{ 1181{
1182 QMessageBox* msg; 1182 QMessageBox* msg;
1183 msg = new QMessageBox( i18n("Auto Saving in KOrganizer/Pi"), 1183 msg = new QMessageBox( i18n("Auto Saving in KOrganizer/Pi"),
1184 i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configureable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"), QMessageBox::NoIcon, 1184 i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configureable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"), QMessageBox::NoIcon,
1185 QMessageBox::Ok, 1185 QMessageBox::Ok,
1186 QMessageBox::NoButton, 1186 QMessageBox::NoButton,
1187 QMessageBox::NoButton); 1187 QMessageBox::NoButton);
1188 msg->exec(); 1188 msg->exec();
1189 delete msg; 1189 delete msg;
1190 1190
1191 1191
1192} 1192}
1193void MainWindow::aboutKnownBugs() 1193void MainWindow::aboutKnownBugs()
1194{ 1194{
1195 QMessageBox* msg; 1195 QMessageBox* msg;
1196 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1196 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1197 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ 1197 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+
1198 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1198 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1199 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") + 1199 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") +
1200 i18n("\nor report them in the bugtracker on\n") + 1200 i18n("\nor report them in the bugtracker on\n") +
1201 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1201 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1202 QMessageBox::NoIcon, 1202 QMessageBox::NoIcon,
1203 QMessageBox::Ok, 1203 QMessageBox::Ok,
1204 QMessageBox::NoButton, 1204 QMessageBox::NoButton,
1205 QMessageBox::NoButton); 1205 QMessageBox::NoButton);
1206 msg->exec(); 1206 msg->exec();
1207 delete msg; 1207 delete msg;
1208 1208
1209} 1209}
1210 1210
1211QString MainWindow::defaultFileName() 1211QString MainWindow::defaultFileName()
1212{ 1212{
1213 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1213 return locateLocal( "data", "korganizer/mycalendar.ics" );
1214} 1214}
1215QString MainWindow::syncFileName() 1215QString MainWindow::syncFileName()
1216{ 1216{
1217#ifdef _WIN32_ 1217#ifdef DESKTOP_VERSION
1218 return locateLocal( "tmp", "synccalendar.ics" ); 1218 return locateLocal( "tmp", "synccalendar.ics" );
1219#else 1219#else
1220 return QString( "/tmp/kopitempfile.ics" ); 1220 return QString( "/tmp/synccalendar.ics" );
1221#endif 1221#endif
1222} 1222}
1223 1223
1224void MainWindow::processIncidenceSelection( Incidence *incidence ) 1224void MainWindow::processIncidenceSelection( Incidence *incidence )
1225{ 1225{
1226 if ( !incidence ) { 1226 if ( !incidence ) {
1227 enableIncidenceActions( false ); 1227 enableIncidenceActions( false );
1228 1228
1229 mNewSubTodoAction->setEnabled( false ); 1229 mNewSubTodoAction->setEnabled( false );
1230 setCaptionToDates(); 1230 setCaptionToDates();
1231 return; 1231 return;
1232 1232
1233 } 1233 }
1234 1234
1235 //KGlobal::locale()->formatDateTime(nextA, true); 1235 //KGlobal::locale()->formatDateTime(nextA, true);
1236 QString startString = ""; 1236 QString startString = "";
1237 if ( incidence->type() != "Todo" ) { 1237 if ( incidence->type() != "Todo" ) {
1238 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1238 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1239 if ( incidence->doesFloat() ) { 1239 if ( incidence->doesFloat() ) {
1240 startString += ": "+incidence->dtStartDateStr( true ); 1240 startString += ": "+incidence->dtStartDateStr( true );
1241 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1241 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1242 1242
1243 } else { 1243 } else {
1244 startString = ": "+incidence->dtStartStr(true); 1244 startString = ": "+incidence->dtStartStr(true);
1245 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1245 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1246 1246
1247 } 1247 }
1248 1248
1249 } else { 1249 } else {
1250 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1250 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1251 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1251 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1252 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1252 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1253 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1253 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1254 } 1254 }
1255 1255
1256 } 1256 }
1257 else 1257 else
1258 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1258 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1259 if ( !incidence->location().isEmpty() ) 1259 if ( !incidence->location().isEmpty() )
1260 startString += " (" +incidence->location()+")"; 1260 startString += " (" +incidence->location()+")";
1261 setCaption( incidence->summary()+startString); 1261 setCaption( incidence->summary()+startString);
1262 1262
1263 enableIncidenceActions( true ); 1263 enableIncidenceActions( true );
1264 1264
1265 if ( incidence->type() == "Event" ) { 1265 if ( incidence->type() == "Event" ) {
1266 mShowAction->setText( i18n("Show Event...") ); 1266 mShowAction->setText( i18n("Show Event...") );
1267 mEditAction->setText( i18n("Edit Event...") ); 1267 mEditAction->setText( i18n("Edit Event...") );
1268 mDeleteAction->setText( i18n("Delete Event...") ); 1268 mDeleteAction->setText( i18n("Delete Event...") );
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp
index 101db57..900fc04 100644
--- a/libkcal/phoneformat.cpp
+++ b/libkcal/phoneformat.cpp
@@ -245,97 +245,97 @@ ulong PhoneFormat::getCsumEvent( Event* event )
245 } else { 245 } else {
246 list.append( "0" ); 246 list.append( "0" );
247 list.append( "20991231T000000" ); 247 list.append( "20991231T000000" );
248 } 248 }
249 249
250 } 250 }
251 attList << list.join(""); 251 attList << list.join("");
252 attList << event->categoriesStr(); 252 attList << event->categoriesStr();
253 //qDebug("csum cat %s", event->categoriesStr().latin1()); 253 //qDebug("csum cat %s", event->categoriesStr().latin1());
254 254
255 attList << event->secrecyStr(); 255 attList << event->secrecyStr();
256 return PhoneFormat::getCsum(attList ); 256 return PhoneFormat::getCsum(attList );
257} 257}
258ulong PhoneFormat::getCsum( const QStringList & attList) 258ulong PhoneFormat::getCsum( const QStringList & attList)
259{ 259{
260 int max = attList.count(); 260 int max = attList.count();
261 ulong cSum = 0; 261 ulong cSum = 0;
262 int j,k,i; 262 int j,k,i;
263 int add; 263 int add;
264 for ( i = 0; i < max ; ++i ) { 264 for ( i = 0; i < max ; ++i ) {
265 QString s = attList[i]; 265 QString s = attList[i];
266 if ( ! s.isEmpty() ){ 266 if ( ! s.isEmpty() ){
267 j = s.length(); 267 j = s.length();
268 for ( k = 0; k < j; ++k ) { 268 for ( k = 0; k < j; ++k ) {
269 int mul = k +1; 269 int mul = k +1;
270 add = s[k].unicode (); 270 add = s[k].unicode ();
271 if ( k < 16 ) 271 if ( k < 16 )
272 mul = mul * mul; 272 mul = mul * mul;
273 int ii = i+1; 273 int ii = i+1;
274 add = add * mul *ii*ii*ii; 274 add = add * mul *ii*ii*ii;
275 cSum += add; 275 cSum += add;
276 } 276 }
277 } 277 }
278 278
279 } 279 }
280 //QString dump = attList.join(","); 280 //QString dump = attList.join(",");
281 //qDebug("csum: %d %s", cSum,dump.latin1()); 281 //qDebug("csum: %d %s", cSum,dump.latin1());
282 282
283 return cSum; 283 return cSum;
284 284
285} 285}
286//extern "C" GSM_Error GSM_InitConnection(GSM_StateMachine *s, int ReplyNum); 286//extern "C" GSM_Error GSM_InitConnection(GSM_StateMachine *s, int ReplyNum);
287#include <stdlib.h> 287#include <stdlib.h>
288#define DEBUGMODE false 288#define DEBUGMODE false
289bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) 289bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
290{ 290{
291 291
292 QString fileName; 292 QString fileName;
293#ifdef _WIN32_ 293#ifdef DESKTOP_VERSION
294 fileName = locateLocal("tmp", "phonefile.vcs"); 294 fileName = locateLocal("tmp", "phonefile.vcs");
295#else 295#else
296 fileName = "/tmp/phonefile.vcs"; 296 fileName = "/tmp/phonefile.vcs";
297#endif 297#endif
298 QString command; 298 QString command;
299 if ( ! PhoneAccess::readFromPhone( fileName )) { 299 if ( ! PhoneAccess::readFromPhone( fileName )) {
300 return false; 300 return false;
301 } 301 }
302 VCalFormat vfload; 302 VCalFormat vfload;
303 vfload.setLocalTime ( true ); 303 vfload.setLocalTime ( true );
304 qDebug("loading file ..."); 304 qDebug("loading file ...");
305 305
306 if ( ! vfload.load( calendar, fileName ) ) 306 if ( ! vfload.load( calendar, fileName ) )
307 return false; 307 return false;
308 QPtrList<Event> er = calendar->rawEvents(); 308 QPtrList<Event> er = calendar->rawEvents();
309 Event* ev = er.first(); 309 Event* ev = er.first();
310 qDebug("reading events... "); 310 qDebug("reading events... ");
311 while ( ev ) { 311 while ( ev ) {
312 QStringList cat = ev->categories(); 312 QStringList cat = ev->categories();
313 if ( cat.contains( "MeetingDEF" )) { 313 if ( cat.contains( "MeetingDEF" )) {
314 ev->setCategories( QStringList() ); 314 ev->setCategories( QStringList() );
315 } else 315 } else
316 if ( cat.contains( "Birthday" )) { 316 if ( cat.contains( "Birthday" )) {
317 ev->setFloats( true ); 317 ev->setFloats( true );
318 QDate da = ev->dtStart().date(); 318 QDate da = ev->dtStart().date();
319 ev->setDtStart( QDateTime( da) ); 319 ev->setDtStart( QDateTime( da) );
320 ev->setDtEnd( QDateTime( da.addDays(1)) ); 320 ev->setDtEnd( QDateTime( da.addDays(1)) );
321 321
322 } 322 }
323 uint cSum; 323 uint cSum;
324 cSum = PhoneFormat::getCsumEvent( ev ); 324 cSum = PhoneFormat::getCsumEvent( ev );
325 int id = ev->pilotId(); 325 int id = ev->pilotId();
326 Event *event; 326 Event *event;
327 event = existingCal->event( mProfileName ,QString::number( id ) ); 327 event = existingCal->event( mProfileName ,QString::number( id ) );
328 if ( event ) { 328 if ( event ) {
329 event = (Event*)event->clone(); 329 event = (Event*)event->clone();
330 copyEvent( event, ev ); 330 copyEvent( event, ev );
331 calendar->deleteEvent( ev ); 331 calendar->deleteEvent( ev );
332 calendar->addEvent( event); 332 calendar->addEvent( event);
333 } 333 }
334 else 334 else
335 event = ev; 335 event = ev;
336 event->setCsum( mProfileName, QString::number( cSum )); 336 event->setCsum( mProfileName, QString::number( cSum ));
337 event->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); 337 event->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL );
338 event->setID( mProfileName,QString::number( id ) ); 338 event->setID( mProfileName,QString::number( id ) );
339 ev = er.next(); 339 ev = er.next();
340 } 340 }
341 { 341 {
@@ -432,97 +432,97 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from )
432 to->clearAlarms(); 432 to->clearAlarms();
433 Alarm *a = from->alarms().first(); 433 Alarm *a = from->alarms().first();
434 Alarm *b = to->newAlarm( ); 434 Alarm *b = to->newAlarm( );
435 b->setEnabled( a->enabled() ); 435 b->setEnabled( a->enabled() );
436 b->setStartOffset(Duration( a->offset() ) ); 436 b->setStartOffset(Duration( a->offset() ) );
437 } 437 }
438 438
439 QStringList cat = to->categories(); 439 QStringList cat = to->categories();
440 QStringList catFrom = from->categories(); 440 QStringList catFrom = from->categories();
441 QString nCat; 441 QString nCat;
442 int iii; 442 int iii;
443 for ( iii = 0; iii < catFrom.count();++iii ) { 443 for ( iii = 0; iii < catFrom.count();++iii ) {
444 nCat = catFrom[iii]; 444 nCat = catFrom[iii];
445 if ( !nCat.isEmpty() ) 445 if ( !nCat.isEmpty() )
446 if ( !cat.contains( nCat )) { 446 if ( !cat.contains( nCat )) {
447 cat << nCat; 447 cat << nCat;
448 } 448 }
449 } 449 }
450 to->setCategories( cat ); 450 to->setCategories( cat );
451 if ( from->isCompleted() ) { 451 if ( from->isCompleted() ) {
452 to->setCompleted( true ); 452 to->setCompleted( true );
453 if( from->completed().isValid() ) 453 if( from->completed().isValid() )
454 to->setCompleted( from->completed() ); 454 to->setCompleted( from->completed() );
455 } else { 455 } else {
456 // set percentcomplete only, if to->isCompleted() 456 // set percentcomplete only, if to->isCompleted()
457 if ( to->isCompleted() ) 457 if ( to->isCompleted() )
458 to->setPercentComplete(from->percentComplete()); 458 to->setPercentComplete(from->percentComplete());
459 } 459 }
460 if( to->priority() == 2 && from->priority() == 1 ) 460 if( to->priority() == 2 && from->priority() == 1 )
461 ; //skip 461 ; //skip
462 else if (to->priority() == 4 && from->priority() == 5 ) 462 else if (to->priority() == 4 && from->priority() == 5 )
463 ; 463 ;
464 else 464 else
465 to->setPriority(from->priority()); 465 to->setPriority(from->priority());
466 466
467} 467}
468#include <qcstring.h> 468#include <qcstring.h>
469 469
470void PhoneFormat::afterSave( Incidence* inc,const QString& id ,const QString& csum) 470void PhoneFormat::afterSave( Incidence* inc,const QString& id ,const QString& csum)
471{ 471{
472 inc->setID( mProfileName, id ); 472 inc->setID( mProfileName, id );
473 inc->setCsum( mProfileName, csum); 473 inc->setCsum( mProfileName, csum);
474 inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); 474 inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID );
475 475
476} 476}
477 477
478bool PhoneFormat::writeToPhone( Calendar * calendar) 478bool PhoneFormat::writeToPhone( Calendar * calendar)
479{ 479{
480#ifdef _WIN32_ 480#ifdef DESKTOP_VERSION
481 QString fileName = locateLocal("tmp", "phonefile.vcs"); 481 QString fileName = locateLocal("tmp", "phonefile.vcs");
482#else 482#else
483 QString fileName = "/tmp/phonefile.vcs"; 483 QString fileName = "/tmp/phonefile.vcs";
484#endif 484#endif
485 485
486 VCalFormat vfsave; 486 VCalFormat vfsave;
487 vfsave.setLocalTime ( true ); 487 vfsave.setLocalTime ( true );
488 QString id = calendar->timeZoneId(); 488 QString id = calendar->timeZoneId();
489 calendar->setLocalTime(); 489 calendar->setLocalTime();
490 if ( ! vfsave.save( calendar, fileName ) ) 490 if ( ! vfsave.save( calendar, fileName ) )
491 return false; 491 return false;
492 calendar->setTimeZoneId( id ); 492 calendar->setTimeZoneId( id );
493 return PhoneAccess::writeToPhone( fileName ); 493 return PhoneAccess::writeToPhone( fileName );
494} 494}
495bool PhoneFormat::save( Calendar *calendar) 495bool PhoneFormat::save( Calendar *calendar)
496{ 496{
497 497
498 498
499 // 1 remove events which should be deleted 499 // 1 remove events which should be deleted
500 QPtrList<Event> er = calendar->rawEvents(); 500 QPtrList<Event> er = calendar->rawEvents();
501 Event* ev = er.first(); 501 Event* ev = er.first();
502 while ( ev ) { 502 while ( ev ) {
503 if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { 503 if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) {
504 calendar->deleteEvent( ev ); 504 calendar->deleteEvent( ev );
505 } else { 505 } else {
506 506
507 } 507 }
508 ev = er.next(); 508 ev = er.next();
509 } 509 }
510 // 2 remove todos which should be deleted 510 // 2 remove todos which should be deleted
511 QPtrList<Todo> tl = calendar->rawTodos(); 511 QPtrList<Todo> tl = calendar->rawTodos();
512 Todo* to = tl.first(); 512 Todo* to = tl.first();
513 while ( to ) { 513 while ( to ) {
514 if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { 514 if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) {
515 calendar->deleteTodo( to ); 515 calendar->deleteTodo( to );
516 } else { 516 } else {
517 if ( to->isCompleted()) { 517 if ( to->isCompleted()) {
518 calendar->deleteTodo( to ); 518 calendar->deleteTodo( to );
519 } 519 }
520 } 520 }
521 to = tl.next(); 521 to = tl.next();
522 } 522 }
523 // 3 save file 523 // 3 save file
524 if ( !writeToPhone( calendar ) ) 524 if ( !writeToPhone( calendar ) )
525 return false; 525 return false;
526 QLabel status ( i18n(" Opening device ..."), 0 ); 526 QLabel status ( i18n(" Opening device ..."), 0 );
527 int w = status.sizeHint().width()+20 ; 527 int w = status.sizeHint().width()+20 ;
528 if ( w < 200 ) w = 230; 528 if ( w < 200 ) w = 230;
diff --git a/version b/version
index de8a794..0c43deb 100644
--- a/version
+++ b/version
@@ -1 +1 @@
version = "1.9.8"; version = "1.9.9";