Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit b1682e10 authored by Laurent Montel's avatar Laurent Montel 😁

Fix Bug 348360 - Creating Event from message, end time dropdown itemslist is...

Fix Bug 348360 - Creating Event from message, end time dropdown itemslist is truncated at around initial start time

FIXED-IN: 4.14.9
BUG: 348360
parent f9c27da9
......@@ -115,6 +115,9 @@ EventEdit::EventEdit(QWidget *parent)
#ifndef QT_NO_ACCESSIBILITY
mEndDateTimeEdit->setAccessibleDescription( i18n("Select end time for event.") );
#endif
connect(mEndDateTimeEdit, SIGNAL(dateTimeChanged(KDateTime)),
this, SLOT(slotEndDateTimeChanged(KDateTime)));
hbox->addWidget(mEndDateTimeEdit);
hbox->addStretch(1);
......@@ -303,6 +306,19 @@ bool EventEdit::eventFilter(QObject *object, QEvent *e)
return QWidget::eventFilter(object,e);
}
void EventEdit::slotEndDateTimeChanged(const KDateTime &newDateTime)
{
if (!newDateTime.isValid()) {
return;
}
KDateTime currentDateTime = KDateTime::currentDateTime(KDateTime::LocalZone);
if (newDateTime.date() > currentDateTime.date()) {
KDateTime newDateDate = newDateTime;
newDateDate.setTime(QTime(0, 0, 0));
mEndDateTimeEdit->setMinimumDateTime(newDateDate);
}
}
void EventEdit::slotStartDateTimeChanged(const KDateTime &newDateTime)
{
if (!newDateTime.isValid()) {
......
......@@ -58,8 +58,8 @@ private Q_SLOTS:
void slotCollectionChanged(int);
void slotOpenEditor();
void slotStartDateTimeChanged(const KDateTime &newDateTime);
void slotUpdateButtons(const QString &subject);
void slotUpdateButtons(const QString &subject);
void slotEndDateTimeChanged(const KDateTime &newDateTime);
Q_SIGNALS:
void createEvent(const KCalCore::Event::Ptr &event, const Akonadi::Collection &collection);
void collectionChanged(const Akonadi::Collection &col);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment