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
SDK
Kompare
Commits
ac3ec3f4
Commit
ac3ec3f4
authored
Oct 14, 2022
by
Nicolas Fella
Browse files
Port away from deprecated KServiceTypeTrader
parent
1292ada7
Pipeline
#260735
passed with stage
in 1 minute and 31 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
ac3ec3f4
...
...
@@ -13,7 +13,7 @@ set(KOMPARE_VERSION "${KOMPARE_BASE_VERSION}.${RELEASE_SERVICE_COMPACT_VERSION}"
project
(
Kompare VERSION
${
KOMPARE_VERSION
}
)
set
(
QT_MIN_VERSION
"5.15.2"
)
set
(
KF5_MIN_VERSION
"5.
9
0.0"
)
set
(
KF5_MIN_VERSION
"5.
10
0.0"
)
find_package
(
ECM
${
KF5_MIN_VERSION
}
NO_MODULE REQUIRED
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
${
ECM_MODULE_PATH
}
)
...
...
src/app/kompare_shell.cpp
View file @
ac3ec3f4
...
...
@@ -18,6 +18,7 @@
#include
<KTextEditor/Document>
#include
<KTextEditor/View>
#include
<KParts/PartLoader>
#include
<KEditToolBar>
#include
<KFile>
#include
<KShortcutsDialog>
...
...
@@ -25,7 +26,6 @@
#include
<KMessageBox>
#include
<KSqueezedTextLabel>
#include
<KStandardAction>
#include
<KServiceTypeTrader>
#include
<KSharedConfig>
#include
<KToggleAction>
#include
<KActionCollection>
...
...
@@ -399,11 +399,12 @@ void KompareShell::slotShowTextView()
m_textViewWidget
=
new
QDockWidget
(
i18nc
(
"@title:window"
,
"Text View"
),
this
);
m_textViewWidget
->
setObjectName
(
QStringLiteral
(
"Text View"
));
// m_textViewWidget = createDockWidget(i18n("Text View"), SmallIcon("text-x-generic"));
m_textViewPart
=
KServiceTypeTrader
::
createInstanceFromQuery
<
KTextEditor
::
Document
>
(
QStringLiteral
(
"
KTextEditor
/
Document
"
),
this
,
this
,
QString
(),
QVariantList
(),
&
error
);
if
(
m_textViewPar
t
)
const
auto
result
=
KParts
::
PartLoader
::
instantiatePart
<
KTextEditor
::
Document
>
(
KPluginMetaData
(
QStringLiteral
(
"kf"
QT_STRINGIFY
(
QT_VERSION_MAJOR
)
"/parts/katepart"
)),
this
,
this
);
if
(
resul
t
)
{
m_textViewPart
=
result
.
plugin
;
m_textView
=
qobject_cast
<
KTextEditor
::
View
*>
(
m_textViewPart
->
createView
(
this
));
m_textViewWidget
->
setWidget
(
static_cast
<
QWidget
*>
(
m_textView
));
m_textViewPart
->
setHighlightingMode
(
QStringLiteral
(
"Diff"
));
...
...
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