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
Graphics
KImageMap Editor
Commits
d60bf674
Commit
d60bf674
authored
Jul 12, 2022
by
Nicolas Fella
Browse files
Port away from deprecated KPluginLoader
parent
9b8f3dbd
Pipeline
#217974
passed with stage
in 57 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
d60bf674
...
...
@@ -9,7 +9,8 @@ set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_
project
(
kimagemapeditor VERSION
${
RELEASE_SERVICE_VERSION
}
)
set
(
QT_MIN_VERSION
"5.15.0"
)
set
(
KF5_MIN_VERSION
"5.83.0"
)
set
(
KF5_MIN_VERSION
"5.86.0"
)
set
(
KDE_COMPILERSETTINGS_LEVEL
"5.83.0"
)
find_package
(
ECM
${
KF5_MIN_VERSION
}
REQUIRED CONFIG
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
${
ECM_MODULE_PATH
}
)
...
...
kimeshell.cpp
View file @
d60bf674
...
...
@@ -38,7 +38,6 @@
#include
<KToolBar>
#include
<KWindowConfig>
#include
<KXMLGUIFactory>
#include
<KPluginLoader>
#include
<KPluginFactory>
#include
<KPluginMetaData>
...
...
@@ -70,14 +69,9 @@ KimeShell::KimeShell(const char * )
setupActions
();
qCDebug
(
KIMAGEMAPEDITOR_LOG
)
<<
"KimeShell starting 2"
;
const
auto
plugins
=
KPluginLoader
::
findPlugins
(
QStringLiteral
(
"kf5/parts"
),
[](
const
KPluginMetaData
&
metaData
)
{
return
metaData
.
pluginId
()
==
QLatin1String
(
"kimagemapeditorpart"
);
});
const
auto
result
=
KPluginFactory
::
instantiatePlugin
<
KParts
::
ReadWritePart
>
(
KPluginMetaData
(
QStringLiteral
(
"kf5/parts/kimagemapeditorpart"
)),
this
);
KPluginFactory
*
factory
=
plugins
.
isEmpty
()
?
nullptr
:
KPluginLoader
(
plugins
.
first
().
fileName
()).
factory
();
if
(
!
factory
)
{
if
(
!
result
)
{
// can't do anything useful without part, thus quit the app
KMessageBox
::
error
(
this
,
i18n
(
"Could not find kimagemapeditorpart part!"
));
...
...
@@ -87,10 +81,10 @@ KimeShell::KimeShell(const char * )
return
;
}
m_part
=
factory
->
create
<
KParts
::
ReadWritePart
>
(
this
)
;
m_part
=
result
.
plugin
;
m_editorInterface
=
qobject_cast
<
KImageMapEditorInterface
*>
(
m_part
);
if
(
!
m_part
||
!
m_editorInterface
)
{
if
(
!
m_editorInterface
)
{
// can't do anything useful without part, thus quit the app
KMessageBox
::
error
(
this
,
i18n
(
"Could not create kimagemapeditorpart part!"
));
...
...
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