summaryrefslogtreecommitdiffabout
path: root/korganizer/kolistview.cpp
authorzautrix <zautrix>2005-07-07 00:03:44 (UTC)
committer zautrix <zautrix>2005-07-07 00:03:44 (UTC)
commitcb350dbe9151db2ded62942d29d11d6c8b88eabd (patch) (unidiff)
tree3ba8d483461e10afddb67f17cd038118d99513ef /korganizer/kolistview.cpp
parent93bc4dbbef774e28672c947281291b12d5971803 (diff)
downloadkdepimpi-cb350dbe9151db2ded62942d29d11d6c8b88eabd.zip
kdepimpi-cb350dbe9151db2ded62942d29d11d6c8b88eabd.tar.gz
kdepimpi-cb350dbe9151db2ded62942d29d11d6c8b88eabd.tar.bz2
fixessss
Diffstat (limited to 'korganizer/kolistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 5f90dc6..7783dd4 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -926,123 +926,125 @@ DateList KOListView::selectedDates()
926} 926}
927 927
928void KOListView::showDates(bool show) 928void KOListView::showDates(bool show)
929{ 929{
930 // Shouldn't we set it to a value greater 0? When showDates is called with 930 // Shouldn't we set it to a value greater 0? When showDates is called with
931 // show == true at first, then the columnwidths are set to zero. 931 // show == true at first, then the columnwidths are set to zero.
932 static int oldColWidth1 = 0; 932 static int oldColWidth1 = 0;
933 static int oldColWidth3 = 0; 933 static int oldColWidth3 = 0;
934 934
935 if (!show) { 935 if (!show) {
936 oldColWidth1 = mListView->columnWidth(1); 936 oldColWidth1 = mListView->columnWidth(1);
937 oldColWidth3 = mListView->columnWidth(3); 937 oldColWidth3 = mListView->columnWidth(3);
938 mListView->setColumnWidth(1, 0); 938 mListView->setColumnWidth(1, 0);
939 mListView->setColumnWidth(3, 0); 939 mListView->setColumnWidth(3, 0);
940 } else { 940 } else {
941 mListView->setColumnWidth(1, oldColWidth1); 941 mListView->setColumnWidth(1, oldColWidth1);
942 mListView->setColumnWidth(3, oldColWidth3); 942 mListView->setColumnWidth(3, oldColWidth3);
943 } 943 }
944 mListView->repaint(); 944 mListView->repaint();
945} 945}
946 946
947void KOListView::printPreview(CalPrinter *calPrinter, const QDate &fd, 947void KOListView::printPreview(CalPrinter *calPrinter, const QDate &fd,
948 const QDate &td) 948 const QDate &td)
949{ 949{
950#ifndef KORG_NOPRINTER 950#ifndef KORG_NOPRINTER
951 calPrinter->preview(CalPrinter::Day, fd, td); 951 calPrinter->preview(CalPrinter::Day, fd, td);
952#endif 952#endif
953} 953}
954 954
955void KOListView::showDates() 955void KOListView::showDates()
956{ 956{
957 showDates(true); 957 showDates(true);
958} 958}
959 959
960void KOListView::hideDates() 960void KOListView::hideDates()
961{ 961{
962 showDates(false); 962 showDates(false);
963} 963}
964 964
965void KOListView::resetFocus() 965void KOListView::resetFocus()
966{ 966{
967 topLevelWidget()->setActiveWindow(); 967 topLevelWidget()->setActiveWindow();
968 topLevelWidget()->raise(); 968 topLevelWidget()->raise();
969 mListView->setFocus(); 969 mListView->setFocus();
970} 970}
971void KOListView::updateView() 971void KOListView::updateView()
972{ 972{
973 mListView->setFocus(); 973 mListView->setFocus();
974 if ( mListView->firstChild () ) 974 if ( mListView->firstChild () ) {
975 mListView->setCurrentItem( mListView->firstChild () ); 975 mListView->setCurrentItem( mListView->firstChild () );
976 }
977 processSelectionChange( mListView->firstChild () );
976} 978}
977void KOListView::updateConfig() 979void KOListView::updateConfig()
978{ 980{
979 981
980 mListView->setFont ( KOPrefs::instance()->mListViewFont ); 982 mListView->setFont ( KOPrefs::instance()->mListViewFont );
981 updateView(); 983 updateView();
982 984
983} 985}
984void KOListView::setStartDate(const QDate &start) 986void KOListView::setStartDate(const QDate &start)
985{ 987{
986 mStartDate = start; 988 mStartDate = start;
987} 989}
988 990
989void KOListView::showDates(const QDate &start, const QDate &end) 991void KOListView::showDates(const QDate &start, const QDate &end)
990{ 992{
991 clear(); 993 clear();
992 mStartDate = start; 994 mStartDate = start;
993 QDate date = start; 995 QDate date = start;
994 while( date <= end ) { 996 while( date <= end ) {
995 addEvents(calendar()->events(date)); 997 addEvents(calendar()->events(date));
996 addTodos(calendar()->todos(date)); 998 addTodos(calendar()->todos(date));
997 addJournals( calendar()->journals4Date(date) ); 999 addJournals( calendar()->journals4Date(date) );
998 date = date.addDays( 1 ); 1000 date = date.addDays( 1 );
999 } 1001 }
1000 emit incidenceSelected( 0 ); 1002 //emit incidenceSelected( 0 );
1001 updateView(); 1003 updateView();
1002 1004
1003} 1005}
1004 1006
1005void KOListView::addEvents(QPtrList<Event> eventList) 1007void KOListView::addEvents(QPtrList<Event> eventList)
1006{ 1008{
1007 1009
1008 Event *ev; 1010 Event *ev;
1009 for(ev = eventList.first(); ev; ev = eventList.next()) { 1011 for(ev = eventList.first(); ev; ev = eventList.next()) {
1010 addIncidence(ev); 1012 addIncidence(ev);
1011 } 1013 }
1012 if ( !mListView->currentItem() ){ 1014 if ( !mListView->currentItem() ){
1013 updateView(); 1015 updateView();
1014 } 1016 }
1015} 1017}
1016 1018
1017void KOListView::addTodos(QPtrList<Todo> eventList) 1019void KOListView::addTodos(QPtrList<Todo> eventList)
1018{ 1020{
1019 Todo *ev; 1021 Todo *ev;
1020 for(ev = eventList.first(); ev; ev = eventList.next()) { 1022 for(ev = eventList.first(); ev; ev = eventList.next()) {
1021 addIncidence(ev); 1023 addIncidence(ev);
1022 } 1024 }
1023 if ( !mListView->currentItem() ){ 1025 if ( !mListView->currentItem() ){
1024 updateView(); 1026 updateView();
1025 } 1027 }
1026} 1028}
1027void KOListView::addJournals(QPtrList<Journal> eventList) 1029void KOListView::addJournals(QPtrList<Journal> eventList)
1028{ 1030{
1029 Journal *ev; 1031 Journal *ev;
1030 for(ev = eventList.first(); ev; ev = eventList.next()) { 1032 for(ev = eventList.first(); ev; ev = eventList.next()) {
1031 addIncidence(ev); 1033 addIncidence(ev);
1032 } 1034 }
1033 if ( !mListView->currentItem() ){ 1035 if ( !mListView->currentItem() ){
1034 updateView(); 1036 updateView();
1035 } 1037 }
1036} 1038}
1037 1039
1038void KOListView::showCompletedTodos() 1040void KOListView::showCompletedTodos()
1039{ 1041{
1040 mForceShowCompletedTodos = true; 1042 mForceShowCompletedTodos = true;
1041} 1043}
1042void KOListView::addIncidence(Incidence *incidence) 1044void KOListView::addIncidence(Incidence *incidence)
1043{ 1045{
1044 if ( mUidDict.find( incidence->uid() ) ) return; 1046 if ( mUidDict.find( incidence->uid() ) ) return;
1045 1047
1046 // mListView->setFont ( KOPrefs::instance()->mListViewFont ); 1048 // mListView->setFont ( KOPrefs::instance()->mListViewFont );
1047 if ( incidence->typeID() == todoID ) { 1049 if ( incidence->typeID() == todoID ) {
1048 if ( ! mForceShowCompletedTodos ) { 1050 if ( ! mForceShowCompletedTodos ) {