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
System
KPMCore
Commits
d7912e21
Commit
d7912e21
authored
Jan 10, 2022
by
Andrius Štikonas
Browse files
Port away from KPluginLoader::factory.
parent
c31eabc8
Pipeline
#121255
passed with stage
in 53 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/backend/corebackendmanager.cpp
View file @
d7912e21
...
...
@@ -62,26 +62,23 @@ bool CoreBackendManager::load(const QString& name)
QString
path
=
QStringLiteral
(
"kpmcore/"
)
+
name
;
KPluginLoader
loader
(
path
);
KPluginFactory
*
factory
=
loader
.
factory
();
KPluginMetaData
metadata
(
path
);
d
->
m_Backend
=
KPluginFactory
::
instantiatePlugin
<
CoreBackend
>
(
metadata
).
plugin
;
if
(
factory
!=
nullptr
)
{
d
->
m_Backend
=
factory
->
create
<
CoreBackend
>
(
nullptr
);
QString
id
=
metadata
.
pluginId
();
QString
version
=
metadata
.
version
();
if
(
id
.
isEmpty
())
return
false
;
backend
()
->
setId
(
id
);
backend
()
->
setVersion
(
version
);
qDebug
()
<<
"Loaded backend plugin: "
<<
backend
()
->
id
();
return
true
;
if
(
!
backend
())
{
qWarning
()
<<
"Could not create instance of plugin "
<<
name
;
return
false
;
}
qWarning
()
<<
"Could not load plugin for core backend "
<<
name
<<
": "
<<
loader
.
errorString
();
return
false
;
QString
id
=
metadata
.
pluginId
();
QString
version
=
metadata
.
version
();
if
(
id
.
isEmpty
())
return
false
;
backend
()
->
setId
(
id
);
backend
()
->
setVersion
(
version
);
qDebug
()
<<
"Loaded backend plugin: "
<<
backend
()
->
id
();
return
true
;
}
void
CoreBackendManager
::
unload
()
...
...
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