summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-05-24 22:30:39 (UTC)
committer zautrix <zautrix>2005-05-24 22:30:39 (UTC)
commitc0ca8beceaa7a366a2d74a82504cad19f4ccd642 (patch) (unidiff)
tree80d7934f39d856801c2491d735455cea1b119e8b /korganizer
parenta3a535e57c53071eb15aa034472d402d619ca84d (diff)
downloadkdepimpi-c0ca8beceaa7a366a2d74a82504cad19f4ccd642.zip
kdepimpi-c0ca8beceaa7a366a2d74a82504cad19f4ccd642.tar.gz
kdepimpi-c0ca8beceaa7a366a2d74a82504cad19f4ccd642.tar.bz2
todo fix
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp6
-rw-r--r--korganizer/korganizer.pro10
-rw-r--r--korganizer/kotodoview.h1
-rw-r--r--korganizer/koviewmanager.cpp5
4 files changed, 17 insertions, 5 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 904bbe2..a8ad467 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1565,194 +1565,196 @@ bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a
1565 ev->setDtEnd( QDateTime(date) ); 1565 ev->setDtEnd( QDateTime(date) );
1566 ev->setFloats( true ); 1566 ev->setFloats( true );
1567 Recurrence * rec = ev->recurrence(); 1567 Recurrence * rec = ev->recurrence();
1568 rec->setYearly(Recurrence::rYearlyMonth,1,-1); 1568 rec->setYearly(Recurrence::rYearlyMonth,1,-1);
1569 rec->addYearlyNum( date.month() ); 1569 rec->addYearlyNum( date.month() );
1570 if ( !mCalendar->addAnniversaryNoDup( ev ) ) { 1570 if ( !mCalendar->addAnniversaryNoDup( ev ) ) {
1571 delete ev; 1571 delete ev;
1572 return false; 1572 return false;
1573 } 1573 }
1574 return true; 1574 return true;
1575 1575
1576} 1576}
1577bool CalendarView::importQtopia( const QString &categories, 1577bool CalendarView::importQtopia( const QString &categories,
1578 const QString &datebook, 1578 const QString &datebook,
1579 const QString &todolist ) 1579 const QString &todolist )
1580{ 1580{
1581 1581
1582 QtopiaFormat qtopiaFormat; 1582 QtopiaFormat qtopiaFormat;
1583 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1583 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1584 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); 1584 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories );
1585 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); 1585 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook );
1586 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); 1586 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist );
1587 1587
1588 updateView(); 1588 updateView();
1589 return true; 1589 return true;
1590 1590
1591#if 0 1591#if 0
1592 mGlobalSyncMode = SYNC_MODE_QTOPIA; 1592 mGlobalSyncMode = SYNC_MODE_QTOPIA;
1593 mCurrentSyncDevice = "qtopia-XML"; 1593 mCurrentSyncDevice = "qtopia-XML";
1594 if ( mSyncManager->mAskForPreferences ) 1594 if ( mSyncManager->mAskForPreferences )
1595 edit_sync_options(); 1595 edit_sync_options();
1596 qApp->processEvents(); 1596 qApp->processEvents();
1597 CalendarLocal* calendar = new CalendarLocal(); 1597 CalendarLocal* calendar = new CalendarLocal();
1598 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1598 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1599 bool syncOK = false; 1599 bool syncOK = false;
1600 QtopiaFormat qtopiaFormat; 1600 QtopiaFormat qtopiaFormat;
1601 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1601 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1602 bool loadOk = true; 1602 bool loadOk = true;
1603 if ( !categories.isEmpty() ) 1603 if ( !categories.isEmpty() )
1604 loadOk = qtopiaFormat.load( calendar, categories ); 1604 loadOk = qtopiaFormat.load( calendar, categories );
1605 if ( loadOk && !datebook.isEmpty() ) 1605 if ( loadOk && !datebook.isEmpty() )
1606 loadOk = qtopiaFormat.load( calendar, datebook ); 1606 loadOk = qtopiaFormat.load( calendar, datebook );
1607 if ( loadOk && !todolist.isEmpty() ) 1607 if ( loadOk && !todolist.isEmpty() )
1608 loadOk = qtopiaFormat.load( calendar, todolist ); 1608 loadOk = qtopiaFormat.load( calendar, todolist );
1609 1609
1610 if ( loadOk ) { 1610 if ( loadOk ) {
1611 getEventViewerDialog()->setSyncMode( true ); 1611 getEventViewerDialog()->setSyncMode( true );
1612 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 1612 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1613 getEventViewerDialog()->setSyncMode( false ); 1613 getEventViewerDialog()->setSyncMode( false );
1614 qApp->processEvents(); 1614 qApp->processEvents();
1615 if ( syncOK ) { 1615 if ( syncOK ) {
1616 if ( mSyncManager->mWriteBackFile ) 1616 if ( mSyncManager->mWriteBackFile )
1617 { 1617 {
1618 // write back XML file 1618 // write back XML file
1619 1619
1620 } 1620 }
1621 setModified( true ); 1621 setModified( true );
1622 } 1622 }
1623 } else { 1623 } else {
1624 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; 1624 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ;
1625 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), 1625 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"),
1626 question, i18n("Ok")) ; 1626 question, i18n("Ok")) ;
1627 } 1627 }
1628 delete calendar; 1628 delete calendar;
1629 updateView(); 1629 updateView();
1630 return syncOK; 1630 return syncOK;
1631 1631
1632 1632
1633#endif 1633#endif
1634 1634
1635} 1635}
1636 1636
1637void CalendarView::setSyncEventsReadOnly() 1637void CalendarView::setSyncEventsReadOnly()
1638{ 1638{
1639 Event * ev; 1639 Event * ev;
1640 QPtrList<Event> eL = mCalendar->rawEvents(); 1640 QPtrList<Event> eL = mCalendar->rawEvents();
1641 ev = eL.first(); 1641 ev = eL.first();
1642 while ( ev ) { 1642 while ( ev ) {
1643 if ( ev->uid().left(15) == QString("last-syncEvent-") ) 1643 if ( ev->uid().left(15) == QString("last-syncEvent-") )
1644 ev->setReadOnly( true ); 1644 ev->setReadOnly( true );
1645 ev = eL.next(); 1645 ev = eL.next();
1646 } 1646 }
1647} 1647}
1648bool CalendarView::openCalendar(QString filename, bool merge) 1648bool CalendarView::openCalendar(QString filename, bool merge)
1649{ 1649{
1650 1650
1651 if (filename.isEmpty()) { 1651 if (filename.isEmpty()) {
1652 return false; 1652 return false;
1653 } 1653 }
1654 1654
1655 if (!QFile::exists(filename)) { 1655 if (!QFile::exists(filename)) {
1656 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); 1656 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename));
1657 return false; 1657 return false;
1658 } 1658 }
1659 1659
1660 globalFlagBlockAgenda = 1; 1660 globalFlagBlockAgenda = 1;
1661 if (!merge) mCalendar->close(); 1661 if (!merge) {
1662 1662 mCalendar->close();
1663 mTodoList->clearList();
1664 }
1663 mStorage->setFileName( filename ); 1665 mStorage->setFileName( filename );
1664 1666
1665 if ( mStorage->load() ) { 1667 if ( mStorage->load() ) {
1666 if ( merge ) ;//setModified( true ); 1668 if ( merge ) ;//setModified( true );
1667 else { 1669 else {
1668 //setModified( true ); 1670 //setModified( true );
1669 mViewManager->setDocumentId( filename ); 1671 mViewManager->setDocumentId( filename );
1670 mDialogManager->setDocumentId( filename ); 1672 mDialogManager->setDocumentId( filename );
1671 mTodoList->setDocumentId( filename ); 1673 mTodoList->setDocumentId( filename );
1672 } 1674 }
1673 globalFlagBlockAgenda = 2; 1675 globalFlagBlockAgenda = 2;
1674 // if ( getLastSyncEvent() ) 1676 // if ( getLastSyncEvent() )
1675 // getLastSyncEvent()->setReadOnly( true ); 1677 // getLastSyncEvent()->setReadOnly( true );
1676 mCalendar->reInitAlarmSettings(); 1678 mCalendar->reInitAlarmSettings();
1677 setSyncEventsReadOnly(); 1679 setSyncEventsReadOnly();
1678 updateUnmanagedViews(); 1680 updateUnmanagedViews();
1679 updateView(); 1681 updateView();
1680 if ( filename != MainWindow::defaultFileName() ) { 1682 if ( filename != MainWindow::defaultFileName() ) {
1681 saveCalendar( MainWindow::defaultFileName() ); 1683 saveCalendar( MainWindow::defaultFileName() );
1682 } else { 1684 } else {
1683 QFileInfo finf ( MainWindow::defaultFileName()); 1685 QFileInfo finf ( MainWindow::defaultFileName());
1684 if ( finf.exists() ) { 1686 if ( finf.exists() ) {
1685 setLoadedFileVersion( finf.lastModified () ); 1687 setLoadedFileVersion( finf.lastModified () );
1686 } 1688 }
1687 } 1689 }
1688 return true; 1690 return true;
1689 } else { 1691 } else {
1690 // while failing to load, the calendar object could 1692 // while failing to load, the calendar object could
1691 // have become partially populated. Clear it out. 1693 // have become partially populated. Clear it out.
1692 if ( !merge ) { 1694 if ( !merge ) {
1693 mCalendar->close(); 1695 mCalendar->close();
1694 mViewManager->setDocumentId( filename ); 1696 mViewManager->setDocumentId( filename );
1695 mDialogManager->setDocumentId( filename ); 1697 mDialogManager->setDocumentId( filename );
1696 mTodoList->setDocumentId( filename ); 1698 mTodoList->setDocumentId( filename );
1697 } 1699 }
1698 1700
1699 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); 1701 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename));
1700 1702
1701 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); 1703 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) );
1702 globalFlagBlockAgenda = 2; 1704 globalFlagBlockAgenda = 2;
1703 mCalendar->reInitAlarmSettings(); 1705 mCalendar->reInitAlarmSettings();
1704 setSyncEventsReadOnly(); 1706 setSyncEventsReadOnly();
1705 updateUnmanagedViews(); 1707 updateUnmanagedViews();
1706 updateView(); 1708 updateView();
1707 } 1709 }
1708 return false; 1710 return false;
1709} 1711}
1710void CalendarView::showOpenError() 1712void CalendarView::showOpenError()
1711{ 1713{
1712 KMessageBox::error(this,i18n("Couldn't load calendar\n.")); 1714 KMessageBox::error(this,i18n("Couldn't load calendar\n."));
1713} 1715}
1714void CalendarView::setLoadedFileVersion(QDateTime dt) 1716void CalendarView::setLoadedFileVersion(QDateTime dt)
1715{ 1717{
1716 loadedFileVersion = dt; 1718 loadedFileVersion = dt;
1717} 1719}
1718bool CalendarView::checkFileChanged(QString fn) 1720bool CalendarView::checkFileChanged(QString fn)
1719{ 1721{
1720 QFileInfo finf ( fn ); 1722 QFileInfo finf ( fn );
1721 if ( !finf.exists() ) 1723 if ( !finf.exists() )
1722 return true; 1724 return true;
1723 QDateTime dt = finf.lastModified (); 1725 QDateTime dt = finf.lastModified ();
1724 if ( dt <= loadedFileVersion ) 1726 if ( dt <= loadedFileVersion )
1725 return false; 1727 return false;
1726 return true; 1728 return true;
1727 1729
1728} 1730}
1729void CalendarView::watchSavedFile() 1731void CalendarView::watchSavedFile()
1730{ 1732{
1731 QFileInfo finf ( MainWindow::defaultFileName()); 1733 QFileInfo finf ( MainWindow::defaultFileName());
1732 if ( !finf.exists() ) 1734 if ( !finf.exists() )
1733 return; 1735 return;
1734 QDateTime dt = finf.lastModified (); 1736 QDateTime dt = finf.lastModified ();
1735 if ( dt < loadedFileVersion ) { 1737 if ( dt < loadedFileVersion ) {
1736 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); 1738 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1());
1737 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); 1739 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) );
1738 return; 1740 return;
1739 } 1741 }
1740 loadedFileVersion = dt; 1742 loadedFileVersion = dt;
1741} 1743}
1742 1744
1743bool CalendarView::checkFileVersion(QString fn) 1745bool CalendarView::checkFileVersion(QString fn)
1744{ 1746{
1745 QFileInfo finf ( fn ); 1747 QFileInfo finf ( fn );
1746 if ( !finf.exists() ) 1748 if ( !finf.exists() )
1747 return true; 1749 return true;
1748 QDateTime dt = finf.lastModified (); 1750 QDateTime dt = finf.lastModified ();
1749 //qDebug("loaded file version %s",loadedFileVersion.toString().latin1()); 1751 //qDebug("loaded file version %s",loadedFileVersion.toString().latin1());
1750 //qDebug("file on disk version %s",dt.toString().latin1()); 1752 //qDebug("file on disk version %s",dt.toString().latin1());
1751 if ( dt <= loadedFileVersion ) 1753 if ( dt <= loadedFileVersion )
1752 return true; 1754 return true;
1753 int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file on disk has changed!\nFile size: %1 bytes.\nLast modified: %2\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) , 1755 int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file on disk has changed!\nFile size: %1 bytes.\nLast modified: %2\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) ,
1754 i18n("KO/Pi Warning"),i18n("Overwrite"), 1756 i18n("KO/Pi Warning"),i18n("Overwrite"),
1755 i18n("Sync+save")); 1757 i18n("Sync+save"));
1756 1758
1757 if ( km == KMessageBox::Cancel ) 1759 if ( km == KMessageBox::Cancel )
1758 return false; 1760 return false;
diff --git a/korganizer/korganizer.pro b/korganizer/korganizer.pro
index d88c300..32ad10a 100644
--- a/korganizer/korganizer.pro
+++ b/korganizer/korganizer.pro
@@ -1,165 +1,171 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on 2 CONFIG = qt warn_on
3 TARGET = kopi 3 TARGET = kopi
4OBJECTS_DIR = _obj/ 4OBJECTS_DIR = _obj/
5MOC_DIR = _moc 5MOC_DIR = _moc
6DESTDIR= ../bin 6DESTDIR= ../bin
7 7
8include( ../variables.pri ) 8include( ../variables.pri )
9 9
10INCLUDEPATH += ../microkde ../ interfaces ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim 10INCLUDEPATH += ../microkde ../ interfaces ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim
11#../qtcompat 11#../qtcompat
12DEFINES += KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL 12DEFINES += KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL
13DEFINES += KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER 13DEFINES += KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER
14#KORG_NOPRINTER KORG_NOKABC KORG_NODND 14#KORG_NOPRINTER KORG_NOKABC KORG_NODND
15DEFINES += KORG_NOLVALTERNATION 15DEFINES += KORG_NOLVALTERNATION
16DEFINES += DESKTOP_VERSION 16DEFINES += DESKTOP_VERSION
17unix : { 17unix : {
18staticlib: { 18staticlib: {
19LIBS += ../bin/libmicrokabc_qtopia.a 19LIBS += ../bin/libmicrokabc_qtopia.a
20LIBS += ../bin/libmicrokabc_file.a 20LIBS += ../bin/libmicrokabc_file.a
21LIBS += ../bin/libmicrokabc_dir.a 21LIBS += ../bin/libmicrokabc_dir.a
22LIBS += ../bin/libmicrokdepim.a 22LIBS += ../bin/libmicrokdepim.a
23LIBS += ../bin/libmicrokcal.a 23LIBS += ../bin/libmicrokcal.a
24LIBS += ../bin/libmicrokabc.a 24LIBS += ../bin/libmicrokabc.a
25LIBS += ../bin/libmicrokde.a 25LIBS += ../bin/libmicrokde.a
26LIBS += ../bin/libmicrokabc_qtopia.a 26LIBS += ../bin/libmicrokabc_qtopia.a
27LIBS += ../bin/libmicrokabc_file.a 27LIBS += ../bin/libmicrokabc_file.a
28LIBS += ../bin/libmicrokabc_dir.a 28LIBS += ../bin/libmicrokabc_dir.a
29LIBS += ../bin/libmicrokdepim.a 29LIBS += ../bin/libmicrokdepim.a
30LIBS += ../bin/libmicrokcal.a 30LIBS += ../bin/libmicrokcal.a
31LIBS += ../bin/libmicrokabc.a 31LIBS += ../bin/libmicrokabc.a
32LIBS += ../bin/libmicrokde.a 32LIBS += ../bin/libmicrokde.a
33LIBS += ../libical/lib/libical.a 33LIBS += ../libical/lib/libical.a
34LIBS += ../libical/lib/libicalss.a 34LIBS += ../libical/lib/libicalss.a
35} else { 35} else {
36LIBS += ../bin/libmicrokdepim.so 36LIBS += ../bin/libmicrokdepim.so
37LIBS += ../bin/libmicrokcal.so 37LIBS += ../bin/libmicrokcal.so
38LIBS += ../bin/libmicrokde.so 38LIBS += ../bin/libmicrokde.so
39LIBS += ../bin/libmicrokabc.so 39LIBS += ../bin/libmicrokabc.so
40#LIBS += -lbluetooth 40#LIBS += -lbluetooth
41#LIBS += -lsdp 41#LIBS += -lsdp
42 42
43#LIBS += -lldap 43#LIBS += -lldap
44} 44}
45OBJECTS_DIR = obj/unix 45OBJECTS_DIR = obj/unix
46MOC_DIR = moc/unix 46MOC_DIR = moc/unix
47} 47}
48win32: { 48win32: {
49RC_FILE = winicons.rc 49RC_FILE = winicons.rc
50DEFINES += _WIN32_ 50DEFINES += _WIN32_
51LIBS += ../bin/microkdepim.lib 51LIBS += ../bin/microkdepim.lib
52LIBS += ../bin/microkcal.lib 52LIBS += ../bin/microkcal.lib
53LIBS += ../bin/microkde.lib 53LIBS += ../bin/microkde.lib
54LIBS += ../bin/microkabc.lib 54LIBS += ../bin/microkabc.lib
55LIBS += ../libical/lib/ical.lib 55LIBS += ../libical/lib/ical.lib
56LIBS += ../libical/lib/icalss.lib 56LIBS += ../libical/lib/icalss.lib
57#LIBS += atls.lib 57#LIBS += atls.lib
58QMAKE_LINK += /NODEFAULTLIB:LIBC 58QMAKE_LINK += /NODEFAULTLIB:LIBC
59#QMAKE_LINK += /NODEFAULTLIB:MSVCRT 59QMAKE_LINK += /NODEFAULTLIB:MSVCRT
60#QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib 60QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib
61OBJECTS_DIR = obj/win 61OBJECTS_DIR = obj/win
62MOC_DIR = moc/win 62MOC_DIR = moc/win
63#olimport section 63#olimport section
64#blabla: { 64#blabla: {
65debug: {
66LIBS += mfc71ud.lib
67}
68release: {
65LIBS += mfc71u.lib 69LIBS += mfc71u.lib
70}
66DEFINES += _OL_IMPORT_ 71DEFINES += _OL_IMPORT_
67 72
68HEADERS += ../outport/msoutl9.h \ 73HEADERS += ../outport/msoutl9.h \
69 koimportoldialog.h 74 koimportoldialog.h
75
70SOURCES += ../outport/msoutl9.cpp \ 76SOURCES += ../outport/msoutl9.cpp \
71 koimportoldialog.cpp 77 koimportoldialog.cpp
72#} 78#}
73#olimport section end 79#olimport section end
74 80
75} 81}
76 82
77 83
78INTERFACES = kofilterview_base.ui 84INTERFACES = kofilterview_base.ui
79#filteredit_base.ui 85#filteredit_base.ui
80 86
81# kdateedit.h \ 87# kdateedit.h \
82 88
83HEADERS += datenavigatorcontainer.h \ 89HEADERS += datenavigatorcontainer.h \
84 filteredit_base.h \ 90 filteredit_base.h \
85 alarmclient.h \ 91 alarmclient.h \
86 calendarview.h \ 92 calendarview.h \
87 customlistviewitem.h \ 93 customlistviewitem.h \
88 datenavigator.h \ 94 datenavigator.h \
89 docprefs.h \ 95 docprefs.h \
90 filtereditdialog.h \ 96 filtereditdialog.h \
91 incomingdialog.h \ 97 incomingdialog.h \
92 incomingdialog_base.h \ 98 incomingdialog_base.h \
93 interfaces/korganizer/baseview.h \ 99 interfaces/korganizer/baseview.h \
94 interfaces/korganizer/calendarviewbase.h \ 100 interfaces/korganizer/calendarviewbase.h \
95 journalentry.h \ 101 journalentry.h \
96 kdatenavigator.h \ 102 kdatenavigator.h \
97 koagenda.h \ 103 koagenda.h \
98 koagendaitem.h \ 104 koagendaitem.h \
99 koagendaview.h \ 105 koagendaview.h \
100 kocounterdialog.h \ 106 kocounterdialog.h \
101 kodaymatrix.h \ 107 kodaymatrix.h \
102 kodialogmanager.h \ 108 kodialogmanager.h \
103 koeditordetails.h \ 109 koeditordetails.h \
104 koeditorgeneral.h \ 110 koeditorgeneral.h \
105 koeditorgeneralevent.h \ 111 koeditorgeneralevent.h \
106 koeditorgeneraltodo.h \ 112 koeditorgeneraltodo.h \
107 koeditorrecurrence.h \ 113 koeditorrecurrence.h \
108 koeventeditor.h \ 114 koeventeditor.h \
109 koeventpopupmenu.h \ 115 koeventpopupmenu.h \
110 koeventview.h \ 116 koeventview.h \
111 koeventviewer.h \ 117 koeventviewer.h \
112 koeventviewerdialog.h \ 118 koeventviewerdialog.h \
113 kofilterview.h \ 119 kofilterview.h \
114 koglobals.h \ 120 koglobals.h \
115 koincidenceeditor.h \ 121 koincidenceeditor.h \
116 kojournalview.h \ 122 kojournalview.h \
117 kolistview.h \ 123 kolistview.h \
118 kolocationbox.h \ 124 kolocationbox.h \
119 komonthview.h \ 125 komonthview.h \
120 koprefs.h \ 126 koprefs.h \
121 koprefsdialog.h \ 127 koprefsdialog.h \
122 kotimespanview.h \ 128 kotimespanview.h \
123 kotodoeditor.h \ 129 kotodoeditor.h \
124 kotodoview.h \ 130 kotodoview.h \
125 kotodoviewitem.h \ 131 kotodoviewitem.h \
126 koviewmanager.h \ 132 koviewmanager.h \
127 kowhatsnextview.h \ 133 kowhatsnextview.h \
128 ktimeedit.h \ 134 ktimeedit.h \
129 lineview.h \ 135 lineview.h \
130 mainwindow.h \ 136 mainwindow.h \
131 navigatorbar.h \ 137 navigatorbar.h \
132 outgoingdialog.h \ 138 outgoingdialog.h \
133 outgoingdialog_base.h \ 139 outgoingdialog_base.h \
134 publishdialog.h \ 140 publishdialog.h \
135 publishdialog_base.h \ 141 publishdialog_base.h \
136 savetemplatedialog.h \ 142 savetemplatedialog.h \
137 searchdialog.h \ 143 searchdialog.h \
138 statusdialog.h \ 144 statusdialog.h \
139 timeline.h \ 145 timeline.h \
140 timespanview.h \ 146 timespanview.h \
141 version.h \ 147 version.h \
142 ../kalarmd/alarmdialog.h \ 148 ../kalarmd/alarmdialog.h \
143 149
144 150
145SOURCES += datenavigatorcontainer.cpp \ 151SOURCES += datenavigatorcontainer.cpp \
146filteredit_base.cpp \ 152filteredit_base.cpp \
147 calendarview.cpp \ 153 calendarview.cpp \
148 datenavigator.cpp \ 154 datenavigator.cpp \
149 docprefs.cpp \ 155 docprefs.cpp \
150 filtereditdialog.cpp \ 156 filtereditdialog.cpp \
151 incomingdialog.cpp \ 157 incomingdialog.cpp \
152 incomingdialog_base.cpp \ 158 incomingdialog_base.cpp \
153 journalentry.cpp \ 159 journalentry.cpp \
154 kdatenavigator.cpp \ 160 kdatenavigator.cpp \
155 koagenda.cpp \ 161 koagenda.cpp \
156 koagendaitem.cpp \ 162 koagendaitem.cpp \
157 koagendaview.cpp \ 163 koagendaview.cpp \
158 kocounterdialog.cpp \ 164 kocounterdialog.cpp \
159 kodaymatrix.cpp \ 165 kodaymatrix.cpp \
160 kodialogmanager.cpp \ 166 kodialogmanager.cpp \
161 koeditordetails.cpp \ 167 koeditordetails.cpp \
162 koeditorgeneral.cpp \ 168 koeditorgeneral.cpp \
163 koeditorgeneralevent.cpp \ 169 koeditorgeneralevent.cpp \
164 koeditorgeneraltodo.cpp \ 170 koeditorgeneraltodo.cpp \
165 koeditorrecurrence.cpp \ 171 koeditorrecurrence.cpp \
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index d368513..1ffc34a 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -46,192 +46,193 @@
46#include "datenavigator.h" 46#include "datenavigator.h"
47 47
48class QDragEnterEvent; 48class QDragEnterEvent;
49class QDragMoveEvent; 49class QDragMoveEvent;
50class QDragLeaveEvent; 50class QDragLeaveEvent;
51class QDropEvent; 51class QDropEvent;
52class KOTodoViewWhatsThis; 52class KOTodoViewWhatsThis;
53 53
54class DocPrefs; 54class DocPrefs;
55 55
56class KOTodoListView : public KListView 56class KOTodoListView : public KListView
57{ 57{
58 Q_OBJECT 58 Q_OBJECT
59 public: 59 public:
60 KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); 60 KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0);
61 virtual ~KOTodoListView() {} 61 virtual ~KOTodoListView() {}
62 62
63 signals: 63 signals:
64 void paintNeeded(); 64 void paintNeeded();
65 void todoDropped(Todo *, int); 65 void todoDropped(Todo *, int);
66 void double_Clicked(QListViewItem *item); 66 void double_Clicked(QListViewItem *item);
67 void reparentTodoSignal( Todo *,Todo * ); 67 void reparentTodoSignal( Todo *,Todo * );
68 void unparentTodoSignal(Todo *); 68 void unparentTodoSignal(Todo *);
69 void deleteTodo( Todo * ); 69 void deleteTodo( Todo * );
70 protected: 70 protected:
71 void wheelEvent (QWheelEvent *e); 71 void wheelEvent (QWheelEvent *e);
72 void contentsDragEnterEvent(QDragEnterEvent *); 72 void contentsDragEnterEvent(QDragEnterEvent *);
73 void contentsDragMoveEvent(QDragMoveEvent *); 73 void contentsDragMoveEvent(QDragMoveEvent *);
74 void contentsDragLeaveEvent(QDragLeaveEvent *); 74 void contentsDragLeaveEvent(QDragLeaveEvent *);
75 void contentsDropEvent(QDropEvent *); 75 void contentsDropEvent(QDropEvent *);
76 76
77 void contentsMousePressEvent(QMouseEvent *); 77 void contentsMousePressEvent(QMouseEvent *);
78 void contentsMouseMoveEvent(QMouseEvent *); 78 void contentsMouseMoveEvent(QMouseEvent *);
79 void contentsMouseReleaseEvent(QMouseEvent *); 79 void contentsMouseReleaseEvent(QMouseEvent *);
80 void contentsMouseDoubleClickEvent(QMouseEvent *); 80 void contentsMouseDoubleClickEvent(QMouseEvent *);
81 81
82 private: 82 private:
83 void paintEvent(QPaintEvent * pevent); 83 void paintEvent(QPaintEvent * pevent);
84 bool internalDrop; 84 bool internalDrop;
85 QString mName; 85 QString mName;
86 Calendar *mCalendar; 86 Calendar *mCalendar;
87 QPoint mPressPos; 87 QPoint mPressPos;
88 bool mMousePressed; 88 bool mMousePressed;
89 QListViewItem *mOldCurrent; 89 QListViewItem *mOldCurrent;
90 bool mFlagKeyPressed; 90 bool mFlagKeyPressed;
91 void keyPressEvent ( QKeyEvent * ) ; 91 void keyPressEvent ( QKeyEvent * ) ;
92 void keyReleaseEvent ( QKeyEvent * ) ; 92 void keyReleaseEvent ( QKeyEvent * ) ;
93}; 93};
94 94
95 95
96/** 96/**
97 This is the line-edit on top of the todoview for fast addition of new todos 97 This is the line-edit on top of the todoview for fast addition of new todos
98*/ 98*/
99class KOQuickTodo : public QLineEdit 99class KOQuickTodo : public QLineEdit
100{ 100{
101 public: 101 public:
102 KOQuickTodo(QWidget *parent=0); 102 KOQuickTodo(QWidget *parent=0);
103 protected: 103 protected:
104 void focusInEvent(QFocusEvent *ev); 104 void focusInEvent(QFocusEvent *ev);
105 void focusOutEvent(QFocusEvent *ev); 105 void focusOutEvent(QFocusEvent *ev);
106}; 106};
107 107
108 108
109/** 109/**
110 This class provides a multi-column list view of todo events. 110 This class provides a multi-column list view of todo events.
111 111
112 @short multi-column list view of todo events. 112 @short multi-column list view of todo events.
113 @author Cornelius Schumacher <schumacher@kde.org> 113 @author Cornelius Schumacher <schumacher@kde.org>
114*/ 114*/
115class KOTodoView : public KOrg::BaseView 115class KOTodoView : public KOrg::BaseView
116{ 116{
117 Q_OBJECT 117 Q_OBJECT
118 public: 118 public:
119 KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); 119 KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 );
120 ~KOTodoView(); 120 ~KOTodoView();
121 121
122 QPtrList<Incidence> selectedIncidences(); 122 QPtrList<Incidence> selectedIncidences();
123 QPtrList<Todo> selectedTodos(); 123 QPtrList<Todo> selectedTodos();
124 124
125 DateList selectedDates() 125 DateList selectedDates()
126 {DateList q; 126 {DateList q;
127 return q;} 127 return q;}
128 128
129 /** Return number of shown dates. TodoView does not show dates, */ 129 /** Return number of shown dates. TodoView does not show dates, */
130 int currentDateCount() { return 0; } 130 int currentDateCount() { return 0; }
131 131
132 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); 132 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td);
133 133
134 void setDocumentId( const QString & ); 134 void setDocumentId( const QString & );
135 135
136 void saveLayout(KConfig *config, const QString &group) const; 136 void saveLayout(KConfig *config, const QString &group) const;
137 void restoreLayout(KConfig *config, const QString &group); 137 void restoreLayout(KConfig *config, const QString &group);
138 /** Create a popup menu to set categories */ 138 /** Create a popup menu to set categories */
139 QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem); 139 QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem);
140 void setNavigator( DateNavigator* nav ) {mNavigator = nav;} 140 void setNavigator( DateNavigator* nav ) {mNavigator = nav;}
141 QString getWhatsThisText(QPoint p); 141 QString getWhatsThisText(QPoint p);
142 void clearList() {mTodoListView->clear(); }
142 143
143 public slots: 144 public slots:
144 void updateView(); 145 void updateView();
145 void updateConfig(); 146 void updateConfig();
146 147
147 void changeEventDisplay(Event *, int); 148 void changeEventDisplay(Event *, int);
148 149
149 void showDates(const QDate &start, const QDate &end); 150 void showDates(const QDate &start, const QDate &end);
150 void showEvents(QPtrList<Event> eventList); 151 void showEvents(QPtrList<Event> eventList);
151 152
152 void clearSelection(); 153 void clearSelection();
153 void jumpToDate (); 154 void jumpToDate ();
154 155
155 void editItem(QListViewItem *item); 156 void editItem(QListViewItem *item);
156 void showItem(QListViewItem *item,const QPoint &,int); 157 void showItem(QListViewItem *item,const QPoint &,int);
157 void popupMenu(QListViewItem *item,const QPoint &,int); 158 void popupMenu(QListViewItem *item,const QPoint &,int);
158 void newTodo(); 159 void newTodo();
159 void newSubTodo(); 160 void newSubTodo();
160 void unparentTodo(); 161 void unparentTodo();
161 void reparentTodo(); 162 void reparentTodo();
162 void showTodo(); 163 void showTodo();
163 void editTodo(); 164 void editTodo();
164 void cloneTodo(); 165 void cloneTodo();
165 void cancelTodo(); 166 void cancelTodo();
166 void moveTodo(); 167 void moveTodo();
167 void beamTodo(); 168 void beamTodo();
168 void deleteTodo(); 169 void deleteTodo();
169 170
170 void setNewPriority(int); 171 void setNewPriority(int);
171 void setNewPercentage(int); 172 void setNewPercentage(int);
172 void changedCategories(int); 173 void changedCategories(int);
173 174
174 void setAllOpen(); 175 void setAllOpen();
175 void setAllClose(); 176 void setAllClose();
176 void setAllFlat(); 177 void setAllFlat();
177 void displayAllFlat(); 178 void displayAllFlat();
178 179
179 void purgeCompleted(); 180 void purgeCompleted();
180 void toggleCompleted(); 181 void toggleCompleted();
181 void toggleRunning(); 182 void toggleRunning();
182 void toggleQuickTodo(); 183 void toggleQuickTodo();
183 void updateTodo( Todo *, int ); 184 void updateTodo( Todo *, int );
184 185
185 void itemClicked(QListViewItem *); 186 void itemClicked(QListViewItem *);
186 void itemStateChanged(QListViewItem *); 187 void itemStateChanged(QListViewItem *);
187 void modified(bool); 188 void modified(bool);
188 void itemDoubleClicked(QListViewItem *item); 189 void itemDoubleClicked(QListViewItem *item);
189 190
190 signals: 191 signals:
191 void newTodoSignal(); 192 void newTodoSignal();
192 void newSubTodoSignal(Todo *); 193 void newSubTodoSignal(Todo *);
193 void unparentTodoSignal(Todo *); 194 void unparentTodoSignal(Todo *);
194 void reparentTodoSignal( Todo *,Todo * ); 195 void reparentTodoSignal( Todo *,Todo * );
195 void showTodoSignal(Todo *); 196 void showTodoSignal(Todo *);
196 197
197 void editTodoSignal(Todo *); 198 void editTodoSignal(Todo *);
198 void deleteTodoSignal(Todo *); 199 void deleteTodoSignal(Todo *);
199 void todoModifiedSignal (Todo *, int); 200 void todoModifiedSignal (Todo *, int);
200 201
201 void isModified(bool); 202 void isModified(bool);
202 void cloneTodoSignal( Incidence * ); 203 void cloneTodoSignal( Incidence * );
203 void cancelTodoSignal( Incidence * ); 204 void cancelTodoSignal( Incidence * );
204 void moveTodoSignal( Incidence * ); 205 void moveTodoSignal( Incidence * );
205 void beamTodoSignal( Incidence * ); 206 void beamTodoSignal( Incidence * );
206 void purgeCompletedSignal(); 207 void purgeCompletedSignal();
207 208
208 protected slots: 209 protected slots:
209 void toggleRunningItem(); 210 void toggleRunningItem();
210 void paintNeeded(); 211 void paintNeeded();
211 void processSelectionChange(); 212 void processSelectionChange();
212 void addQuickTodo(); 213 void addQuickTodo();
213 void setTodoModified( Todo* ); 214 void setTodoModified( Todo* );
214 void todoModified(Todo *, int ); 215 void todoModified(Todo *, int );
215 216
216 private: 217 private:
217 /* 218 /*
218 * the TodoEditor approach is rather unscaling in the long 219 * the TodoEditor approach is rather unscaling in the long
219 * run. 220 * run.
220 * Korganizer keeps it in memory and we need to update 221 * Korganizer keeps it in memory and we need to update
221 * 1. make KOTodoViewItem a QObject again? 222 * 1. make KOTodoViewItem a QObject again?
222 * 2. add a public method for setting one todo modified? 223 * 2. add a public method for setting one todo modified?
223 * 3. add a private method for setting a todo modified + friend here? 224 * 3. add a private method for setting a todo modified + friend here?
224 * -- zecke 2002-07-08 225 * -- zecke 2002-07-08
225 */ 226 */
226 KOTodoViewWhatsThis* mKOTodoViewWhatsThis; 227 KOTodoViewWhatsThis* mKOTodoViewWhatsThis;
227 friend class KOTodoListView; 228 friend class KOTodoListView;
228 void paintEvent(QPaintEvent * pevent); 229 void paintEvent(QPaintEvent * pevent);
229 bool mPendingUpdateBeforeRepaint; 230 bool mPendingUpdateBeforeRepaint;
230 friend class KOTodoViewItem; 231 friend class KOTodoViewItem;
231 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); 232 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo);
232 void restoreItemState( QListViewItem * ); 233 void restoreItemState( QListViewItem * );
233 234
234 bool checkTodo( Todo * ); 235 bool checkTodo( Todo * );
235 bool isFlatDisplay; 236 bool isFlatDisplay;
236 void setOpen( QListViewItem*, bool setOpen); 237 void setOpen( QListViewItem*, bool setOpen);
237 KOTodoListView *mTodoListView; 238 KOTodoListView *mTodoListView;
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 2e5a943..fb4de37 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -738,98 +738,101 @@ void KOViewManager::showTodoView()
738 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), 738 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ),
739 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 739 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
740 740
741 connect( mMainView, SIGNAL( configChanged() ), mTodoView, 741 connect( mMainView, SIGNAL( configChanged() ), mTodoView,
742 SLOT( updateConfig() ) ); 742 SLOT( updateConfig() ) );
743 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, 743 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView,
744 SLOT( updateTodo( Todo *, int ) ) ); 744 SLOT( updateTodo( Todo *, int ) ) );
745 connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), 745 connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ),
746 mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); 746 mMainView, SIGNAL ( todoModified( Todo *, int ) ) );
747 connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), 747 connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ),
748 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 748 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
749 connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), 749 connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ),
750 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 750 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
751 connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), 751 connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ),
752 mMainView, SLOT ( todo_unsub( Todo * ) ) ); 752 mMainView, SLOT ( todo_unsub( Todo * ) ) );
753 connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 753 connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
754 mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); 754 mMainView, SLOT ( todo_resub( Todo *, Todo *) ) );
755 connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), 755 connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ),
756 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 756 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
757 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), 757 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ),
758 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 758 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
759 KConfig *config = KOGlobals::config(); 759 KConfig *config = KOGlobals::config();
760 mTodoView->restoreLayout(config,"Todo View"); 760 mTodoView->restoreLayout(config,"Todo View");
761 mTodoView->setNavigator( mMainView->dateNavigator() ); 761 mTodoView->setNavigator( mMainView->dateNavigator() );
762 } 762 }
763 763
764 KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ; 764 KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ;
765 globalFlagBlockAgenda = 1; 765 globalFlagBlockAgenda = 1;
766 showView( mTodoView, true ); 766 showView( mTodoView, true );
767 KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ; 767 KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ;
768 768
769} 769}
770 770
771void KOViewManager::showJournalView() 771void KOViewManager::showJournalView()
772{ 772{
773 //mFlagShowNextxDays = false; 773 //mFlagShowNextxDays = false;
774 if (!mJournalView) { 774 if (!mJournalView) {
775 mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), 775 mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(),
776 "KOViewManager::JournalView"); 776 "KOViewManager::JournalView");
777 connect( mMainView, SIGNAL( configChanged() ), mJournalView, 777 connect( mMainView, SIGNAL( configChanged() ), mJournalView,
778 SLOT( updateConfig() ) ); 778 SLOT( updateConfig() ) );
779 connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); 779 connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) );
780 addView(mJournalView); 780 addView(mJournalView);
781 } 781 }
782 782
783 KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ; 783 KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ;
784 showView(mJournalView); 784 showView(mJournalView);
785 mMainView->dateNavigator()->selectDates( 1 ); 785 mMainView->dateNavigator()->selectDates( 1 );
786 KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ; 786 KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ;
787} 787}
788 788
789void KOViewManager::showTimeSpanView() 789void KOViewManager::showTimeSpanView()
790{ 790{
791 //mFlagShowNextxDays = false; 791 //mFlagShowNextxDays = false;
792 if (!mTimeSpanView) { 792 if (!mTimeSpanView) {
793 mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), 793 mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(),
794 "KOViewManager::TimeSpanView"); 794 "KOViewManager::TimeSpanView");
795 addView(mTimeSpanView); 795 addView(mTimeSpanView);
796 796
797 mTimeSpanView->readSettings(); 797 mTimeSpanView->readSettings();
798 } 798 }
799 799
800 showView(mTimeSpanView); 800 showView(mTimeSpanView);
801} 801}
802 802
803Incidence *KOViewManager::currentSelection() 803Incidence *KOViewManager::currentSelection()
804{ 804{
805 if (!mCurrentView) return 0; 805 if (!mCurrentView) return 0;
806 if ( mCurrentView == mListView ) { 806 if ( mCurrentView == mListView ) {
807 if ( mListView->currentItem() ) 807 if ( mListView->currentItem() )
808 return mListView->currentItem(); 808 return mListView->currentItem();
809 } 809 }
810 return mCurrentView->selectedIncidences().first(); 810 return mCurrentView->selectedIncidences().first();
811} 811}
812 812
813QDate KOViewManager::currentSelectionDate() 813QDate KOViewManager::currentSelectionDate()
814{ 814{
815 QDate qd; 815 QDate qd;
816 if (mCurrentView) { 816 if (mCurrentView) {
817 DateList qvl = mCurrentView->selectedDates(); 817 DateList qvl = mCurrentView->selectedDates();
818 if (!qvl.isEmpty()) qd = qvl.first(); 818 if (!qvl.isEmpty()) qd = qvl.first();
819 } 819 }
820 return qd; 820 return qd;
821} 821}
822 822
823void KOViewManager::addView(KOrg::BaseView *view) 823void KOViewManager::addView(KOrg::BaseView *view)
824{ 824{
825#if QT_VERSION >= 0x030000 825#if QT_VERSION >= 0x030000
826 mMainView->viewStack()->addWidget( view ); 826 mMainView->viewStack()->addWidget( view );
827#else 827#else
828 mMainView->viewStack()->addWidget( view, 1 ); 828 mMainView->viewStack()->addWidget( view, 1 );
829#endif 829#endif
830} 830}
831 831
832void KOViewManager::setDocumentId( const QString &id ) 832void KOViewManager::setDocumentId( const QString &id )
833{ 833{
834 if (mTodoView) mTodoView->setDocumentId( id ); 834 if (mTodoView) {
835 mTodoView->clearList();
836 mTodoView->setDocumentId( id );
837 }
835} 838}