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
KOrganizer
Commits
849f69e5
Commit
849f69e5
authored
Aug 17, 2021
by
Nicolas Fella
Browse files
Use KPluginFactory to instantiate plugins
Instead of the homegrown factory
parent
5f13e6f3
Pipeline
#76462
passed with stage
in 12 minutes and 58 seconds
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
849f69e5
...
...
@@ -71,7 +71,7 @@ set(PIMCOMMON_LIB_VERSION "5.18.40")
set
(
LIBKDEPIM_LIB_VERSION
"5.18.40"
)
set
(
LIBINCIDENCEEDITOR_LIB_VERSION
"5.18.40"
)
set
(
CALENDARSUPPORT_LIB_VERSION
"5.18.40"
)
set
(
EVENTVIEW_LIB_VERSION
"5.18.4
0
"
)
set
(
EVENTVIEW_LIB_VERSION
"5.18.4
1
"
)
set
(
AKONADI_SEARCH_VERSION
"5.18.40"
)
find_package
(
KF5AkonadiSearch
${
AKONADI_SEARCH_VERSION
}
CONFIG REQUIRED
)
...
...
src/kocore.cpp
View file @
849f69e5
...
...
@@ -54,21 +54,14 @@ KService::List KOCore::availableCalendarDecorations()
EventViews
::
CalendarDecoration
::
Decoration
*
KOCore
::
loadCalendarDecoration
(
const
KService
::
Ptr
&
service
)
{
KPluginLoader
loader
(
*
service
);
auto
factory
=
loader
.
instance
();
auto
factory
=
loader
.
factory
();
if
(
!
factory
)
{
qCDebug
(
KORGANIZER_LOG
)
<<
"Factory creation failed"
;
return
nullptr
;
}
auto
pluginFactory
=
qobject_cast
<
EventViews
::
CalendarDecoration
::
DecorationFactory
*>
(
factory
);
if
(
!
pluginFactory
)
{
qCDebug
(
KORGANIZER_LOG
)
<<
"Cast failed"
;
return
nullptr
;
}
return
pluginFactory
->
createPluginFactory
();
return
factory
->
create
<
EventViews
::
CalendarDecoration
::
Decoration
>
();
}
void
KOCore
::
addXMLGUIClient
(
QWidget
*
wdg
,
KXMLGUIClient
*
guiclient
)
...
...
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