Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM EventViews
Commits
5d49101f
Commit
5d49101f
authored
Sep 29, 2021
by
Laurent Montel
😁
Browse files
Fix some cppcheck warning
parent
25b7024b
Pipeline
#83518
passed with stage
in 9 minutes and 22 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/agenda/agenda.cpp
View file @
5d49101f
...
...
@@ -597,7 +597,6 @@ bool Agenda::eventFilter_drag(QObject *obj, QDropEvent *de)
Q_EMIT
droppedIncidences
(
incidences
,
gridPosition
,
d
->
mAllDayMode
);
}
return
true
;
break
;
}
case
QEvent
::
DragResponse
:
...
...
@@ -1151,8 +1150,8 @@ void Agenda::endItemAction()
d
->
mItemMoved
=
d
->
mItemMoved
&&
!
(
d
->
mStartCell
.
x
()
==
d
->
mEndCell
.
x
()
&&
d
->
mStartCell
.
y
()
==
d
->
mEndCell
.
y
());
bool
addIncidence
=
false
;
if
(
d
->
mItemMoved
)
{
bool
addIncidence
=
false
;
bool
modify
=
false
;
// get the main event and not the exception
...
...
src/agenda/decorationlabel.cpp
View file @
5d49101f
...
...
@@ -20,9 +20,9 @@ DecorationLabel::DecorationLabel(CalendarDecoration::Element *e, QWidget *parent
,
mShortText
(
e
->
shortText
())
,
mLongText
(
e
->
longText
())
,
mExtensiveText
(
e
->
extensiveText
())
,
mPixmap
(
e
->
newPixmap
(
size
()))
,
mUrl
(
e
->
url
())
{
mPixmap
=
e
->
newPixmap
(
size
());
mUrl
=
e
->
url
();
setUrl
(
mUrl
);
connect
(
e
,
&
CalendarDecoration
::
Element
::
gotNewExtensiveText
,
this
,
&
DecorationLabel
::
setExtensiveText
);
...
...
src/month/monthscene.cpp
View file @
5d49101f
...
...
@@ -304,7 +304,6 @@ void MonthGraphicsView::drawBackground(QPainter *p, const QRectF &rect)
p
->
setPen
(
Qt
::
NoPen
);
p
->
drawRect
(
QRect
(
cellHeaderX
,
cellHeaderY
,
cellHeaderWidth
,
cellHeaderHeight
));
QFont
font
=
p
->
font
();
if
(
cell
->
date
()
==
QDate
::
currentDate
())
{
font
.
setBold
(
true
);
}
else
{
...
...
src/timeline/timelineview.cpp
View file @
5d49101f
...
...
@@ -299,11 +299,9 @@ void TimelineView::showDates(const QDate &start, const QDate &end, const QDate &
grid
->
setStartDateTime
(
QDateTime
(
start
.
startOfDay
()));
d
->
mLeftView
->
clear
();
uint
index
=
0
;
// item for every calendar
TimelineItem
*
item
=
nullptr
;
Akonadi
::
ETMCalendar
::
Ptr
calres
=
calendar
();
if
(
!
calres
)
{
item
=
new
TimelineItem
(
calendar
(),
index
++
,
static_cast
<
QStandardItemModel
*>
(
d
->
mGantt
->
model
()),
d
->
mGantt
);
auto
item
=
new
TimelineItem
(
calendar
(),
index
++
,
static_cast
<
QStandardItemModel
*>
(
d
->
mGantt
->
model
()),
d
->
mGantt
);
d
->
mLeftView
->
addTopLevelItem
(
new
QTreeWidgetItem
(
QStringList
()
<<
i18n
(
"Calendar"
)));
d
->
mCalendarItemMap
.
insert
(
-
1
,
item
);
}
else
{
...
...
@@ -312,7 +310,7 @@ void TimelineView::showDates(const QDate &start, const QDate &end, const QDate &
for
(
const
Akonadi
::
Collection
&
collection
:
collections
)
{
if
(
collection
.
contentMimeTypes
().
contains
(
Event
::
eventMimeType
()))
{
item
=
new
TimelineItem
(
calendar
(),
index
++
,
static_cast
<
QStandardItemModel
*>
(
d
->
mGantt
->
model
()),
d
->
mGantt
);
auto
item
=
new
TimelineItem
(
calendar
(),
index
++
,
static_cast
<
QStandardItemModel
*>
(
d
->
mGantt
->
model
()),
d
->
mGantt
);
d
->
mLeftView
->
addTopLevelItem
(
new
QTreeWidgetItem
(
QStringList
()
<<
CalendarSupport
::
displayName
(
calendar
().
data
(),
collection
)));
const
QColor
resourceColor
=
EventViews
::
resourceColor
(
collection
,
preferences
());
if
(
resourceColor
.
isValid
())
{
...
...
src/todo/todomodel.cpp
View file @
5d49101f
...
...
@@ -337,15 +337,12 @@ QVariant TodoModel::data(const QModelIndex &index, int role) const
// icon for recurring todos
// It's in the summary column so you don't accidentally click
// the checkbox ( which increments the next occurrence date ).
// category colour
if
(
role
==
Qt
::
DecorationRole
&&
index
.
column
()
==
SummaryColumn
)
{
if
(
todo
->
recurs
())
{
return
QVariant
(
QIcon
::
fromTheme
(
QStringLiteral
(
"task-recurring"
)));
}
}
// category colour
if
(
role
==
Qt
::
DecorationRole
&&
index
.
column
()
==
SummaryColumn
)
{
QStringList
categories
=
todo
->
categories
();
const
QStringList
categories
=
todo
->
categories
();
return
categories
.
isEmpty
()
?
QVariant
()
:
QVariant
(
CalendarSupport
::
KCalPrefs
::
instance
()
->
categoryColor
(
categories
.
first
()));
}
else
if
(
role
==
Qt
::
DecorationRole
)
{
return
QVariant
();
...
...
src/todo/todoview.cpp
View file @
5d49101f
...
...
@@ -145,7 +145,7 @@ public:
return
todoFlatModel
!=
nullptr
;
}
TodoModel
*
todoModel
=
nullptr
;
TodoModel
*
const
todoModel
;
QList
<
TodoView
*>
views
;
QObject
*
parent
=
nullptr
;
...
...
@@ -937,11 +937,7 @@ void TodoView::setNewPercentage(QAction *action)
}
else
{
todo
->
setPercentComplete
(
percentage
);
}
if
(
todo
->
recurs
()
&&
percentage
==
100
)
{
changer
()
->
modifyIncidence
(
todoItem
,
oldTodo
,
this
);
}
else
{
changer
()
->
modifyIncidence
(
todoItem
,
oldTodo
,
this
);
}
changer
()
->
modifyIncidence
(
todoItem
,
oldTodo
,
this
);
}
else
{
qCDebug
(
CALENDARVIEW_LOG
)
<<
"Item is read only"
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment