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
Multimedia
K3b
Commits
9e099ffe
Commit
9e099ffe
authored
Aug 18, 2021
by
Nicolas Fella
Committed by
Albert Astals Cid
Sep 12, 2021
Browse files
Port away from KServiceTypeTrader
KServiceTypeTrader will be deprecated, use KPluginFactory to load the cddb KCM
parent
08de2191
Changes
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
9e099ffe
...
...
@@ -9,7 +9,8 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE
project
(
k3b VERSION
${
RELEASE_SERVICE_VERSION
}
)
set
(
QT_MIN_VERSION
"5.10.0"
)
set
(
KF5_MIN_VERSION
"5.72.0"
)
set
(
KF5_MIN_VERSION
"5.86.0"
)
set
(
KDE_COMPILERSETTINGS_LEVEL
"5.84"
)
find_package
(
ECM
${
KF5_MIN_VERSION
}
REQUIRED NO_MODULE
)
set
(
CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/modules"
"
${
ECM_MODULE_PATH
}
"
)
...
...
libk3b/plugin/k3bpluginmanager.cpp
View file @
9e099ffe
...
...
@@ -14,7 +14,6 @@
#include
<KCModuleProxy>
#include
<KPluginInfo>
#include
<KService>
#include
<KServiceTypeTrader>
#include
<KPluginLoader>
#include
<KPluginMetaData>
#include
<KMessageBox>
...
...
src/option/k3bcddboptiontab.cpp
View file @
9e099ffe
...
...
@@ -8,8 +8,8 @@
#include
<KCModule>
#include
<KService>
#include
<KServiceTypeTrader>
#include
<KLocalizedString>
#include
<KPluginFactory>
#include
<QLabel>
#include
<QHBoxLayout>
...
...
@@ -22,20 +22,14 @@ K3b::CddbOptionTab::CddbOptionTab( QWidget* parent )
layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
m_cddbKcm
=
0
;
if
(
KService
::
Ptr
service
=
KService
::
serviceByStorageId
(
"libkcddb.desktop"
)
)
m_cddbKcm
=
service
->
createInstance
<
KCModule
>
(
this
);
if
(
!
m_cddbKcm
)
{
KService
::
List
services
=
KServiceTypeTrader
::
self
()
->
query
(
"KCModule"
,
"[X-KDE-Library] == 'kcm_cddb'"
);
if
(
!
services
.
isEmpty
()
)
{
m_cddbKcm
=
services
.
first
()
->
createInstance
<
KCModule
>
(
this
);
}
}
if
(
m_cddbKcm
)
{
const
auto
result
=
KPluginFactory
::
instantiatePlugin
<
KCModule
>
(
KPluginMetaData
(
QStringLiteral
(
"kcm_cddb"
)),
this
);
if
(
result
)
{
m_cddbKcm
=
result
.
plugin
;
m_cddbKcm
->
layout
()
->
setContentsMargins
(
0
,
0
,
0
,
0
);
layout
->
addWidget
(
m_cddbKcm
);
}
else
{
}
else
{
QLabel
*
label
=
new
QLabel
(
i18n
(
"Unable to load KCDDB configuration module."
),
this
);
label
->
setAlignment
(
Qt
::
AlignCenter
);
layout
->
addWidget
(
label
);
...
...
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