Commit 879b2d0b authored by David Faure's avatar David Faure
Browse files

kmplot_part: add JSON metadata to plugin, install into kf5/parts subdir

Test plan:
- removed lib64/plugins/kmplotpart.so
- kmplot still works (finds the part on startup)
- konqueror still allows to preview a fkt file
- lxr shows no other code loading "kmplotpart" by name directly

KF6 task: https://phabricator.kde.org/T12340
parent 83bdf5cf
...@@ -58,12 +58,13 @@ ki18n_wrap_ui(kmplotpart_PART_SRCS ...@@ -58,12 +58,13 @@ ki18n_wrap_ui(kmplotpart_PART_SRCS
kconfig_add_kcfg_files(kmplotpart_PART_SRCS settings.kcfgc ) kconfig_add_kcfg_files(kmplotpart_PART_SRCS settings.kcfgc )
add_library(kmplotpart MODULE ${kmplotpart_PART_SRCS}) add_library(kmplotpart MODULE ${kmplotpart_PART_SRCS})
kcoreaddons_desktop_to_json(kmplotpart kmplot_part.desktop)
target_link_libraries(kmplotpart Qt5::PrintSupport Qt5::Widgets KF5::Parts Qt5::Svg) target_link_libraries(kmplotpart Qt5::PrintSupport Qt5::Widgets KF5::Parts Qt5::Svg)
install(TARGETS kmplotpart DESTINATION ${KDE_INSTALL_PLUGINDIR} ) install(TARGETS kmplotpart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/parts)
########### next target ############### ########### next target ###############
......
...@@ -73,10 +73,10 @@ KmPlot::KmPlot( const QCommandLineParser& parser ) ...@@ -73,10 +73,10 @@ KmPlot::KmPlot( const QCommandLineParser& parser )
// this routine will find and load our Part. it finds the Part by // this routine will find and load our Part. it finds the Part by
// name which is a bad idea usually.. but it's alright in this // name which is a bad idea usually.. but it's alright in this
// case since our Part is made for this Shell // case since our Part is made for this Shell
KPluginFactory *factory = KPluginLoader(QStringLiteral("kmplotpart")).factory(); KPluginFactory *factory = KPluginLoader(QStringLiteral("kf5/parts/kmplotpart")).factory();
if (factory) if (factory)
{ {
// now that the Part is loaded, we cast it to a Part to get // ask the factory to create an instance of the part
// our hands on it // our hands on it
m_part = factory->create<KParts::ReadWritePart>(this); m_part = factory->create<KParts::ReadWritePart>(this);
if (m_part) if (m_part)
......
...@@ -66,5 +66,5 @@ Name[zh_CN]=KmPlot 组件 ...@@ -66,5 +66,5 @@ Name[zh_CN]=KmPlot 组件
Name[zh_TW]=KmPlotPart Name[zh_TW]=KmPlotPart
MimeType=application/x-kmplot; MimeType=application/x-kmplot;
X-KDE-ServiceTypes=KParts/ReadOnlyPart X-KDE-ServiceTypes=KParts/ReadOnlyPart
X-KDE-Library=kmplotpart X-KDE-Library=kf5/parts/kmplotpart
Type=Service Type=Service
...@@ -123,7 +123,7 @@ class SettingsPageDiagram : public QWidget, public Ui::SettingsPageDiagram ...@@ -123,7 +123,7 @@ class SettingsPageDiagram : public QWidget, public Ui::SettingsPageDiagram
bool MainDlg::oldfileversion; bool MainDlg::oldfileversion;
MainDlg * MainDlg::m_self = 0; MainDlg * MainDlg::m_self = 0;
K_PLUGIN_FACTORY( KmPlotPartFactory, registerPlugin<MainDlg>(); ) K_PLUGIN_CLASS_WITH_JSON(MainDlg, "kmplot_part.json")
//BEGIN class MainDlg //BEGIN class MainDlg
MainDlg::MainDlg(QWidget *parentWidget, QObject *parent, const QVariantList& ) : MainDlg::MainDlg(QWidget *parentWidget, QObject *parent, const QVariantList& ) :
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment