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

GIT_SILENT: coding style

parent c49a4b43
......@@ -208,8 +208,7 @@ void MarcusBains::updateLocationRecalc(bool recalculate)
class Q_DECL_HIDDEN Agenda::Private
{
public:
Private(AgendaView *agendaView, QScrollArea *scrollArea, int columns, int rows, int rowSize,
bool isInteractive)
Private(AgendaView *agendaView, QScrollArea *scrollArea, int columns, int rows, int rowSize, bool isInteractive)
: mAgendaView(agendaView)
, mScrollArea(scrollArea)
, mAllDayMode(false)
......@@ -343,8 +342,7 @@ public:
/*
Create an agenda widget with rows rows and columns columns.
*/
Agenda::Agenda(AgendaView *agendaView, QScrollArea *scrollArea, int columns, int rows, int rowSize,
bool isInteractive)
Agenda::Agenda(AgendaView *agendaView, QScrollArea *scrollArea, int columns, int rows, int rowSize, bool isInteractive)
: QWidget(scrollArea)
, d(new Private(agendaView, scrollArea, columns, rows, rowSize, isInteractive))
{
......@@ -785,9 +783,9 @@ bool Agenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
performSelectAction(viewportPos);
// show cursor at end of timespan
if (((d->mStartCell.y() < d->mEndCell.y()) &&
(d->mEndCell.x() >= d->mStartCell.x())) ||
(d->mEndCell.x() > d->mStartCell.x())) {
if (((d->mStartCell.y() < d->mEndCell.y())
&& (d->mEndCell.x() >= d->mStartCell.x()))
|| (d->mEndCell.x() > d->mStartCell.x())) {
indicatorPos = gridToContents(QPoint(d->mEndCell.x(), d->mEndCell.y() + 1));
} else {
indicatorPos = gridToContents(d->mEndCell);
......@@ -822,14 +820,14 @@ bool Agenda::ptInSelection(const QPoint &gpos) const
{
if (!d->mHasSelection) {
return false;
} else if (gpos.x() < d->mSelectionStartCell.x() ||
gpos.x() > d->mSelectionEndCell.x()) {
} else if (gpos.x() < d->mSelectionStartCell.x()
|| gpos.x() > d->mSelectionEndCell.x()) {
return false;
} else if ((gpos.x() == d->mSelectionStartCell.x()) &&
(gpos.y() < d->mSelectionStartCell.y())) {
} else if ((gpos.x() == d->mSelectionStartCell.x())
&& (gpos.y() < d->mSelectionStartCell.y())) {
return false;
} else if ((gpos.x() == d->mSelectionEndCell.x()) &&
(gpos.y() > d->mSelectionEndCell.y())) {
} else if ((gpos.x() == d->mSelectionEndCell.x())
&& (gpos.y() > d->mSelectionEndCell.y())) {
return false;
}
return true;
......@@ -871,8 +869,8 @@ void Agenda::performSelectAction(const QPoint &pos)
if (gpos != d->mEndCell) {
d->mEndCell = gpos;
if (d->mStartCell.x() > d->mEndCell.x() ||
(d->mStartCell.x() == d->mEndCell.x() && d->mStartCell.y() > d->mEndCell.y())) {
if (d->mStartCell.x() > d->mEndCell.x()
|| (d->mStartCell.x() == d->mEndCell.x() && d->mStartCell.y() > d->mEndCell.y())) {
// backward selection
d->mSelectionStartCell = d->mEndCell;
d->mSelectionEndCell = d->mStartCell;
......@@ -901,8 +899,7 @@ void Agenda::endSelectAction(const QPoint &currentPos)
}
}
Agenda::MouseActionType Agenda::isInResizeArea(bool horizontal, const QPoint &pos,
const AgendaItem::QPtr &item)
Agenda::MouseActionType Agenda::isInResizeArea(bool horizontal, const QPoint &pos, const AgendaItem::QPtr &item)
{
if (!item) {
return NOP;
......@@ -926,8 +923,8 @@ Agenda::MouseActionType Agenda::isInResizeArea(bool horizontal, const QPoint &po
} else {
return RESIZELEFT;
}
} else if ((d->mGridSpacingX - gridDistanceX) < d->mResizeBorderWidth &&
clXRight == gridpos.x()) {
} else if ((d->mGridSpacingX - gridDistanceX) < d->mResizeBorderWidth
&& clXRight == gridpos.x()) {
if (QApplication::isRightToLeft()) {
return RESIZELEFT;
} else {
......@@ -938,13 +935,13 @@ Agenda::MouseActionType Agenda::isInResizeArea(bool horizontal, const QPoint &po
}
} else {
int gridDistanceY = int(pos.y() - contpos.y());
if (gridDistanceY < d->mResizeBorderWidth &&
item->cellYTop() == gridpos.y() &&
!item->firstMultiItem()) {
if (gridDistanceY < d->mResizeBorderWidth
&& item->cellYTop() == gridpos.y()
&& !item->firstMultiItem()) {
return RESIZETOP;
} else if ((d->mGridSpacingY - gridDistanceY) < d->mResizeBorderWidth &&
item->cellYBottom() == gridpos.y() &&
!item->lastMultiItem()) {
} else if ((d->mGridSpacingY - gridDistanceY) < d->mResizeBorderWidth
&& item->cellYBottom() == gridpos.y()
&& !item->lastMultiItem()) {
return RESIZEBOTTOM;
} else {
return MOVE;
......@@ -976,10 +973,10 @@ void Agenda::performItemAction(const QPoint &pos)
// Cursor left active agenda area.
// This starts a drag.
if (pos.y() < 0 ||
pos.y() >= contentsY() + d->mScrollArea->viewport()->height() ||
pos.x() < 0 ||
pos.x() >= width()) {
if (pos.y() < 0
|| pos.y() >= contentsY() + d->mScrollArea->viewport()->height()
|| pos.x() < 0
|| pos.x() >= width()) {
if (d->mActionType == MOVE) {
d->mScrollUpTimer.stop();
d->mScrollDownTimer.stop();
......@@ -1195,9 +1192,9 @@ void Agenda::endItemAction()
KCalCore::Incidence::Ptr incidence = d->mActionItem->incidence();
const auto recurrenceId = d->mActionItem->occurrenceDateTime();
d->mItemMoved =
d->mItemMoved &&
!(d->mStartCell.x() == d->mEndCell.x() && d->mStartCell.y() == d->mEndCell.y());
d->mItemMoved
= d->mItemMoved
&& !(d->mStartCell.x() == d->mEndCell.x() && d->mStartCell.y() == d->mEndCell.y());
bool addIncidence = false;
if (d->mItemMoved) {
......@@ -1567,15 +1564,15 @@ void Agenda::drawContents(QPainter *p, int cx, int cy, int cw, int ch)
if (pt2.y() < pt1.y()) {
// overnight working hours
if (((gxStart == 0) && !d->mHolidayMask->at(d->mHolidayMask->count() - 1)) ||
((gxStart > 0) && (gxStart < int(d->mHolidayMask->count())) &&
(!d->mHolidayMask->at(gxStart - 1)))) {
if (((gxStart == 0) && !d->mHolidayMask->at(d->mHolidayMask->count() - 1))
|| ((gxStart > 0) && (gxStart < int(d->mHolidayMask->count()))
&& (!d->mHolidayMask->at(gxStart - 1)))) {
if (pt2.y() > cy) {
dbp.fillRect(xStart, cy, xWidth, pt2.y() - cy + 1, workColor);
}
}
if ((gxStart < int(d->mHolidayMask->count() - 1)) &&
(!d->mHolidayMask->at(gxStart))) {
if ((gxStart < int(d->mHolidayMask->count() - 1))
&& (!d->mHolidayMask->at(gxStart))) {
if (pt1.y() < cy + ch - 1) {
dbp.fillRect(xStart, pt1.y(), xWidth, cy + ch - pt1.y() + 1, workColor);
}
......@@ -1583,8 +1580,8 @@ void Agenda::drawContents(QPainter *p, int cx, int cy, int cw, int ch)
} else {
// last entry in holiday mask denotes the previous day not visible
// (needed for overnight shifts)
if (gxStart < int(d->mHolidayMask->count() - 1) &&
!d->mHolidayMask->at(gxStart)) {
if (gxStart < int(d->mHolidayMask->count() - 1)
&& !d->mHolidayMask->at(gxStart)) {
dbp.fillRect(xStart, pt1.y(), xWidth, pt2.y() - pt1.y() + 1, workColor);
}
}
......@@ -1663,9 +1660,9 @@ void Agenda::drawContents(QPainter *p, int cx, int cy, int cw, int ch)
*/
QPoint Agenda::contentsToGrid(const QPoint &pos) const
{
int gx = int(QApplication::isRightToLeft() ?
d->mColumns - pos.x() / d->mGridSpacingX :
pos.x() / d->mGridSpacingX);
int gx = int(QApplication::isRightToLeft()
? d->mColumns - pos.x() / d->mGridSpacingX
: pos.x() / d->mGridSpacingX);
int gy = int(pos.y() / d->mGridSpacingY);
return QPoint(gx, gy);
}
......@@ -1675,9 +1672,9 @@ QPoint Agenda::contentsToGrid(const QPoint &pos) const
*/
QPoint Agenda::gridToContents(const QPoint &gpos) const
{
int x = int(QApplication::isRightToLeft() ?
(d->mColumns - gpos.x()) * d->mGridSpacingX :
gpos.x() * d->mGridSpacingX);
int x = int(QApplication::isRightToLeft()
? (d->mColumns - gpos.x()) * d->mGridSpacingX
: gpos.x() * d->mGridSpacingX);
int y = int(gpos.y() * d->mGridSpacingY);
return QPoint(x, y);
}
......@@ -1754,9 +1751,9 @@ QVector<int> Agenda::maxContentsY() const
void Agenda::setStartTime(const QTime &startHour)
{
const double startPos =
(startHour.hour() / 24. + startHour.minute() / 1440. + startHour.second() / 86400.) *
d->mRows * gridSpacingY();
const double startPos
= (startHour.hour() / 24. + startHour.minute() / 1440. + startHour.second() / 86400.)
*d->mRows * gridSpacingY();
verticalScrollBar()->setValue(startPos);
}
......@@ -1764,9 +1761,7 @@ void Agenda::setStartTime(const QTime &startHour)
/*
Insert AgendaItem into agenda.
*/
AgendaItem::QPtr Agenda::insertItem(const KCalCore::Incidence::Ptr &incidence,
const QDateTime &recurrenceId, int X, int YTop, int YBottom,
int itemPos, int itemCount, bool isSelected)
AgendaItem::QPtr Agenda::insertItem(const KCalCore::Incidence::Ptr &incidence, const QDateTime &recurrenceId, int X, int YTop, int YBottom, int itemPos, int itemCount, bool isSelected)
{
if (d->mAllDayMode) {
qCDebug(CALENDARVIEW_LOG) << "using this in all-day mode is illegal.";
......@@ -1809,9 +1804,7 @@ AgendaItem::QPtr Agenda::insertItem(const KCalCore::Incidence::Ptr &incidence,
/*
Insert all-day AgendaItem into agenda.
*/
AgendaItem::QPtr Agenda::insertAllDayItem(const KCalCore::Incidence::Ptr &incidence,
const QDateTime &recurrenceId, int XBegin, int XEnd,
bool isSelected)
AgendaItem::QPtr Agenda::insertAllDayItem(const KCalCore::Incidence::Ptr &incidence, const QDateTime &recurrenceId, int XBegin, int XEnd, bool isSelected)
{
if (!d->mAllDayMode) {
qCCritical(CALENDARVIEW_LOG) << "using this in non all-day mode is illegal.";
......@@ -1845,9 +1838,7 @@ AgendaItem::QPtr Agenda::insertAllDayItem(const KCalCore::Incidence::Ptr &incide
return agendaItem;
}
AgendaItem::QPtr Agenda::createAgendaItem(const KCalCore::Incidence::Ptr &incidence, int itemPos,
int itemCount, const QDateTime &recurrenceId,
bool isSelected)
AgendaItem::QPtr Agenda::createAgendaItem(const KCalCore::Incidence::Ptr &incidence, int itemPos, int itemCount, const QDateTime &recurrenceId, bool isSelected)
{
if (!incidence) {
qCWarning(CALENDARVIEW_LOG) << "Agenda::createAgendaItem() item is invalid.";
......@@ -1866,8 +1857,7 @@ AgendaItem::QPtr Agenda::createAgendaItem(const KCalCore::Incidence::Ptr &incide
return agendaItem;
}
void Agenda::insertMultiItem(const KCalCore::Incidence::Ptr &event, const QDateTime &recurrenceId,
int XBegin, int XEnd, int YTop, int YBottom, bool isSelected)
void Agenda::insertMultiItem(const KCalCore::Incidence::Ptr &event, const QDateTime &recurrenceId, int XBegin, int XEnd, int YTop, int YBottom, bool isSelected)
{
KCalCore::Event::Ptr ev = CalendarSupport::event(event);
Q_ASSERT(ev);
......@@ -2276,11 +2266,11 @@ void Agenda::calculateWorkingHours()
d->mWorkingHoursEnable = !d->mAllDayMode;
QTime tmp = d->preferences()->workingHoursStart().time();
d->mWorkingHoursYTop =
int(4 * d->mGridSpacingY * (tmp.hour() + tmp.minute() / 60. + tmp.second() / 3600.));
d->mWorkingHoursYTop
= int(4 * d->mGridSpacingY * (tmp.hour() + tmp.minute() / 60. + tmp.second() / 3600.));
tmp = d->preferences()->workingHoursEnd().time();
d->mWorkingHoursYBottom =
int(4 * d->mGridSpacingY * (tmp.hour() + tmp.minute() / 60. + tmp.second() / 3600.) - 1);
d->mWorkingHoursYBottom
= int(4 * d->mGridSpacingY * (tmp.hour() + tmp.minute() / 60. + tmp.second() / 3600.) - 1);
}
void Agenda::setDateList(const KCalCore::DateList &selectedDates)
......@@ -2338,8 +2328,7 @@ AgendaItem::List Agenda::agendaItems(const QString &uid) const
return d->mAgendaItemsById.values(uid);
}
AgendaScrollArea::AgendaScrollArea(bool isAllDay, AgendaView *agendaView, bool isInteractive,
QWidget *parent)
AgendaScrollArea::AgendaScrollArea(bool isAllDay, AgendaView *agendaView, bool isInteractive, QWidget *parent)
: QScrollArea(parent)
{
if (isAllDay) {
......
......@@ -65,8 +65,7 @@ class EVENTVIEWS_EXPORT Agenda : public QWidget
{
Q_OBJECT
public:
Agenda(AgendaView *agendaView, QScrollArea *scrollArea, int columns, int rows, int rowSize,
bool isInteractive);
Agenda(AgendaView *agendaView, QScrollArea *scrollArea, int columns, int rows, int rowSize, bool isInteractive);
Agenda(AgendaView *agendaView, QScrollArea *scrollArea, int columns, bool isInteractive);
......@@ -120,16 +119,11 @@ public:
void setStartTime(const QTime &startHour);
AgendaItem::QPtr insertItem(const KCalCore::Incidence::Ptr &incidence,
const QDateTime &recurrenceId, int X, int YTop, int YBottom,
int itemPos, int itemCount, bool isSelected);
AgendaItem::QPtr insertItem(const KCalCore::Incidence::Ptr &incidence, const QDateTime &recurrenceId, int X, int YTop, int YBottom, int itemPos, int itemCount, bool isSelected);
AgendaItem::QPtr insertAllDayItem(const KCalCore::Incidence::Ptr &event,
const QDateTime &recurrenceId, int XBegin, int XEnd,
bool isSelected);
AgendaItem::QPtr insertAllDayItem(const KCalCore::Incidence::Ptr &event, const QDateTime &recurrenceId, int XBegin, int XEnd, bool isSelected);
void insertMultiItem(const KCalCore::Incidence::Ptr &event, const QDateTime &recurrenceId,
int XBegin, int XEnd, int YTop, int YBottom, bool isSelected);
void insertMultiItem(const KCalCore::Incidence::Ptr &event, const QDateTime &recurrenceId, int XBegin, int XEnd, int YTop, int YBottom, bool isSelected);
/**
Removes an event and all its multi-items from the agenda. This function
......@@ -235,8 +229,7 @@ private:
RESIZERIGHT
};
AgendaItem::QPtr createAgendaItem(const KCalCore::Incidence::Ptr &incidence, int itemPos,
int itemCount, const QDateTime &recurrentId, bool isSelected);
AgendaItem::QPtr createAgendaItem(const KCalCore::Incidence::Ptr &incidence, int itemPos, int itemCount, const QDateTime &recurrentId, bool isSelected);
protected:
/**
......@@ -270,8 +263,7 @@ protected:
@param pos The current mouse position
@param item The affected item
*/
MouseActionType isInResizeArea(bool horizontal, const QPoint &pos,
const AgendaItem::QPtr &item);
MouseActionType isInResizeArea(bool horizontal, const QPoint &pos, const AgendaItem::QPtr &item);
/** Return whether the cell specified by the grid point belongs to the current select
*/
bool ptInSelection(const QPoint &gpos) const;
......
......@@ -67,9 +67,8 @@ QPixmap *AgendaItem::eventPxmp = nullptr;
//-----------------------------------------------------------------------------
AgendaItem::AgendaItem(EventView *eventView, const MultiViewCalendar::Ptr &calendar,
const KCalCore::Incidence::Ptr &item, int itemPos, int itemCount,
const QDateTime &qd, bool isSelected, QWidget *parent)
AgendaItem::AgendaItem(EventView *eventView, const MultiViewCalendar::Ptr &calendar, const KCalCore::Incidence::Ptr &item, int itemPos, int itemCount, const QDateTime &qd, bool isSelected,
QWidget *parent)
: QWidget(parent)
, mEventView(eventView)
, mCalendar(calendar)
......@@ -275,8 +274,7 @@ void AgendaItem::setCellY(int YTop, int YBottom)
mCellYBottom = YBottom;
}
void AgendaItem::setMultiItem(const AgendaItem::QPtr &first, const AgendaItem::QPtr &prev,
const AgendaItem::QPtr &next, const AgendaItem::QPtr &last)
void AgendaItem::setMultiItem(const AgendaItem::QPtr &first, const AgendaItem::QPtr &prev, const AgendaItem::QPtr &next, const AgendaItem::QPtr &last)
{
if (!mMultiItemInfo) {
mMultiItemInfo = new MultiItemInfo;
......@@ -725,8 +723,7 @@ bool AgendaItem::overlaps(CellItem *o) const
return false;
}
static void conditionalPaint(QPainter *p, bool condition, int &x, int y, int ft,
const QPixmap &pxmp)
static void conditionalPaint(QPainter *p, bool condition, int &x, int y, int ft, const QPixmap &pxmp)
{
if (condition) {
p->drawPixmap(x, y, pxmp);
......@@ -1133,9 +1130,7 @@ void AgendaItem::paintEvent(QPaintEvent *ev)
}
}
void AgendaItem::drawRoundedRect(QPainter *p, const QRect &rect, bool selected,
const QColor &bgColor, bool frame, int ft, bool roundTop,
bool roundBottom)
void AgendaItem::drawRoundedRect(QPainter *p, const QRect &rect, bool selected, const QColor &bgColor, bool frame, int ft, bool roundTop, bool roundBottom)
{
Q_UNUSED(ft);
if (!mValid) {
......
......@@ -81,9 +81,8 @@ public:
typedef QPointer<AgendaItem> QPtr;
typedef QList<QPtr> List;
AgendaItem(EventView *eventView, const MultiViewCalendar::Ptr &calendar,
const KCalCore::Incidence::Ptr &incidence, int itemPos, int itemCount,
const QDateTime &qd, bool isSelected, QWidget *parent);
AgendaItem(EventView *eventView, const MultiViewCalendar::Ptr &calendar, const KCalCore::Incidence::Ptr &incidence, int itemPos, int itemCount, const QDateTime &qd, bool isSelected,
QWidget *parent);
~AgendaItem();
int cellXLeft() const
......@@ -168,8 +167,7 @@ public:
return mStartMoveInfo;
}
void setMultiItem(const AgendaItem::QPtr &first, const AgendaItem::QPtr &prev,
const AgendaItem::QPtr &next, const AgendaItem::QPtr &last);
void setMultiItem(const AgendaItem::QPtr &first, const AgendaItem::QPtr &prev, const AgendaItem::QPtr &next, const AgendaItem::QPtr &last);
AgendaItem::QPtr prependMoveItem(const AgendaItem::QPtr &);
......@@ -279,8 +277,7 @@ private:
// paint all visible icons
void paintIcons(QPainter *p, int &x, int y, int ft);
void drawRoundedRect(QPainter *p, const QRect &rect, bool selected, const QColor &bgcolor,
bool frame, int ft, bool roundTop, bool roundBottom);
void drawRoundedRect(QPainter *p, const QRect &rect, bool selected, const QColor &bgcolor, bool frame, int ft, bool roundTop, bool roundBottom);
int mCellXLeft, mCellXRight;
int mCellYTop, mCellYBottom;
......
......@@ -105,9 +105,9 @@ public:
rect.setWidth(q->parentWidget()->width());
rect.setHeight(q->height());
rect.setLeft(0);
rect.setTop(mLocation == EventIndicator::Top ?
0 :
q->parentWidget()->height() - rect.height());
rect.setTop(mLocation == EventIndicator::Top
? 0
: q->parentWidget()->height() - rect.height());
q->setGeometry(rect);
}
......@@ -274,8 +274,7 @@ public:
AgendaItem::List agendaItems(const QString &uid) const;
// insertAtDateTime is in the view's timezone
void insertIncidence(const KCalCore::Incidence::Ptr &, const QDateTime &recurrenceId,
const QDateTime &insertAtDateTime, bool createSelected);
void insertIncidence(const KCalCore::Incidence::Ptr &, const QDateTime &recurrenceId, const QDateTime &insertAtDateTime, bool createSelected);
void reevaluateIncidence(const KCalCore::Incidence::Ptr &incidence);
bool datesEqual(const KCalCore::Incidence::Ptr &one, const KCalCore::Incidence::Ptr &two) const;
......@@ -294,8 +293,7 @@ protected:
/* reimplemented from KCalCore::Calendar::CalendarObserver */
void calendarIncidenceAdded(const KCalCore::Incidence::Ptr &incidence) override;
void calendarIncidenceChanged(const KCalCore::Incidence::Ptr &incidence) override;
void calendarIncidenceDeleted(const KCalCore::Incidence::Ptr &incidence,
const KCalCore::Calendar *calendar) override;
void calendarIncidenceDeleted(const KCalCore::Incidence::Ptr &incidence, const KCalCore::Calendar *calendar) override;
private:
//quiet --overloaded-virtual warning
using KCalCore::Calendar::CalendarObserver::calendarIncidenceDeleted;
......@@ -386,10 +384,10 @@ QList<QDate> AgendaView::Private::generateDateList(const QDate &start, const QDa
{
QList<QDate> list;
if (start.isValid() &&
end.isValid() &&
end >= start &&
start.daysTo(end) < AgendaView::MAX_DAY_COUNT) {
if (start.isValid()
&& end.isValid()
&& end >= start
&& start.daysTo(end) < AgendaView::MAX_DAY_COUNT) {
QDate date = start;
list.reserve(start.daysTo(end) + 1);
while (date <= end) {
......@@ -716,16 +714,14 @@ void AgendaView::Private::insertIncidence(const KCalCore::Incidence::Ptr &incide
////////////////////////////////////////////////////////////////////////////
AgendaView::AgendaView(const QDate &start, const QDate &end, bool isInteractive, bool isSideBySide,
QWidget *parent)
AgendaView::AgendaView(const QDate &start, const QDate &end, bool isInteractive, bool isSideBySide, QWidget *parent)
: EventView(parent)
, d(new Private(this, isInteractive, isSideBySide))
{
init(start, end);
}
AgendaView::AgendaView(const PrefsPtr &prefs, const QDate &start, const QDate &end,
bool isInteractive, bool isSideBySide, QWidget *parent)
AgendaView::AgendaView(const PrefsPtr &prefs, const QDate &start, const QDate &end, bool isInteractive, bool isSideBySide, QWidget *parent)
: EventView(parent)
, d(new Private(this, isInteractive, isSideBySide))
{
......@@ -921,7 +917,9 @@ void AgendaView::connectAgenda(Agenda *agenda, Agenda *otherAgenda)
// drag signals
connect(agenda, &Agenda::startDragSignal,
this, [this](const KCalCore::Incidence::Ptr &ptr) { startDrag(ptr); });
this, [this](const KCalCore::Incidence::Ptr &ptr) {
startDrag(ptr);
});
// synchronize selections
connect(agenda, &Agenda::incidenceSelected,
......@@ -944,8 +942,7 @@ void AgendaView::slotIncidenceSelected(const KCalCore::Incidence::Ptr &incidence
}
}
void AgendaView::slotShowIncidencePopup(const KCalCore::Incidence::Ptr &incidence,
const QDate &date)
void AgendaView::slotShowIncidencePopup(const KCalCore::Incidence::Ptr &incidence, const QDate &date)
{
Akonadi::Item item = d->mViewCalendar->item(incidence);
//qDebug() << "wanna see the popup for " << incidence->uid() << item.id();
......@@ -1138,8 +1135,7 @@ void AgendaView::placeDecorationsFrame(QFrame *frame, bool decorationsFound, boo
}
}
void AgendaView::placeDecorations(DecorationList &decoList, const QDate &date, QWidget *labelBox,
bool forWeek)
void AgendaView::placeDecorations(DecorationList &decoList, const QDate &date, QWidget *labelBox, bool forWeek)
{
foreach (CalendarDecoration::Decoration *deco, decoList) {
CalendarDecoration::Element::List elements;
......@@ -1190,9 +1186,9 @@ void AgendaView::createDayLabels(bool force)
// this spacer moves the day labels over to line up with the day columns
QSpacerItem *spacer
= new QSpacerItem((!d->mIsSideBySide ? d->mTimeLabelsZone->width() : 0) +
SPACING +
d->mAllDayAgenda->scrollArea()->frameWidth(),
= new QSpacerItem((!d->mIsSideBySide ? d->mTimeLabelsZone->width() : 0)
+SPACING
+d->mAllDayAgenda->scrollArea()->frameWidth(),
1, QSizePolicy::Fixed);
d->mLayoutTopDayLabels->addSpacerItem(spacer);
......@@ -1488,8 +1484,7 @@ void AgendaView::updateTimeBarWidth()
}
}
void AgendaView::updateEventDates(AgendaItem *item, bool addIncidence,
Akonadi::Collection::Id collectionId)
void AgendaView::updateEventDates(AgendaItem *item, bool addIncidence, Akonadi::Collection::Id collectionId)
{
qCDebug(CALENDARVIEW_LOG) << item->text()
<< "; item->cellXLeft(): " << item->cellXLeft()
......@@ -1691,16 +1686,16 @@ QDate AgendaView::endDate() const
void AgendaView::showDates(const QDate &start, const QDate &end, const QDate &preferredMonth)
{
Q_UNUSED(preferredMonth);
if (!d->mSelectedDates.isEmpty() &&
d->mSelectedDates.first() == start &&
d->mSelectedDates.last() == end) {
if (!d->mSelectedDates.isEmpty()
&& d->mSelectedDates.first() == start
&& d->mSelectedDates.last() == end) {
return;
}
if (!start.isValid() ||
!end.isValid() ||
start > end ||
start.daysTo(end) > MAX_DAY_COUNT) {
if (!start.isValid()
|| !end.isValid()
|| start > end
|| start.daysTo(end) > MAX_DAY_COUNT) {
qCWarning(CALENDARVIEW_LOG) << "got bizare parameters: " << start << end
<< " - aborting here";
return;
......@@ -1805,11 +1800,11 @@ void AgendaView::fillAgenda()
foreach (const KCalCore::Incidence::Ptr &incidence, incidences) {
Q_ASSERT(incidence);
const bool wasSelected = (incidence->uid() == selectedAgendaId) ||
(incidence->uid() == selectedAllDayAgendaId);
const bool wasSelected = (incidence->uid() == selectedAgendaId)
|| (incidence->uid() == selectedAllDayAgendaId);
if ((incidence->allDay() && d->mUpdateAllDayAgenda) ||
(!incidence->allDay() && d->mUpdateAgenda)) {
if ((incidence->allDay() && d->mUpdateAllDayAgenda)
|| (!incidence->allDay() && d->mUpdateAgenda)) {
displayIncidence(incidence, wasSelected);
}
......@@ -1928,10 +1923,10 @@ bool AgendaView::displayIncidence(const KCalCore::Incidence::Ptr &incidence, boo
// ToDo items shall be displayed today if they are overdue
const QDateTime dateTimeToday = QDateTime(today, QTime(0, 0), Qt::LocalTime);
if (todo &&
todo->isOverdue() &&
dateTimeToday >= firstVisibleDateTime &&
dateTimeToday <= lastVisibleDateTime) {
if (todo
&& todo->isOverdue()
&& dateTimeToday >= firstVisibleDateTime
&& dateTimeToday <= lastVisibleDateTime) {
/* If there's a recurring instance showing up today don't add "today" again
* we don't want the event to appear duplicated */
if (!alreadyAddedToday) {
......@@ -2028,8 +2023,7 @@ void AgendaView::slotIncidencesDropped(const QList<QUrl> &items, const QPoint &g
#endif
}
void AgendaView::slotIncidencesDropped(const KCalCore::Incidence::List &incidences,
const QPoint &gpos, bool allDay)
void AgendaView::slotIncidencesDropped(const KCalCore::Incidence::List &incidences, const QPoint &gpos, bool allDay)
{
if (gpos.x() < 0 || gpos.y() < 0) {
return;
......@@ -2040,13 +2034,13 @@ void AgendaView::slotIncidencesDropped(const KCalCore::Incidence::List &incidenc
Q_FOREACH (const KCalCore::Incidence::Ptr &incidence, incidences) {
const Akonadi::Item existingItem = calendar()->item(incidence);
const bool existsInSameCollection =
existingItem.isValid() &&
(existingItem.storageCollectionId() == collectionId() || collectionId() == -1);
const bool existsInSameCollection
= existingItem.isValid()
&& (existingItem.storageCollectionId() == collectionId() || collectionId() == -1);
if (existingItem.isValid() && existsInSameCollection) {
KCalCore::Incidence::Ptr newIncidence =