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
78c9be33
Commit
78c9be33
authored
Oct 21, 2021
by
Friedrich W. H. Kossebau
Browse files
Drop support for EVENTVIEWS_NODECOS flag
No users known, so no need to complicate the code
parent
c767443c
Pipeline
#90442
passed with stage
in 6 minutes and 52 seconds
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/CMakeLists.txt
View file @
78c9be33
# The following macros can be defined to alter behavior.
# (if desired, use add_definitions() to define them)
#
# EVENTVIEWS_NODECOS - turns-off decoration plugins in views.
# No idea why you would want to define this, perhaps to save
# screen real estate? But there are a config options for that.
add_definitions
(
-DTRANSLATION_DOMAIN=\"libeventviews\"
)
add_library
(
KF5EventViews
)
add_library
(
KF5::EventViews ALIAS KF5EventViews
)
...
...
@@ -13,12 +5,6 @@ if(KDEPIM_BUILD_EXAMPLES)
add_subdirectory
(
viewerapp
)
endif
()
option
(
EVENTVIEWS_NODECOS
"Turn-off decoration plugins in views."
FALSE
)
if
(
EVENTVIEWS_NODECOS
)
add_definitions
(
-DEVENTVIEWS_NODECOS
)
endif
()
########### next target ###############
target_sources
(
KF5EventViews PRIVATE
...
...
src/agenda/agendaview.cpp
View file @
78c9be33
...
...
@@ -1054,8 +1054,6 @@ void AgendaView::zoomView(const int delta, QPoint pos, const Qt::Orientation ori
}
}
#ifndef EVENTVIEWS_NODECOS
bool
AgendaView
::
loadDecorations
(
const
QStringList
&
decorations
,
DecorationList
&
decoList
)
{
for
(
const
QString
&
decoName
:
decorations
)
{
...
...
@@ -1108,8 +1106,6 @@ void AgendaView::placeDecorations(DecorationList &decoList, QDate date, QWidget
}
}
#endif
void
AgendaView
::
createDayLabels
(
bool
force
)
{
// Check if mSelectedDates has changed, if not just return
...
...
@@ -1157,7 +1153,6 @@ void AgendaView::createDayLabels(bool force)
bottomWeekLabelBoxLayout
->
setSpacing
(
0
);
d
->
mLayoutBottomDayLabels
->
addWidget
(
bottomWeekLabelBox
);
#ifndef EVENTVIEWS_NODECOS
QList
<
CalendarDecoration
::
Decoration
*>
topDecos
;
QStringList
topStrDecos
=
preferences
()
->
decorationsAtAgendaViewTop
();
placeDecorationsFrame
(
d
->
mTopDayLabelsFrame
,
loadDecorations
(
topStrDecos
,
topDecos
),
true
);
...
...
@@ -1165,7 +1160,6 @@ void AgendaView::createDayLabels(bool force)
QList
<
CalendarDecoration
::
Decoration
*>
botDecos
;
QStringList
botStrDecos
=
preferences
()
->
decorationsAtAgendaViewBottom
();
placeDecorationsFrame
(
d
->
mBottomDayLabelsFrame
,
loadDecorations
(
botStrDecos
,
botDecos
),
false
);
#endif
for
(
const
QDate
&
date
:
std
::
as_const
(
d
->
mSelectedDates
))
{
auto
topDayLabelBox
=
new
QFrame
(
d
->
mTopDayLabels
);
...
...
@@ -1208,21 +1202,17 @@ void AgendaView::createDayLabels(bool force)
label
->
setAlignment
(
Qt
::
AlignCenter
);
}
#ifndef EVENTVIEWS_NODECOS
// Day decoration labels
placeDecorations
(
topDecos
,
date
,
topDayLabelBox
,
false
);
placeDecorations
(
botDecos
,
date
,
bottomDayLabelBox
,
false
);
#endif
}
auto
rightSpacer
=
new
QSpacerItem
(
d
->
mAllDayAgenda
->
scrollArea
()
->
frameWidth
(),
1
,
QSizePolicy
::
Fixed
);
d
->
mLayoutTopDayLabels
->
addSpacerItem
(
rightSpacer
);
#ifndef EVENTVIEWS_NODECOS
// Week decoration labels
placeDecorations
(
topDecos
,
d
->
mSelectedDates
.
first
(),
topWeekLabelBox
,
true
);
placeDecorations
(
botDecos
,
d
->
mSelectedDates
.
first
(),
bottomWeekLabelBox
,
true
);
#endif
if
(
!
d
->
mIsSideBySide
)
{
d
->
mLayoutTopDayLabels
->
addSpacing
(
d
->
mAgenda
->
verticalScrollBar
()
->
width
());
...
...
src/agenda/agendaview.h
View file @
78c9be33
...
...
@@ -25,12 +25,10 @@ class QSplitter;
namespace
EventViews
{
#ifndef EVENTVIEWS_NODECOS
namespace
CalendarDecoration
{
class
Decoration
;
}
#endif
class
TimeLabels
;
class
TimeLabelsZone
;
...
...
@@ -232,12 +230,10 @@ private:
void
setupTimeLabel
(
TimeLabels
*
timeLabel
);
bool
displayIncidence
(
const
KCalendarCore
::
Incidence
::
Ptr
&
incidence
,
bool
createSelected
);
#ifndef EVENTVIEWS_NODECOS
using
DecorationList
=
QList
<
EventViews
::
CalendarDecoration
::
Decoration
*>
;
bool
loadDecorations
(
const
QStringList
&
decorations
,
DecorationList
&
decoList
);
void
placeDecorationsFrame
(
QFrame
*
frame
,
bool
decorationsFound
,
bool
isTop
);
void
placeDecorations
(
EventViews
::
AgendaView
::
DecorationList
&
decoList
,
QDate
date
,
QWidget
*
labelBox
,
bool
forWeek
);
#endif
friend
class
TimeLabelsZone
;
friend
class
MultiAgendaViewPrivate
;
...
...
Write
Preview
Markdown
is supported
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