From 34975323367e4a903886cd317b34192f1271a1f2 Mon Sep 17 00:00:00 2001 From: erik Date: Mon, 23 Apr 2007 20:46:34 +0000 Subject: Fix for bug 1844. The display of 12hour (AM/PM) time was broken. It was because the views never bother to check. This fix incorporates the patch submitted by harlekin. Thanks! --- (limited to 'core/pim/datebook/modules/weeklst/datebookweeklstview.cpp') diff --git a/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp b/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp index 82b9c6d..469a60a 100644 --- a/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp +++ b/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp @@ -7,15 +7,16 @@ #include #include +#include #include #include DateBookWeekLstView::DateBookWeekLstView(QValueList &ev, - const QDate &d, bool onM, + const QDate &d, bool onM, bool showAmPm, QWidget* parent, const char* name, WFlags fl) - : QWidget( parent, name, fl ) + : QWidget( parent, name, fl ), ampm(showAmPm) { childs.clear(); m_MainLayout = new QVBoxLayout( this ); @@ -65,17 +66,18 @@ void DateBookWeekLstView::setEvents(QValueList &ev, const QDate w->setPalette(white); QVBoxLayout * tlayout = new QVBoxLayout(w); childs.append(w); - // Header + // Header DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i-dayoffset), bStartOnMonday,w); connect(hdr, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); connect(hdr, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); tlayout->addWidget(hdr); + connect( qApp, SIGNAL(clockChanged(bool)), this, SLOT(slotClockChanged(bool))); // Events while ( (*it).date().dayOfWeek() == dayOrder[i] && it!=ev.end() ) { if(!(((*it).end().hour()==0) && ((*it).end().minute()==0) && ((*it).startDate()!=(*it).date()))) { // Skip events ending at 00:00 starting at another day. - DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,weeklistviewconfig,w); + DateBookWeekLstEvent *l=new DateBookWeekLstEvent(ampm,*it,weeklistviewconfig,w); tlayout->addWidget(l); connect (l, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); connect (l, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); @@ -87,14 +89,14 @@ void DateBookWeekLstView::setEvents(QValueList &ev, const QDate } tlayout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); m_MainLayout->addWidget(w); -/* - QSpacerItem * tmp = new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding); - m_MainLayout->addItem(tmp); -*/ } setUpdatesEnabled(true); } +void DateBookWeekLstView::slotClockChanged( bool ap ) { + ampm = ap; +} + DateBookWeekLstView::~DateBookWeekLstView() {} -- cgit v0.9.0.2