Skip to content
GitLab
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
340af1a9
Commit
340af1a9
authored
Jul 31, 2022
by
Volker Krause
Browse files
Port from KCalPrefs::categoryColor to Akonadi::TagCache::tagColor
parent
17c0b0ee
Pipeline
#214148
passed with stage
in 9 minutes and 27 seconds
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/agenda/agendaitem.cpp
View file @
340af1a9
...
...
@@ -14,6 +14,8 @@
#include
<CalendarSupport/KCalPrefs>
#include
<CalendarSupport/Utils>
#include
<Akonadi/TagCache>
#include
<KContacts/VCardDrag>
#include
<KCalUtils/ICalDrag>
...
...
@@ -1127,14 +1129,14 @@ void AgendaItem::drawRoundedRect(QPainter *p,
QColor
AgendaItem
::
getCategoryColor
()
const
{
const
QStringList
&
categories
=
mIncidence
->
categories
();
if
(
categories
.
isEmpty
()
||
!
CalendarSupport
::
KCalPrefs
::
instance
()
->
hasCategory
Color
(
categories
.
first
()))
{
if
(
categories
.
isEmpty
()
||
!
Akonadi
::
TagCache
::
instance
()
->
tag
Color
(
categories
.
first
())
.
isValid
()
)
{
const
auto
colorPreference
=
mEventView
->
preferences
()
->
agendaViewColors
();
if
(
colorPreference
==
PrefsBase
::
CategoryOnly
||
!
mResourceColor
.
isValid
())
{
return
CalendarSupport
::
KCalPrefs
::
instance
()
->
unsetCategoryColor
();
}
return
mResourceColor
;
}
return
CalendarSupport
::
KCalPrefs
::
instance
()
->
category
Color
(
categories
.
first
());
return
Akonadi
::
TagCache
::
instance
()
->
tag
Color
(
categories
.
first
());
}
QColor
AgendaItem
::
getFrameColor
(
const
QColor
&
resourceColor
,
const
QColor
&
categoryColor
)
const
...
...
src/month/monthitem.cpp
View file @
340af1a9
...
...
@@ -14,6 +14,7 @@
#include
<Akonadi/CalendarUtils>
#include
<Akonadi/IncidenceChanger>
#include
<Akonadi/TagCache>
#include
<CalendarSupport/KCalPrefs>
#include
<CalendarSupport/Utils>
...
...
@@ -564,14 +565,14 @@ QColor IncidenceMonthItem::catColor() const
const
auto
&
prefs
=
monthScene
()
->
monthView
()
->
preferences
();
const
auto
&
categories
=
mIncidence
->
categories
();
if
(
categories
.
isEmpty
()
||
!
CalendarSupport
::
KCalPrefs
::
instance
()
->
hasCategory
Color
(
categories
.
first
()))
{
if
(
categories
.
isEmpty
()
||
!
Akonadi
::
TagCache
::
instance
()
->
tag
Color
(
categories
.
first
())
.
isValid
()
)
{
const
auto
&
colorPreference
=
prefs
->
monthViewColors
();
if
(
colorPreference
==
PrefsBase
::
CategoryOnly
)
{
return
CalendarSupport
::
KCalPrefs
::
instance
()
->
unsetCategoryColor
();
}
return
EventViews
::
resourceColor
(
akonadiItem
(),
prefs
);
}
return
CalendarSupport
::
KCalPrefs
::
instance
()
->
category
Color
(
categories
.
first
());
return
Akonadi
::
TagCache
::
instance
()
->
tag
Color
(
categories
.
first
());
}
QColor
IncidenceMonthItem
::
bgColor
()
const
...
...
src/todo/todomodel.cpp
View file @
340af1a9
...
...
@@ -7,7 +7,6 @@
#include
"todomodel.h"
#include
<CalendarSupport/KCalPrefs>
#include
<CalendarSupport/Utils>
#include
<KCalUtils/IncidenceFormatter>
#include
<KCalendarCore/Attachment>
...
...
@@ -17,6 +16,7 @@
#include
<Akonadi/CalendarUtils>
#include
<Akonadi/IncidenceTreeModel>
#include
<Akonadi/TagCache>
#include
<KCalUtils/DndFactory>
#include
<KCalUtils/ICalDrag>
...
...
@@ -276,7 +276,7 @@ QVariant TodoModel::data(const QModelIndex &index, int role) const
return
QVariant
(
QIcon
::
fromTheme
(
QStringLiteral
(
"task-recurring"
)));
}
const
QStringList
categories
=
todo
->
categories
();
return
categories
.
isEmpty
()
?
QVariant
()
:
QVariant
(
CalendarSupport
::
KCalPrefs
::
instance
()
->
category
Color
(
categories
.
first
()));
return
categories
.
isEmpty
()
?
QVariant
()
:
QVariant
(
Akonadi
::
TagCache
::
instance
()
->
tag
Color
(
categories
.
first
()));
}
else
if
(
role
==
Qt
::
DecorationRole
)
{
return
{};
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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