Commit 8a55450c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

GIT_SILENT: coding style

parent 00f6bbae
......@@ -324,11 +324,11 @@ AlarmDialog::AlarmDialog(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *par
QDBusConnection dbusConn = QDBusConnection::sessionBus();
if (dbusConn.interface()->isServiceRegistered(QString::fromLatin1(s_fdo_notifications_service))) {
OrgFreedesktopDBusPropertiesInterface *propsIface =
new OrgFreedesktopDBusPropertiesInterface(
QString::fromLatin1(s_fdo_notifications_service),
QString::fromLatin1(s_fdo_notifications_path),
dbusConn, this);
OrgFreedesktopDBusPropertiesInterface *propsIface
= new OrgFreedesktopDBusPropertiesInterface(
QString::fromLatin1(s_fdo_notifications_service),
QString::fromLatin1(s_fdo_notifications_path),
dbusConn, this);
connect(propsIface, &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged,
this, &AlarmDialog::slotDBusNotificationsPropertiesChanged);
}
......@@ -361,9 +361,7 @@ static QString cleanSummary(const QString &summary)
return retStr.replace(QLatin1Char('\n'), QLatin1Char(' '));
}
void AlarmDialog::addIncidence(const Akonadi::Item &incidenceitem,
const QDateTime &reminderAt,
const QString &displayText)
void AlarmDialog::addIncidence(const Akonadi::Item &incidenceitem, const QDateTime &reminderAt, const QString &displayText)
{
Incidence::Ptr incidence = CalendarSupport::incidence(incidenceitem);
ReminderTreeItem *item = searchByItem(incidenceitem);
......@@ -390,11 +388,11 @@ void AlarmDialog::addIncidence(const Akonadi::Item &incidenceitem,
item->setText(1, displayStr);
item->setText(2, QLocale().toString(item->mTrigger, QLocale::ShortFormat));
QString tip =
KCalUtils::IncidenceFormatter::toolTipStr(
CalendarSupport::displayName(mCalendar.data(),
incidenceitem.parentCollection()),
incidence, item->mRemindAt.date(), true);
QString tip
= KCalUtils::IncidenceFormatter::toolTipStr(
CalendarSupport::displayName(mCalendar.data(),
incidenceitem.parentCollection()),
incidence, item->mRemindAt.date(), true);
if (!item->mDisplayText.isEmpty()) {
tip += QLatin1String("<br>") + item->mDisplayText;
}
......@@ -703,8 +701,8 @@ void AlarmDialog::eventNotification()
QString program = alarm->programFile();
// if the program name contains spaces escape it
if (program.contains(QLatin1Char(' ')) &&
!(program.startsWith(QLatin1Char('\"')) && program.endsWith(QLatin1Char('\"')))) {
if (program.contains(QLatin1Char(' '))
&& !(program.startsWith(QLatin1Char('\"')) && program.endsWith(QLatin1Char('\"')))) {
program = QLatin1Char('\"') + program + QLatin1Char('\"');
}
......@@ -758,19 +756,19 @@ void AlarmDialog::eventNotification()
}
//TODO: support attachments
KOrg::MailClient mailer;
const bool sendStatus =
mailer.send(id, from, to, QString(), subject, body, true, false, QString(),
MailTransport::TransportManager::self()->defaultTransportName());
const bool sendStatus
= mailer.send(id, from, to, QString(), subject, body, true, false, QString(),
MailTransport::TransportManager::self()->defaultTransportName());
if (!sendStatus) {
KNotification::event(QStringLiteral("mailremindersent"),
QString(),
i18nc("@info email subject, error message",
"<warning>Failed to send the Email reminder for %1. %2</warning>",
subject, mailer.errorMsg()),
QStringLiteral("korgac"),
nullptr,
KNotification::CloseOnTimeout,
QStringLiteral("korgac"));
QString(),
i18nc("@info email subject, error message",
"<warning>Failed to send the Email reminder for %1. %2</warning>",
subject, mailer.errorMsg()),
QStringLiteral("korgac"),
nullptr,
KNotification::CloseOnTimeout,
QStringLiteral("korgac"));
}
}
}
......@@ -788,9 +786,9 @@ void AlarmDialog::wakeUp()
QDBusConnection dbusConn = QDBusConnection::sessionBus();
if (dbusConn.interface()->isServiceRegistered(QString::fromLatin1(s_fdo_notifications_service))) {
OrgFreedesktopNotificationsInterface iface(
QString::fromLatin1(s_fdo_notifications_service),
QString::fromLatin1(s_fdo_notifications_path),
dbusConn);
QString::fromLatin1(s_fdo_notifications_service),
QString::fromLatin1(s_fdo_notifications_path),
dbusConn);
if (iface.inhibited()) {
return;
}
......@@ -827,9 +825,7 @@ void AlarmDialog::wakeUp()
Q_EMIT reminderCount(activeCount());
}
void AlarmDialog::slotDBusNotificationsPropertiesChanged(const QString &interface,
const QVariantMap &changedProperties,
const QStringList &invalidatedProperties)
void AlarmDialog::slotDBusNotificationsPropertiesChanged(const QString &interface, const QVariantMap &changedProperties, const QStringList &invalidatedProperties)
{
Q_UNUSED(interface); // always "org.freedesktop.Notifications"
Q_UNUSED(invalidatedProperties);
......@@ -931,8 +927,8 @@ void AlarmDialog::updateButtons()
mUser1Button->setEnabled(false);
}
if (enabled) {
mIncidenceTree->setFocus();
mIncidenceTree->setCurrentItem(selection.first());
mIncidenceTree->setFocus();
mIncidenceTree->setCurrentItem(selection.first());
}
}
......@@ -1001,9 +997,7 @@ void AlarmDialog::accept()
}
/** static */
QDateTime AlarmDialog::triggerDateForIncidence(const Incidence::Ptr &incidence,
const QDateTime &reminderAt,
QString &displayStr)
QDateTime AlarmDialog::triggerDateForIncidence(const Incidence::Ptr &incidence, const QDateTime &reminderAt, QString &displayStr)
{
QDateTime result;
......@@ -1128,10 +1122,10 @@ bool AlarmDialog::openIncidenceEditorThroughKOrganizer(const Incidence::Ptr &inc
bool AlarmDialog::openIncidenceEditorNG(const Akonadi::Item &item)
{
Incidence::Ptr incidence = CalendarSupport::incidence(item);
IncidenceEditorNG::IncidenceDialog *dialog =
IncidenceEditorNG::IncidenceDialogFactory::create(
false, /*doesn't need initial saving*/
incidence->type(), nullptr, this);
IncidenceEditorNG::IncidenceDialog *dialog
= IncidenceEditorNG::IncidenceDialogFactory::create(
false, /*doesn't need initial saving*/
incidence->type(), nullptr, this);
if (!dialog) {
return false;
} else {
......
......@@ -106,18 +106,14 @@ protected:
void showEvent(QShowEvent *event) override;
private Q_SLOTS:
void slotDBusNotificationsPropertiesChanged(const QString &interface,
const QVariantMap &changedProperties,
const QStringList &invalidatedProperties);
void slotDBusNotificationsPropertiesChanged(const QString &interface, const QVariantMap &changedProperties, const QStringList &invalidatedProperties);
private:
void update();
void updateButtons();
typedef QList<ReminderTreeItem *> ReminderList;
static Q_REQUIRED_RESULT QDateTime triggerDateForIncidence(const KCalendarCore::Incidence::Ptr &inc,
const QDateTime &reminderAt,
QString &displayStr);
static Q_REQUIRED_RESULT QDateTime triggerDateForIncidence(const KCalendarCore::Incidence::Ptr &inc, const QDateTime &reminderAt, QString &displayStr);
// Removes each Incidence-X group that has one of the specified uids
void removeFromConfig(const QList<Akonadi::Item::Id> &);
......
......@@ -66,10 +66,7 @@ QString const MailClient::errorMsg()
return errorString;
}
bool MailClient::mailAttendees(const KCalendarCore::IncidenceBase::Ptr &incidence,
const KIdentityManagement::Identity &identity, bool bccMe,
const QString &attachment,
const QString &mailTransport)
bool MailClient::mailAttendees(const KCalendarCore::IncidenceBase::Ptr &incidence, const KIdentityManagement::Identity &identity, bool bccMe, const QString &attachment, const QString &mailTransport)
{
const KCalendarCore::Attendee::List attendees = incidence->attendees();
if (attendees.isEmpty()) {
......@@ -142,11 +139,7 @@ bool MailClient::mailAttendees(const KCalendarCore::IncidenceBase::Ptr &incidenc
bccMe, attachment, mailTransport);
}
bool MailClient::mailOrganizer(const KCalendarCore::IncidenceBase::Ptr &incidence,
const KIdentityManagement::Identity &identity,
const QString &from, bool bccMe,
const QString &attachment, const QString &sub,
const QString &mailTransport)
bool MailClient::mailOrganizer(const KCalendarCore::IncidenceBase::Ptr &incidence, const KIdentityManagement::Identity &identity, const QString &from, bool bccMe, const QString &attachment, const QString &sub, const QString &mailTransport)
{
const QString to = incidence->organizer().fullName();
QString subject = sub;
......@@ -166,11 +159,7 @@ bool MailClient::mailOrganizer(const KCalendarCore::IncidenceBase::Ptr &incidenc
bccMe, attachment, mailTransport);
}
bool MailClient::mailTo(const KCalendarCore::IncidenceBase::Ptr &incidence,
const KIdentityManagement::Identity &identity,
const QString &from, bool bccMe,
const QString &recipients, const QString &attachment,
const QString &mailTransport)
bool MailClient::mailTo(const KCalendarCore::IncidenceBase::Ptr &incidence, const KIdentityManagement::Identity &identity, const QString &from, bool bccMe, const QString &recipients, const QString &attachment, const QString &mailTransport)
{
QString subject;
......@@ -193,19 +182,14 @@ QStringList extractEmailAndNormalize(const QString &email)
QStringList normalizedEmail;
normalizedEmail.reserve(splittedEmail.count());
for (const QString &email : splittedEmail) {
const QString str =
KEmailAddress::extractEmailAddress(KEmailAddress::normalizeAddressesAndEncodeIdn(email));
const QString str
= KEmailAddress::extractEmailAddress(KEmailAddress::normalizeAddressesAndEncodeIdn(email));
normalizedEmail << str;
}
return normalizedEmail;
}
bool MailClient::send(const KIdentityManagement::Identity &identity,
const QString &from, const QString &_to, const QString &cc,
const QString &subject, const QString &body,
bool hidden, bool bccMe,
const QString &attachment,
const QString &mailTransport)
bool MailClient::send(const KIdentityManagement::Identity &identity, const QString &from, const QString &_to, const QString &cc, const QString &subject, const QString &body, bool hidden, bool bccMe, const QString &attachment, const QString &mailTransport)
{
Q_UNUSED(hidden);
......
......@@ -53,23 +53,11 @@ public:
*/
Q_REQUIRED_RESULT const QString errorMsg();
Q_REQUIRED_RESULT bool mailAttendees(const KCalendarCore::IncidenceBase::Ptr &,
const KIdentityManagement::Identity &identity, bool bccMe,
const QString &attachment = QString(),
const QString &mailTransport = QString());
Q_REQUIRED_RESULT bool mailOrganizer(const KCalendarCore::IncidenceBase::Ptr &,
const KIdentityManagement::Identity &identity,
const QString &from, bool bccMe,
const QString &attachment = QString(),
const QString &sub = QString(),
const QString &mailTransport = QString());
Q_REQUIRED_RESULT bool mailTo(const KCalendarCore::IncidenceBase::Ptr &,
const KIdentityManagement::Identity &identity,
const QString &from, bool bccMe, const QString &recipients,
const QString &attachment = QString(),
const QString &mailTransport = QString());
Q_REQUIRED_RESULT bool mailAttendees(const KCalendarCore::IncidenceBase::Ptr &, const KIdentityManagement::Identity &identity, bool bccMe, const QString &attachment = QString(), const QString &mailTransport = QString());
Q_REQUIRED_RESULT bool mailOrganizer(const KCalendarCore::IncidenceBase::Ptr &, const KIdentityManagement::Identity &identity, const QString &from, bool bccMe, const QString &attachment = QString(), const QString &sub = QString(), const QString &mailTransport = QString());
Q_REQUIRED_RESULT bool mailTo(const KCalendarCore::IncidenceBase::Ptr &, const KIdentityManagement::Identity &identity, const QString &from, bool bccMe, const QString &recipients, const QString &attachment = QString(), const QString &mailTransport = QString());
/**
Sends mail with specified from, to and subject field and body as text.
......@@ -88,12 +76,8 @@ public:
@param mailTransport defines the mail transport method. See here the
kdepimlibs/mailtransport library.
*/
Q_REQUIRED_RESULT bool send(const KIdentityManagement::Identity &identity,
const QString &from, const QString &to, const QString &cc,
const QString &subject, const QString &body,
bool hidden = false, bool bccMe = false,
const QString &attachment = QString(),
const QString &mailTransport = QString());
Q_REQUIRED_RESULT bool send(const KIdentityManagement::Identity &identity, const QString &from, const QString &to, const QString &cc, const QString &subject, const QString &body, bool hidden = false, bool bccMe = false,
const QString &attachment = QString(), const QString &mailTransport = QString());
private:
QString errorString;
......
......@@ -399,9 +399,9 @@ void ActionManager::initActions()
action->setStatusTip(i18nc("@info:status", "Month View"));
action->setToolTip(i18nc("@info:tooltip", "Switch to the Month View"));
action->setWhatsThis(
i18nc("@info:whatsthis",
"Switches to the Month View, which shows all the events and due to-dos "
"in a familiar monthly calendar layout."));
i18nc("@info:whatsthis",
"Switches to the Month View, which shows all the events and due to-dos "
"in a familiar monthly calendar layout."));
mACollection->addAction(QStringLiteral("view_month"), action);
connect(action, &QAction::triggered,
mCalendarView->viewManager(), &KOViewManager::showMonthView);
......@@ -553,8 +553,8 @@ void ActionManager::initActions()
connect(action, &QAction::triggered, mCalendarView, &CalendarView::goToday);
/** Scroll Backward Action **/
action = new QAction(QIcon::fromTheme(isRTL ? QStringLiteral("go-next") :
QStringLiteral("go-previous")),
action = new QAction(QIcon::fromTheme(isRTL ? QStringLiteral("go-next")
: QStringLiteral("go-previous")),
i18nc("scroll backward", "&Backward"), this);
action->setIconText(i18nc("scroll backward", "Back"));
action->setStatusTip(i18nc("@info:status", "Scroll Backward"));
......@@ -567,8 +567,8 @@ void ActionManager::initActions()
connect(action, &QAction::triggered, mCalendarView, &CalendarView::goPrevious);
/** Scroll Forward Action **/
action = new QAction(QIcon::fromTheme(isRTL ? QStringLiteral("go-previous") :
QStringLiteral("go-next")),
action = new QAction(QIcon::fromTheme(isRTL ? QStringLiteral("go-previous")
: QStringLiteral("go-next")),
i18nc("scroll forward", "&Forward"), this);
action->setIconText(i18nc("scoll forward", "Forward"));
action->setStatusTip(i18nc("@info:status", "Scroll Forward"));
......@@ -654,7 +654,7 @@ void ActionManager::initActions()
mNewJournalAction->setToolTip(i18nc("@info:tooltip", "Create a new Journal"));
mNewJournalAction->setWhatsThis(
i18nc("@info:whatsthis",
"Starts a dialog that allows you to create a new Journal entry."));
"Starts a dialog that allows you to create a new Journal entry."));
mACollection->addAction(QStringLiteral("new_journal"), mNewJournalAction);
connect(mNewJournalAction, &QAction::triggered, this,
&ActionManager::slotNewJournal);
......@@ -669,8 +669,8 @@ void ActionManager::initActions()
i18nc("@info:whatsthis",
"Starts a configuration dialog that allows you to change the settings "
"for the current calendar view."));
mConfigureViewAction->setEnabled(mCalendarView->currentView() &&
mCalendarView->currentView()->hasConfigurationDialog());
mConfigureViewAction->setEnabled(mCalendarView->currentView()
&& mCalendarView->currentView()->hasConfigurationDialog());
mACollection->addAction(QStringLiteral("configure_view"), mConfigureViewAction);
connect(mConfigureViewAction, &QAction::triggered, mCalendarView,
&CalendarView::configureCurrentView);
......@@ -1054,7 +1054,7 @@ bool ActionManager::saveURL()
KJobWidgets::setWindow(job, view());
if (!job->exec()) {
const QString msg = i18n("Cannot upload calendar to '%1'",
mURL.toDisplayString());
mURL.toDisplayString());
KMessageBox::error(dialogParent(), msg);
return false;
}
......@@ -1826,4 +1826,3 @@ void ActionManager::openEventEditor(const QString &summary, const QString &descr
Q_UNUSED(attachmentIsInline);
qCWarning(KORGANIZER_LOG) << "Not implemented in korg-desktop";
}
......@@ -286,16 +286,16 @@ public:
const Akonadi::Collection collection = CalendarSupport::collectionFromIndex(index);
if (hasCompatibleMimeTypes(collection)) {
if (collection.hasAttribute<Akonadi::EntityDisplayAttribute>() &&
!collection.attribute<Akonadi::EntityDisplayAttribute>()->iconName().isEmpty()) {
if (collection.hasAttribute<Akonadi::EntityDisplayAttribute>()
&& !collection.attribute<Akonadi::EntityDisplayAttribute>()->iconName().isEmpty()) {
return collection.attribute<Akonadi::EntityDisplayAttribute>()->icon();
}
}
} else if (role == Qt::FontRole) {
const Akonadi::Collection collection = CalendarSupport::collectionFromIndex(index);
if (!collection.contentMimeTypes().isEmpty() &&
KOHelper::isStandardCalendar(collection.id()) &&
collection.rights() & Akonadi::Collection::CanCreateItem) {
if (!collection.contentMimeTypes().isEmpty()
&& KOHelper::isStandardCalendar(collection.id())
&& collection.rights() & Akonadi::Collection::CanCreateItem) {
QFont font = qvariant_cast<QFont>(QSortFilterProxyModel::data(index, Qt::FontRole));
font.setBold(true);
if (!mInitDefaultCalendar) {
......@@ -340,14 +340,14 @@ protected:
const QModelIndex sourceIndex = sourceModel()->index(row, 0, sourceParent);
Q_ASSERT(sourceIndex.isValid());
const Akonadi::Collection &col =
sourceIndex.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
const Akonadi::CollectionIdentificationAttribute *attr =
col.attribute<Akonadi::CollectionIdentificationAttribute>();
const Akonadi::Collection &col
= sourceIndex.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
const Akonadi::CollectionIdentificationAttribute *attr
= col.attribute<Akonadi::CollectionIdentificationAttribute>();
//We filter the user folders because we insert person nodes for user folders.
if ((attr && attr->collectionNamespace().startsWith("usertoplevel")) ||
col.name().contains(QLatin1String("Other Users"))) {
if ((attr && attr->collectionNamespace().startsWith("usertoplevel"))
|| col.name().contains(QLatin1String("Other Users"))) {
return false;
}
return true;
......@@ -638,14 +638,14 @@ void AkonadiCollectionView::setDefaultCalendar()
// Ask if they really want to do this
const Akonadi::Collection curCol(CalendarSupport::KCalPrefs::instance()->defaultCalendarId());
if (curCol.isValid() &&
KMessageBox::warningContinueCancel(
if (curCol.isValid()
&& KMessageBox::warningContinueCancel(
this,
i18nc("@info",
"Do you really want replace your current default calendar with \"%1\"?",
collection.displayName()),
collection.displayName()),
i18nc("@title:window", "Replace Default Calendar?")) != KMessageBox::Continue) {
return;
return;
}
CalendarSupport::KCalPrefs::instance()->setDefaultCalendarId(collection.id());
......@@ -701,8 +701,8 @@ Akonadi::EntityTreeView *AkonadiCollectionView::view() const
void AkonadiCollectionView::updateView()
{
Q_EMIT resourcesChanged(mSelectionProxyModel ?
mSelectionProxyModel->selectionModel()->hasSelection() : false);
Q_EMIT resourcesChanged(mSelectionProxyModel
? mSelectionProxyModel->selectionModel()->hasSelection() : false);
}
void AkonadiCollectionView::updateMenu()
......@@ -727,10 +727,10 @@ void AkonadiCollectionView::updateMenu()
}
mDefaultCalendar->setEnabled(
!KOHelper::isStandardCalendar(collection.id()) &&
(collection.rights() & Akonadi::Collection::CanCreateItem) &&
!collection.isVirtual() &&
collection.contentMimeTypes().contains(KCalendarCore::Event::eventMimeType()));
!KOHelper::isStandardCalendar(collection.id())
&& (collection.rights() & Akonadi::Collection::CanCreateItem)
&& !collection.isVirtual()
&& collection.contentMimeTypes().contains(KCalendarCore::Event::eventMimeType()));
disableStuff = false;
}
bool isOnline;
......
......@@ -49,8 +49,8 @@ void KoEventPopupMenuTest::createEventFromEvent()
QAction *createevent = menu.findChild<QAction *>(QStringLiteral("createevent"));
createevent->trigger();
IncidenceEditorNG::IncidenceDialog *dlg =
menu.findChild<IncidenceEditorNG::IncidenceDialog *>(QStringLiteral("incidencedialog"));
IncidenceEditorNG::IncidenceDialog *dlg
= menu.findChild<IncidenceEditorNG::IncidenceDialog *>(QStringLiteral("incidencedialog"));
QVERIFY(!dlg);
}
......@@ -69,8 +69,8 @@ void KoEventPopupMenuTest::createTodoFromTodo()
QAction *createtodo = menu.findChild<QAction *>(QStringLiteral("createtodo"));
createtodo->trigger();
IncidenceEditorNG::IncidenceDialog *dlg =
menu.findChild<IncidenceEditorNG::IncidenceDialog *>(QStringLiteral("incidencedialog"));
IncidenceEditorNG::IncidenceDialog *dlg
= menu.findChild<IncidenceEditorNG::IncidenceDialog *>(QStringLiteral("incidencedialog"));
QVERIFY(!dlg);
}
......
......@@ -966,8 +966,8 @@ void CalendarView::dateTimesForNewEvent(QDateTime &startDt, QDateTime &endDt, bo
// use the next quarter hour after the current time.
// but don't spill over into tomorrow.
const QTime currentTime = currentDateTime.time();
if (!prefTime.isValid() ||
(currentTime > prefTime && currentTime < QTime(23, 45))) {
if (!prefTime.isValid()
|| (currentTime > prefTime && currentTime < QTime(23, 45))) {
prefTime = nextQuarterHour(currentTime);
}
}
......
......@@ -508,7 +508,6 @@ public Q_SLOTS:
/** Take ownership of selected event. */
void takeOverEvent();
/** set state of calendar to read-only
@param readOnly whether the calendar view should be set read-only or not
*/
......
......@@ -364,7 +364,9 @@ void FilterEdit::editCategorySelection()
const auto names = mCurrent->categoryList();
tags.resize(names.size());
std::transform(names.cbegin(), names.cend(), std::back_inserter(tags),
[](const QString &name) { return Akonadi::Tag{name}; });
[](const QString &name) {
return Akonadi::Tag{name};
});
mCategorySelectDialog->setSelection(tags);
mCategorySelectDialog->show();
......
......@@ -103,10 +103,10 @@ SearchDialog::SearchDialog(CalendarView *calendarview)
connect(m_popupMenu, &KOEventPopupMenu::deleteIncidenceSignal, this,
&SearchDialog::deleteIncidenceSignal);
//TODO: add these
// connect(m_popupMenu, &KOEventPopupMenu::toggleAlarmSignal, this,
// &SearchDialog::toggleAlarmSignal);
// connect(m_popupMenu, &KOEventPopupMenu::toggleTodoCompletedSignal, this,
// &SearchDialog::toggleTodoCompletedSignal);
// connect(m_popupMenu, &KOEventPopupMenu::toggleAlarmSignal, this,
// &SearchDialog::toggleAlarmSignal);
// connect(m_popupMenu, &KOEventPopupMenu::toggleTodoCompletedSignal, this,
// &SearchDialog::toggleTodoCompletedSignal);
readConfig();
}
......@@ -195,9 +195,9 @@ void SearchDialog::search(const QRegExp &re)
KCalendarCore::Event::List events;
if (m_ui->eventsCheck->isChecked()) {
events =
m_calendarview->calendar()->events(
startDt, endDt, QTimeZone::systemTimeZone(), m_ui->inclusiveCheck->isChecked());
events
= m_calendarview->calendar()->events(
startDt, endDt, QTimeZone::systemTimeZone(), m_ui->inclusiveCheck->isChecked());
}
KCalendarCore::Todo::List todos;
......@@ -207,16 +207,16 @@ void SearchDialog::search(const QRegExp &re)
const KCalendarCore::Todo::List alltodos = m_calendarview->calendar()->todos();
for (const KCalendarCore::Todo::Ptr &todo : alltodos) {
Q_ASSERT(todo);
if ((!todo->hasStartDate() && !todo->hasDueDate()) || // undated
(todo->hasStartDate() &&
(todo->dtStart().toLocalTime().date() >= startDt) &&
(todo->dtStart().toLocalTime().date() <= endDt)) || //start dt in range
(todo->hasDueDate() &&
(todo->dtDue().toLocalTime().date() >= startDt) &&
(todo->dtDue().toLocalTime().date() <= endDt)) || //due dt in range
(todo->hasCompletedDate() &&
(todo->completed().toLocalTime().date() >= startDt) &&
(todo->completed().toLocalTime().date() <= endDt))) { //completed dt in range
if ((!todo->hasStartDate() && !todo->hasDueDate()) // undated
|| (todo->hasStartDate()
&& (todo->dtStart().toLocalTime().date() >= startDt)
&& (todo->dtStart().toLocalTime().date() <= endDt)) //start dt in range
|| (todo->hasDueDate()
&& (todo->dtDue().toLocalTime().date() >= startDt)
&& (todo->dtDue().toLocalTime().date() <= endDt)) //due dt in range
|| (todo->hasCompletedDate()
&& (todo->completed().toLocalTime().date() >= startDt)
&& (todo->completed().toLocalTime().date() <= endDt))) { //completed dt in range
todos.append(todo);
}
}
......
......@@ -38,7 +38,7 @@
#include <IncidenceEditor/IncidenceDialog>
#include <IncidenceEditor/IncidenceDialogFactory>
#include<QCoreApplication>
#include <QCoreApplication>
KOEventPopupMenu::KOEventPopupMenu(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *parent)
: QMenu(parent)
......@@ -80,16 +80,16 @@ void KOEventPopupMenu::init(const Akonadi::ETMCalendar::Ptr &calendar, MenuStyle
this, &KOEventPopupMenu::printPreview);
// Add more menu actions according to Menu style
switch(menuStyle) {
case MenuStyle::NormalView:
appendEditOnlyItems();
appendEventOnlyItems();
appendTodoOnlyItems();
appendReminderOnlyItems();
appendRecurrenceOnlyItems();
appendShareOnlyItems();
default:
break;
switch (menuStyle) {
case MenuStyle::NormalView:
appendEditOnlyItems();
appendEventOnlyItems();
appendTodoOnlyItems();
appendReminderOnlyItems();
appendRecurrenceOnlyItems();
appendShareOnlyItems();
default:
break;
}
}
......@@ -113,8 +113,8 @@ void KOEventPopupMenu::appendEventOnlyItems()
mEventOnlyItems.append(addSeparator());
mEventOnlyItems.append(addAction(QIcon::fromTheme(QStringLiteral("task-new")),
i18nc("@action:inmenu", "Create To-do from Event"),
this, &KOEventPopupMenu::createTodo));
i18nc("@action:inmenu", "Create To-do from Event"),
this, &KOEventPopupMenu::createTodo));
mEventOnlyItems.append(addAction(QIcon::fromTheme(QStringLiteral("view-pim-notes")),
i18nc("@action:inmenu", "Create Note for Event"),
......@@ -211,9 +211,9 @@ void KOEventPopupMenu::showIncidencePopup(const Akonadi::Item &item, const QDate
(*it)->setEnabled(true);
}