summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp18
-rw-r--r--korganizer/mainwindow.cpp23
-rw-r--r--korganizer/mainwindow.h1
3 files changed, 31 insertions, 11 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 92fd59c..3a16fe6 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -3608,4 +3608,10 @@ void CalendarView::showDates(const DateList &selectedDates)
3608 3608
3609 QDate date = selectedDates.first();
3610 if ( ! date.isValid() ) {
3611 topLevelWidget()->setCaption("");
3612 return;
3613 }
3614
3609 QString selDates; 3615 QString selDates;
3610 selDates = KGlobal::locale()->formatDate( selectedDates.first(), true); 3616 selDates = KGlobal::locale()->formatDate( date, true);
3611 if (selectedDates.first() < selectedDates.last() ) 3617 if (selectedDates.first() < selectedDates.last() )
@@ -3614,11 +3620,11 @@ void CalendarView::showDates(const DateList &selectedDates)
3614 QString addString; 3620 QString addString;
3615 if ( selectedDates.first() == QDateTime::currentDateTime().date() ) 3621 if ( date == QDateTime::currentDateTime().date() )
3616 addString = i18n("Today"); 3622 addString = i18n("Today");
3617 else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) 3623 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
3618 addString = i18n("Tomorrow"); 3624 addString = i18n("Tomorrow");
3619 else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) 3625 else if ( date == QDateTime::currentDateTime().date().addDays(-1) )
3620 addString = i18n("Yesterday"); 3626 addString = i18n("Yesterday");
3621 else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) 3627 else if ( date == QDateTime::currentDateTime().date().addDays(-2) )
3622 addString = i18n("Day before yesterday"); 3628 addString = i18n("Day before yesterday");
3623 else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) 3629 else if ( date == QDateTime::currentDateTime().date().addDays(2) )
3624 addString = i18n("Day after tomorrow"); 3630 addString = i18n("Day after tomorrow");
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 7faf675..7d5cf72 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -143,3 +143,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
143 mFlagKeyPressed = false; 143 mFlagKeyPressed = false;
144 setCaption("KOrganizer/Pi"); 144 setCaption("KO/Pi");
145 KOPrefs *p = KOPrefs::instance(); 145 KOPrefs *p = KOPrefs::instance();
@@ -1854,3 +1854,11 @@ void MainWindow::configureToolBar( int item )
1854} 1854}
1855 1855void MainWindow::setCaption ( const QString & c )
1856{
1857 QString cap = c;
1858 cap.replace( QRegExp("\n"), " " );
1859 cap = cap.stripWhiteSpace();
1860 if ( cap.isEmpty() )
1861 cap = "KO/Pi";
1862 QWidget::setCaption( cap );
1863}
1856void MainWindow::setCaptionToDates() 1864void MainWindow::setCaptionToDates()
@@ -1858,3 +1866,8 @@ void MainWindow::setCaptionToDates()
1858 QString selDates; 1866 QString selDates;
1859 selDates = KGlobal::locale()->formatDate(mView->startDate(), true); 1867 QDate date = mView->startDate();
1868 if ( ! date.isValid() ) {
1869 setCaption("");
1870 return;
1871 }
1872 selDates = KGlobal::locale()->formatDate( date, true);
1860 if (mView->startDate() < mView->endDate() ) 1873 if (mView->startDate() < mView->endDate() )
@@ -1863,5 +1876,5 @@ void MainWindow::setCaptionToDates()
1863 QString addString; 1876 QString addString;
1864 if ( mView->startDate() == QDateTime::currentDateTime().date() ) 1877 if ( date == QDateTime::currentDateTime().date() )
1865 addString = i18n("Today"); 1878 addString = i18n("Today");
1866 else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) ) 1879 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
1867 addString = i18n("Tomorrow"); 1880 addString = i18n("Tomorrow");
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 5808700..7604529 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -52,2 +52,3 @@ class MainWindow : public QMainWindow
52 public slots: 52 public slots:
53 void setCaption ( const QString & );
53 void updateWeekNum(const KCal::DateList &); 54 void updateWeekNum(const KCal::DateList &);