Commit 2ad8949c authored by David Faure's avatar David Faure
Browse files

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

Test plan:
 - removed lib64/plugins/kigpart.so
 - `kig` still works (finds the part on startup)
 - konqueror in filter/tests still allows to preview kig and kgeo files
 - lxr shows no other code loading "kigpart" by name directly

KF6 task: https://phabricator.kde.org/T12340
parent 6d0e37ad
......@@ -242,6 +242,8 @@ endif(BoostPython_FOUND)
add_library(kigpart MODULE ${kigpart_PART_SRCS})
generate_export_header(kigpart)
kcoreaddons_desktop_to_json(kigpart kig/kig_part.desktop)
target_link_libraries(kigpart
Qt5::Gui
Qt5::Svg
......@@ -268,7 +270,7 @@ ki18n_install(po)
if (KF5DocTools_FOUND)
kdoctools_install(po)
endif()
install(TARGETS kigpart DESTINATION ${KDE_INSTALL_PLUGINDIR})
install(TARGETS kigpart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/parts)
install(FILES org.kde.kig.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
# unit tests
......
......@@ -96,8 +96,8 @@ QStringList getDataFiles( const QString & folder )
return dataFiles;
}
// export this library...
K_PLUGIN_FACTORY( KigPartFactory, registerPlugin< KigPart >(); )
// export this class from this library...
K_PLUGIN_CLASS_WITH_JSON( KigPart, "kig_part.json")
SetCoordinateSystemAction::SetCoordinateSystemAction(
KigPart& d, KActionCollection* parent )
......@@ -189,9 +189,6 @@ KigPart::KigPart( QWidget *parentWidget, QObject *parent,
: KParts::ReadWritePart( parent ),
mMode( 0 ), mRememberConstruction( 0 ), mdocument( new KigDocument() )
{
// we need an instance
setComponentData( kigAboutData( "kig", I18N_NOOP( "KigPart" ) ) );
mMode = new NormalMode( *this );
// we need a widget, to actually show the document
......
......@@ -67,6 +67,6 @@ Name[zh_CN]=KigPart
Name[zh_TW]=KigPart
MimeType=application/x-kig;application/x-kgeo;image/x-xfig;application/x-cabri;application/x-drgeo;application/x-kseg;application/vnd.geogebra.file;
X-KDE-ServiceTypes=KParts/ReadOnlyPart,KParts/ReadWritePart
X-KDE-Library=kigpart
X-KDE-Library=kf5/parts/kigpart
Type=Service
Icon=kig
......@@ -38,7 +38,7 @@
static int convertToNative( const QUrl &file, const QByteArray& outfile )
{
KPluginLoader libraryLoader( QStringLiteral("kigpart") );
KPluginLoader libraryLoader( QStringLiteral("kf5/parts/kigpart") );
QLibrary library( libraryLoader.fileName() );
int ( *converterfunction )( const QUrl&, const QByteArray& );
converterfunction = ( int ( * )( const QUrl&, const QByteArray& ) ) library.resolve( "convertToNative" );
......
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