summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
Unidiff
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index e029fdb..eb3a6cd 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1373,98 +1373,97 @@ void KOAgendaView::readSettings()
1373void KOAgendaView::readSettings(KConfig *config) 1373void KOAgendaView::readSettings(KConfig *config)
1374{ 1374{
1375 // kdDebug() << "KOAgendaView::readSettings()" << endl; 1375 // kdDebug() << "KOAgendaView::readSettings()" << endl;
1376 1376
1377 config->setGroup("Views"); 1377 config->setGroup("Views");
1378 1378
1379 //#ifndef KORG_NOSPLITTER 1379 //#ifndef KORG_NOSPLITTER
1380 QValueList<int> sizes = config->readIntListEntry("Separator AgendaView"); 1380 QValueList<int> sizes = config->readIntListEntry("Separator AgendaView");
1381 if (sizes.count() == 2) { 1381 if (sizes.count() == 2) {
1382 if ( sizes[0] < 20 ) { 1382 if ( sizes[0] < 20 ) {
1383 sizes[1] = sizes[1] +20 - sizes[0]; 1383 sizes[1] = sizes[1] +20 - sizes[0];
1384 sizes[0] = 20; 1384 sizes[0] = 20;
1385 } 1385 }
1386 mSplitterAgenda->setSizes(sizes); 1386 mSplitterAgenda->setSizes(sizes);
1387 // qDebug("read %d %d ",sizes[0],sizes[1] ); 1387 // qDebug("read %d %d ",sizes[0],sizes[1] );
1388 } 1388 }
1389 //#endif 1389 //#endif
1390 1390
1391 // updateConfig(); 1391 // updateConfig();
1392} 1392}
1393 1393
1394void KOAgendaView::writeSettings(KConfig *config) 1394void KOAgendaView::writeSettings(KConfig *config)
1395{ 1395{
1396 // kdDebug() << "KOAgendaView::writeSettings()" << endl; 1396 // kdDebug() << "KOAgendaView::writeSettings()" << endl;
1397 1397
1398 config->setGroup("Views"); 1398 config->setGroup("Views");
1399 1399
1400 //#ifndef KORG_NOSPLITTER 1400 //#ifndef KORG_NOSPLITTER
1401 QValueList<int> list = mSplitterAgenda->sizes(); 1401 QValueList<int> list = mSplitterAgenda->sizes();
1402 config->writeEntry("Separator AgendaView",list); 1402 config->writeEntry("Separator AgendaView",list);
1403 //qDebug("write %d %d ", list[0],list[1] ); 1403 //qDebug("write %d %d ", list[0],list[1] );
1404 //#endif 1404 //#endif
1405} 1405}
1406 1406
1407void KOAgendaView::setHolidayMasks() 1407void KOAgendaView::setHolidayMasks()
1408{ 1408{
1409 mHolidayMask.resize(mSelectedDates.count()); 1409 mHolidayMask.resize(mSelectedDates.count());
1410 1410
1411 uint i; 1411 uint i;
1412 for(i=0;i<mSelectedDates.count();++i) { 1412 for(i=0;i<mSelectedDates.count();++i) {
1413 QDate date = mSelectedDates[i]; 1413 QDate date = mSelectedDates[i];
1414 bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6); 1414 bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6);
1415 bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); 1415 bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7);
1416 bool showHoliday = false; 1416 bool showHoliday = false;
1417 if ( KOPrefs::instance()->mExcludeHolidays ) { 1417 if ( KOPrefs::instance()->mExcludeHolidays ) {
1418 QPtrList<Event> events = calendar()->events( date, true ); 1418 QPtrList<Event> events = calendar()->events( date, true );
1419 Event *event; 1419 Event *event;
1420 for( event = events.first(); event; event = events.next() ) { 1420 for( event = events.first(); event; event = events.next() ) {
1421 if ( event->categories().contains("Holiday") || 1421 if ( event->isHoliday()) {
1422 event->categories().contains(i18n("Holiday"))) {
1423 showHoliday = true; 1422 showHoliday = true;
1424 break; 1423 break;
1425 } 1424 }
1426 } 1425 }
1427 1426
1428 } 1427 }
1429 1428
1430#ifndef KORG_NOPLUGINS 1429#ifndef KORG_NOPLUGINS
1431 bool showHoliday = KOPrefs::instance()->mExcludeHolidays && 1430 bool showHoliday = KOPrefs::instance()->mExcludeHolidays &&
1432 !KOCore::self()->holiday(date).isEmpty(); 1431 !KOCore::self()->holiday(date).isEmpty();
1433#endif 1432#endif
1434 bool showDay = showSaturday || showSunday || showHoliday; 1433 bool showDay = showSaturday || showSunday || showHoliday;
1435 1434
1436 if (showDay) { 1435 if (showDay) {
1437 mHolidayMask.at(i) = true; 1436 mHolidayMask.at(i) = true;
1438 } else { 1437 } else {
1439 mHolidayMask.at(i) = false; 1438 mHolidayMask.at(i) = false;
1440 } 1439 }
1441 } 1440 }
1442 1441
1443 mAgenda->setHolidayMask(&mHolidayMask); 1442 mAgenda->setHolidayMask(&mHolidayMask);
1444 mAllDayAgenda->setHolidayMask(&mHolidayMask); 1443 mAllDayAgenda->setHolidayMask(&mHolidayMask);
1445} 1444}
1446 1445
1447void KOAgendaView::setContentsPos(int y) 1446void KOAgendaView::setContentsPos(int y)
1448{ 1447{
1449 mAgenda->setContentsPos(0,y); 1448 mAgenda->setContentsPos(0,y);
1450} 1449}
1451 1450
1452void KOAgendaView::setExpandedButton( bool expanded ) 1451void KOAgendaView::setExpandedButton( bool expanded )
1453{ 1452{
1454 if ( expanded ) { 1453 if ( expanded ) {
1455 mExpandButton->setPixmap( mExpandedPixmap ); 1454 mExpandButton->setPixmap( mExpandedPixmap );
1456 } else { 1455 } else {
1457 mExpandButton->setPixmap( mNotExpandedPixmap ); 1456 mExpandButton->setPixmap( mNotExpandedPixmap );
1458 } 1457 }
1459} 1458}
1460 1459
1461void KOAgendaView::clearSelection() 1460void KOAgendaView::clearSelection()
1462{ 1461{
1463 mAgenda->deselectItem(); 1462 mAgenda->deselectItem();
1464 mAllDayAgenda->deselectItem(); 1463 mAllDayAgenda->deselectItem();
1465} 1464}
1466 1465
1467void KOAgendaView::newTimeSpanSelectedAllDay(int gxStart, int gyStart, 1466void KOAgendaView::newTimeSpanSelectedAllDay(int gxStart, int gyStart,
1468 int gxEnd, int gyEnd) 1467 int gxEnd, int gyEnd)
1469{ 1468{
1470 mTimeSpanInAllDay = true; 1469 mTimeSpanInAllDay = true;