summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Unidiff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 369c7a0..56b3fb0 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1317,27 +1317,28 @@ void CalendarView::syncExternal( int mode )
1317 delete calendar; 1317 delete calendar;
1318 updateView(); 1318 updateView();
1319 return ;//syncOK; 1319 return ;//syncOK;
1320 1320
1321} 1321}
1322void CalendarView::syncSharp() 1322void CalendarView::syncSharp()
1323{ 1323{
1324 syncExternal( 0 ); 1324 syncExternal( 0 );
1325 1325
1326} 1326}
1327 1327
1328 1328
1329#include <kabc/stdaddressbook.h> 1329//#include <kabc/stdaddressbook.h>
1330bool CalendarView::importBday() 1330bool CalendarView::importBday()
1331{ 1331{
1332#if 0
1332 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 1333 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
1333 KABC::AddressBook::Iterator it; 1334 KABC::AddressBook::Iterator it;
1334 int count = 0; 1335 int count = 0;
1335 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1336 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1336 ++count; 1337 ++count;
1337 } 1338 }
1338 QProgressBar bar(count,0 ); 1339 QProgressBar bar(count,0 );
1339 int w = 300; 1340 int w = 300;
1340 if ( QApplication::desktop()->width() < 320 ) 1341 if ( QApplication::desktop()->width() < 320 )
1341 w = 220; 1342 w = 220;
1342 int h = bar.sizeHint().height() ; 1343 int h = bar.sizeHint().height() ;
1343 int dw = QApplication::desktop()->width(); 1344 int dw = QApplication::desktop()->width();
@@ -1360,24 +1361,25 @@ bool CalendarView::importBday()
1360 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) 1361 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) )
1361 ++addCount; 1362 ++addCount;
1362 } 1363 }
1363 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); 1364 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d");
1364 if ( anni.isValid() ){ 1365 if ( anni.isValid() ){
1365 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1366 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1366 if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) 1367 if ( addAnniversary( anni, (*it).assembledName(), a, false ) )
1367 ++addCount; 1368 ++addCount;
1368 } 1369 }
1369 } 1370 }
1370 updateView(); 1371 updateView();
1371 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1372 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1373#endif
1372 return true; 1374 return true;
1373} 1375}
1374 1376
1375bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) 1377bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday)
1376{ 1378{
1377 //qDebug("addAnni "); 1379 //qDebug("addAnni ");
1378 Event * ev = new Event(); 1380 Event * ev = new Event();
1379 if ( a ) { 1381 if ( a ) {
1380 ev->addAttendee( a ); 1382 ev->addAttendee( a );
1381 } 1383 }
1382 QString kind; 1384 QString kind;
1383 if ( birthday ) 1385 if ( birthday )