summaryrefslogtreecommitdiffabout
path: root/libkcal
authorzautrix <zautrix>2004-07-11 09:44:35 (UTC)
committer zautrix <zautrix>2004-07-11 09:44:35 (UTC)
commit2aeb681a7e8a0696608485f36d9c0561ba505c5c (patch) (unidiff)
tree72918e536cb8d447e6e8acb213294299ec09de56 /libkcal
parente5707eabc31da78bc299029de2cefd84d77291cd (diff)
downloadkdepimpi-2aeb681a7e8a0696608485f36d9c0561ba505c5c.zip
kdepimpi-2aeb681a7e8a0696608485f36d9c0561ba505c5c.tar.gz
kdepimpi-2aeb681a7e8a0696608485f36d9c0561ba505c5c.tar.bz2
removed two debug output
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/icalformatimpl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index 964ffe3..3437f45 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -1406,239 +1406,239 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre
1406 else 1406 else
1407 recur->setMinutely(interv,r.count); 1407 recur->setMinutely(interv,r.count);
1408 } 1408 }
1409 break; 1409 break;
1410 case ICAL_HOURLY_RECURRENCE: 1410 case ICAL_HOURLY_RECURRENCE:
1411 if (!icaltime_is_null_time(r.until)) { 1411 if (!icaltime_is_null_time(r.until)) {
1412 recur->setHourly(interv,readICalDateTime(r.until)); 1412 recur->setHourly(interv,readICalDateTime(r.until));
1413 } else { 1413 } else {
1414 if (r.count == 0) 1414 if (r.count == 0)
1415 recur->setHourly(interv,-1); 1415 recur->setHourly(interv,-1);
1416 else 1416 else
1417 recur->setHourly(interv,r.count); 1417 recur->setHourly(interv,r.count);
1418 } 1418 }
1419 break; 1419 break;
1420 case ICAL_DAILY_RECURRENCE: 1420 case ICAL_DAILY_RECURRENCE:
1421 if (!icaltime_is_null_time(r.until)) { 1421 if (!icaltime_is_null_time(r.until)) {
1422 recur->setDaily(interv,readICalDate(r.until)); 1422 recur->setDaily(interv,readICalDate(r.until));
1423 } else { 1423 } else {
1424 if (r.count == 0) 1424 if (r.count == 0)
1425 recur->setDaily(interv,-1); 1425 recur->setDaily(interv,-1);
1426 else 1426 else
1427 recur->setDaily(interv,r.count); 1427 recur->setDaily(interv,r.count);
1428 } 1428 }
1429 break; 1429 break;
1430 case ICAL_WEEKLY_RECURRENCE: 1430 case ICAL_WEEKLY_RECURRENCE:
1431 // kdDebug(5800) << "WEEKLY_RECURRENCE" << endl; 1431 // kdDebug(5800) << "WEEKLY_RECURRENCE" << endl;
1432 wkst = (r.week_start + 5)%7 + 1; 1432 wkst = (r.week_start + 5)%7 + 1;
1433 if (!icaltime_is_null_time(r.until)) { 1433 if (!icaltime_is_null_time(r.until)) {
1434 recur->setWeekly(interv,qba,readICalDate(r.until),wkst); 1434 recur->setWeekly(interv,qba,readICalDate(r.until),wkst);
1435 } else { 1435 } else {
1436 if (r.count == 0) 1436 if (r.count == 0)
1437 recur->setWeekly(interv,qba,-1,wkst); 1437 recur->setWeekly(interv,qba,-1,wkst);
1438 else 1438 else
1439 recur->setWeekly(interv,qba,r.count,wkst); 1439 recur->setWeekly(interv,qba,r.count,wkst);
1440 } 1440 }
1441 if ( r.by_day[0] == ICAL_RECURRENCE_ARRAY_MAX) { 1441 if ( r.by_day[0] == ICAL_RECURRENCE_ARRAY_MAX) {
1442 int wday = incidence->dtStart().date().dayOfWeek ()-1; 1442 int wday = incidence->dtStart().date().dayOfWeek ()-1;
1443 //qDebug("weekly error found "); 1443 //qDebug("weekly error found ");
1444 qba.setBit(wday); 1444 qba.setBit(wday);
1445 } else { 1445 } else {
1446 while((day = r.by_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { 1446 while((day = r.by_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) {
1447 // kdDebug(5800) << " " << day << endl; 1447 // kdDebug(5800) << " " << day << endl;
1448 qba.setBit((day+5)%7); // convert from Sunday=1 to Monday=0 1448 qba.setBit((day+5)%7); // convert from Sunday=1 to Monday=0
1449 } 1449 }
1450 } 1450 }
1451 break; 1451 break;
1452 case ICAL_MONTHLY_RECURRENCE: 1452 case ICAL_MONTHLY_RECURRENCE:
1453 1453
1454 if (r.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { 1454 if (r.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX) {
1455 if (!icaltime_is_null_time(r.until)) { 1455 if (!icaltime_is_null_time(r.until)) {
1456 recur->setMonthly(Recurrence::rMonthlyPos,interv, 1456 recur->setMonthly(Recurrence::rMonthlyPos,interv,
1457 readICalDate(r.until)); 1457 readICalDate(r.until));
1458 } else { 1458 } else {
1459 if (r.count == 0) 1459 if (r.count == 0)
1460 recur->setMonthly(Recurrence::rMonthlyPos,interv,-1); 1460 recur->setMonthly(Recurrence::rMonthlyPos,interv,-1);
1461 else 1461 else
1462 recur->setMonthly(Recurrence::rMonthlyPos,interv,r.count); 1462 recur->setMonthly(Recurrence::rMonthlyPos,interv,r.count);
1463 } 1463 }
1464 bool useSetPos = false; 1464 bool useSetPos = false;
1465 short pos = 0; 1465 short pos = 0;
1466 while((day = r.by_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { 1466 while((day = r.by_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) {
1467 // kdDebug(5800) << "----a " << index << ": " << day << endl; 1467 // kdDebug(5800) << "----a " << index << ": " << day << endl;
1468 pos = icalrecurrencetype_day_position(day); 1468 pos = icalrecurrencetype_day_position(day);
1469 if (pos) { 1469 if (pos) {
1470 day = icalrecurrencetype_day_day_of_week(day); 1470 day = icalrecurrencetype_day_day_of_week(day);
1471 QBitArray ba(7); // don't wipe qba 1471 QBitArray ba(7); // don't wipe qba
1472 ba.setBit((day+5)%7); // convert from Sunday=1 to Monday=0 1472 ba.setBit((day+5)%7); // convert from Sunday=1 to Monday=0
1473 recur->addMonthlyPos(pos,ba); 1473 recur->addMonthlyPos(pos,ba);
1474 } else { 1474 } else {
1475 qba.setBit((day+5)%7); // convert from Sunday=1 to Monday=0 1475 qba.setBit((day+5)%7); // convert from Sunday=1 to Monday=0
1476 useSetPos = true; 1476 useSetPos = true;
1477 } 1477 }
1478 } 1478 }
1479 if (useSetPos) { 1479 if (useSetPos) {
1480 if (r.by_set_pos[0] != ICAL_RECURRENCE_ARRAY_MAX) { 1480 if (r.by_set_pos[0] != ICAL_RECURRENCE_ARRAY_MAX) {
1481 recur->addMonthlyPos(r.by_set_pos[0],qba); 1481 recur->addMonthlyPos(r.by_set_pos[0],qba);
1482 } 1482 }
1483 } 1483 }
1484 } else if (r.by_month_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { 1484 } else if (r.by_month_day[0] != ICAL_RECURRENCE_ARRAY_MAX) {
1485 if (!icaltime_is_null_time(r.until)) { 1485 if (!icaltime_is_null_time(r.until)) {
1486 recur->setMonthly(Recurrence::rMonthlyDay,interv, 1486 recur->setMonthly(Recurrence::rMonthlyDay,interv,
1487 readICalDate(r.until)); 1487 readICalDate(r.until));
1488 } else { 1488 } else {
1489 if (r.count == 0) 1489 if (r.count == 0)
1490 recur->setMonthly(Recurrence::rMonthlyDay,interv,-1); 1490 recur->setMonthly(Recurrence::rMonthlyDay,interv,-1);
1491 else 1491 else
1492 recur->setMonthly(Recurrence::rMonthlyDay,interv,r.count); 1492 recur->setMonthly(Recurrence::rMonthlyDay,interv,r.count);
1493 } 1493 }
1494 while((day = r.by_month_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { 1494 while((day = r.by_month_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) {
1495 // kdDebug(5800) << "----b " << day << endl; 1495 // kdDebug(5800) << "----b " << day << endl;
1496 recur->addMonthlyDay(day); 1496 recur->addMonthlyDay(day);
1497 } 1497 }
1498 } 1498 }
1499 break; 1499 break;
1500 case ICAL_YEARLY_RECURRENCE: 1500 case ICAL_YEARLY_RECURRENCE:
1501 if (r.by_year_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { 1501 if (r.by_year_day[0] != ICAL_RECURRENCE_ARRAY_MAX) {
1502 qDebug(" YEARLY DAY OF YEAR"); 1502 //qDebug(" YEARLY DAY OF YEAR");
1503 if (!icaltime_is_null_time(r.until)) { 1503 if (!icaltime_is_null_time(r.until)) {
1504 recur->setYearly(Recurrence::rYearlyDay,interv, 1504 recur->setYearly(Recurrence::rYearlyDay,interv,
1505 readICalDate(r.until)); 1505 readICalDate(r.until));
1506 } else { 1506 } else {
1507 if (r.count == 0) 1507 if (r.count == 0)
1508 recur->setYearly(Recurrence::rYearlyDay,interv,-1); 1508 recur->setYearly(Recurrence::rYearlyDay,interv,-1);
1509 else 1509 else
1510 recur->setYearly(Recurrence::rYearlyDay,interv,r.count); 1510 recur->setYearly(Recurrence::rYearlyDay,interv,r.count);
1511 } 1511 }
1512 while((day = r.by_year_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { 1512 while((day = r.by_year_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) {
1513 recur->addYearlyNum(day); 1513 recur->addYearlyNum(day);
1514 } 1514 }
1515 } else if ( true /*r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX*/) { 1515 } else if ( true /*r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX*/) {
1516 if (r.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { 1516 if (r.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX) {
1517 qDebug("YEARLY POS NOT SUPPORTED BY GUI"); 1517 qDebug("YEARLY POS NOT SUPPORTED BY GUI");
1518 if (!icaltime_is_null_time(r.until)) { 1518 if (!icaltime_is_null_time(r.until)) {
1519 recur->setYearly(Recurrence::rYearlyPos,interv, 1519 recur->setYearly(Recurrence::rYearlyPos,interv,
1520 readICalDate(r.until)); 1520 readICalDate(r.until));
1521 } else { 1521 } else {
1522 if (r.count == 0) 1522 if (r.count == 0)
1523 recur->setYearly(Recurrence::rYearlyPos,interv,-1); 1523 recur->setYearly(Recurrence::rYearlyPos,interv,-1);
1524 else 1524 else
1525 recur->setYearly(Recurrence::rYearlyPos,interv,r.count); 1525 recur->setYearly(Recurrence::rYearlyPos,interv,r.count);
1526 } 1526 }
1527 bool useSetPos = false; 1527 bool useSetPos = false;
1528 short pos = 0; 1528 short pos = 0;
1529 while((day = r.by_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { 1529 while((day = r.by_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) {
1530 // kdDebug(5800) << "----a " << index << ": " << day << endl; 1530 // kdDebug(5800) << "----a " << index << ": " << day << endl;
1531 pos = icalrecurrencetype_day_position(day); 1531 pos = icalrecurrencetype_day_position(day);
1532 if (pos) { 1532 if (pos) {
1533 day = icalrecurrencetype_day_day_of_week(day); 1533 day = icalrecurrencetype_day_day_of_week(day);
1534 QBitArray ba(7); // don't wipe qba 1534 QBitArray ba(7); // don't wipe qba
1535 ba.setBit((day+5)%7); // convert from Sunday=1 to Monday=0 1535 ba.setBit((day+5)%7); // convert from Sunday=1 to Monday=0
1536 recur->addYearlyMonthPos(pos,ba); 1536 recur->addYearlyMonthPos(pos,ba);
1537 } else { 1537 } else {
1538 qba.setBit((day+5)%7); // convert from Sunday=1 to Monday=0 1538 qba.setBit((day+5)%7); // convert from Sunday=1 to Monday=0
1539 useSetPos = true; 1539 useSetPos = true;
1540 } 1540 }
1541 } 1541 }
1542 if (useSetPos) { 1542 if (useSetPos) {
1543 if (r.by_set_pos[0] != ICAL_RECURRENCE_ARRAY_MAX) { 1543 if (r.by_set_pos[0] != ICAL_RECURRENCE_ARRAY_MAX) {
1544 recur->addYearlyMonthPos(r.by_set_pos[0],qba); 1544 recur->addYearlyMonthPos(r.by_set_pos[0],qba);
1545 } 1545 }
1546 } 1546 }
1547 } else { 1547 } else {
1548 qDebug("YEARLY MONTH "); 1548 //qDebug("YEARLY MONTH ");
1549 if (!icaltime_is_null_time(r.until)) { 1549 if (!icaltime_is_null_time(r.until)) {
1550 recur->setYearly(Recurrence::rYearlyMonth,interv, 1550 recur->setYearly(Recurrence::rYearlyMonth,interv,
1551 readICalDate(r.until)); 1551 readICalDate(r.until));
1552 } else { 1552 } else {
1553 if (r.count == 0) 1553 if (r.count == 0)
1554 recur->setYearly(Recurrence::rYearlyMonth,interv,-1); 1554 recur->setYearly(Recurrence::rYearlyMonth,interv,-1);
1555 else 1555 else
1556 recur->setYearly(Recurrence::rYearlyMonth,interv,r.count); 1556 recur->setYearly(Recurrence::rYearlyMonth,interv,r.count);
1557 } 1557 }
1558 if ( r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX ) { 1558 if ( r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX ) {
1559 index = 0; 1559 index = 0;
1560 while((day = r.by_month[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { 1560 while((day = r.by_month[index++]) != ICAL_RECURRENCE_ARRAY_MAX) {
1561 recur->addYearlyNum(day); 1561 recur->addYearlyNum(day);
1562 } 1562 }
1563 } else { 1563 } else {
1564 recur->addYearlyNum(incidence->dtStart().date().month()); 1564 recur->addYearlyNum(incidence->dtStart().date().month());
1565 } 1565 }
1566 } 1566 }
1567 1567
1568 } 1568 }
1569 break; 1569 break;
1570 default: 1570 default:
1571 ; 1571 ;
1572 break; 1572 break;
1573 } 1573 }
1574} 1574}
1575 1575
1576void ICalFormatImpl::readAlarm(icalcomponent *alarm,Incidence *incidence) 1576void ICalFormatImpl::readAlarm(icalcomponent *alarm,Incidence *incidence)
1577{ 1577{
1578 //kdDebug(5800) << "Read alarm for " << incidence->summary() << endl; 1578 //kdDebug(5800) << "Read alarm for " << incidence->summary() << endl;
1579 1579
1580 Alarm* ialarm = incidence->newAlarm(); 1580 Alarm* ialarm = incidence->newAlarm();
1581 ialarm->setRepeatCount(0); 1581 ialarm->setRepeatCount(0);
1582 ialarm->setEnabled(true); 1582 ialarm->setEnabled(true);
1583 1583
1584 // Determine the alarm's action type 1584 // Determine the alarm's action type
1585 icalproperty *p = icalcomponent_get_first_property(alarm,ICAL_ACTION_PROPERTY); 1585 icalproperty *p = icalcomponent_get_first_property(alarm,ICAL_ACTION_PROPERTY);
1586 if ( !p ) { 1586 if ( !p ) {
1587 return; 1587 return;
1588 } 1588 }
1589 1589
1590 icalproperty_action action = icalproperty_get_action(p); 1590 icalproperty_action action = icalproperty_get_action(p);
1591 Alarm::Type type = Alarm::Display; 1591 Alarm::Type type = Alarm::Display;
1592 switch ( action ) { 1592 switch ( action ) {
1593 case ICAL_ACTION_DISPLAY: type = Alarm::Display; break; 1593 case ICAL_ACTION_DISPLAY: type = Alarm::Display; break;
1594 case ICAL_ACTION_AUDIO: type = Alarm::Audio; break; 1594 case ICAL_ACTION_AUDIO: type = Alarm::Audio; break;
1595 case ICAL_ACTION_PROCEDURE: type = Alarm::Procedure; break; 1595 case ICAL_ACTION_PROCEDURE: type = Alarm::Procedure; break;
1596 case ICAL_ACTION_EMAIL: type = Alarm::Email; break; 1596 case ICAL_ACTION_EMAIL: type = Alarm::Email; break;
1597 default: 1597 default:
1598 ; 1598 ;
1599 return; 1599 return;
1600 } 1600 }
1601 ialarm->setType(type); 1601 ialarm->setType(type);
1602 1602
1603 p = icalcomponent_get_first_property(alarm,ICAL_ANY_PROPERTY); 1603 p = icalcomponent_get_first_property(alarm,ICAL_ANY_PROPERTY);
1604 while (p) { 1604 while (p) {
1605 icalproperty_kind kind = icalproperty_isa(p); 1605 icalproperty_kind kind = icalproperty_isa(p);
1606 1606
1607 switch (kind) { 1607 switch (kind) {
1608 case ICAL_TRIGGER_PROPERTY: { 1608 case ICAL_TRIGGER_PROPERTY: {
1609 icaltriggertype trigger = icalproperty_get_trigger(p); 1609 icaltriggertype trigger = icalproperty_get_trigger(p);
1610 if (icaltime_is_null_time(trigger.time)) { 1610 if (icaltime_is_null_time(trigger.time)) {
1611 if (icaldurationtype_is_null_duration(trigger.duration)) { 1611 if (icaldurationtype_is_null_duration(trigger.duration)) {
1612 kdDebug(5800) << "ICalFormatImpl::readAlarm(): Trigger has no time and no duration." << endl; 1612 kdDebug(5800) << "ICalFormatImpl::readAlarm(): Trigger has no time and no duration." << endl;
1613 } else { 1613 } else {
1614 Duration duration = icaldurationtype_as_int( trigger.duration ); 1614 Duration duration = icaldurationtype_as_int( trigger.duration );
1615 icalparameter *param = icalproperty_get_first_parameter(p,ICAL_RELATED_PARAMETER); 1615 icalparameter *param = icalproperty_get_first_parameter(p,ICAL_RELATED_PARAMETER);
1616 if (param && icalparameter_get_related(param) == ICAL_RELATED_END) 1616 if (param && icalparameter_get_related(param) == ICAL_RELATED_END)
1617 ialarm->setEndOffset(duration); 1617 ialarm->setEndOffset(duration);
1618 else 1618 else
1619 ialarm->setStartOffset(duration); 1619 ialarm->setStartOffset(duration);
1620 } 1620 }
1621 } else { 1621 } else {
1622 ialarm->setTime(readICalDateTime(trigger.time)); 1622 ialarm->setTime(readICalDateTime(trigger.time));
1623 } 1623 }
1624 break; 1624 break;
1625 } 1625 }
1626 case ICAL_DURATION_PROPERTY: { 1626 case ICAL_DURATION_PROPERTY: {
1627 icaldurationtype duration = icalproperty_get_duration(p); 1627 icaldurationtype duration = icalproperty_get_duration(p);
1628 ialarm->setSnoozeTime(icaldurationtype_as_int(duration)/60); 1628 ialarm->setSnoozeTime(icaldurationtype_as_int(duration)/60);
1629 break; 1629 break;
1630 } 1630 }
1631 case ICAL_REPEAT_PROPERTY: 1631 case ICAL_REPEAT_PROPERTY:
1632 ialarm->setRepeatCount(icalproperty_get_repeat(p)); 1632 ialarm->setRepeatCount(icalproperty_get_repeat(p));
1633 break; 1633 break;
1634 1634
1635 // Only in DISPLAY and EMAIL and PROCEDURE alarms 1635 // Only in DISPLAY and EMAIL and PROCEDURE alarms
1636 case ICAL_DESCRIPTION_PROPERTY: { 1636 case ICAL_DESCRIPTION_PROPERTY: {
1637 QString description = QString::fromUtf8(icalproperty_get_description(p)); 1637 QString description = QString::fromUtf8(icalproperty_get_description(p));
1638 switch ( action ) { 1638 switch ( action ) {
1639 case ICAL_ACTION_DISPLAY: 1639 case ICAL_ACTION_DISPLAY:
1640 ialarm->setText( description ); 1640 ialarm->setText( description );
1641 break; 1641 break;
1642 case ICAL_ACTION_PROCEDURE: 1642 case ICAL_ACTION_PROCEDURE:
1643 ialarm->setProgramArguments( description ); 1643 ialarm->setProgramArguments( description );
1644 break; 1644 break;