Commit a360c512 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Port to new KPluginMetaData-based KParts API

NO_CHANGELOG
parent 41d46235
configure_file(dragonplayer_part.desktop ${CMAKE_CURRENT_BINARY_DIR}/dragonplayer_part.desktop @ONLY)
install(PROGRAMS org.kde.dragonplayer.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES dragonplayer-opendvd.desktop dragonplayer-openaudiocd.desktop DESTINATION ${DATA_INSTALL_DIR}/solid/actions )
install(FILES dragonplayer_part.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dragonplayer_part.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install(FILES dragonplayerrc DESTINATION ${CONFIG_INSTALL_DIR})
install(FILES dragonplayer_play_dvd.desktop DESTINATION ${SERVICES_INSTALL_DIR}/ServiceMenus)
install(FILES org.kde.dragonplayer.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
......
......@@ -111,3 +111,11 @@ X-KDE-ServiceTypes=KParts/ReadOnlyPart
X-KDE-Library=kf5/parts/dragonpart
InitialPreference=9
MimeType=video/ogg;video/x-theora+ogg;video/x-ogm+ogg;video/x-ms-wmv;video/x-msvideo;video/x-ms-asf;video/x-matroska;video/mpeg;video/avi;video/quicktime;video/vnd.rn-realvideo;video/x-flic;video/mp4;video/x-flv;video/webm;
X-KDE-PluginInfo-Name=dragonpart
X-KDE-PluginInfo-Version=@DragonPlayer_VERSION@
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-Copyright=Copyright 2006 Max Howell, 2007 Ian Monroe
X-KDE-PluginInfo-Authors=Max Howell,Ian Monroe
X-KDE-PluginInfo-Emails=max.howell@methylblue.com,ian@monroe.nu
X-KDE-PluginInfo-Website=https://commits.kde.org/dragon
......@@ -60,7 +60,7 @@ set(videoplayer_part_SRCS
partToolBar.cpp )
add_library(dragonpart MODULE ${videoplayer_part_SRCS})
kcoreaddons_desktop_to_json(dragonpart ${CMAKE_SOURCE_DIR}/misc/dragonplayer_part.desktop)
kcoreaddons_desktop_to_json(dragonpart ${CMAKE_BINARY_DIR}/misc/dragonplayer_part.desktop)
target_link_libraries(dragonpart
Qt5::Core
......
......@@ -12,7 +12,11 @@
#include "partToolBar.h"
#include "videoWindow.h"
#if KPARTS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
#include <KPluginMetaData>
#else
#include <KAboutData>
#endif
#include <KActionCollection>
#include <KPluginFactory>
#include <KToggleAction>
......@@ -32,11 +36,20 @@ K_PLUGIN_FACTORY_WITH_JSON(CodeineFactory, "dragonplayer_part.json",
namespace Dragon
{
Part::Part( QWidget* parentWidget, QObject* parent, const QList<QVariant>& /*args*/ )
#if KPARTS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
Part::Part(QWidget* parentWidget, QObject* parent, const KPluginMetaData& metaData, const QVariantList& /*args*/)
#else
Part::Part(QWidget* parentWidget, QObject* parent, const QVariantList& /*args*/)
#endif
: ReadOnlyPart( parent )
, m_statusBarExtension( new KParts::StatusBarExtension( this ) )
, m_playPause( nullptr )
{
#if KPARTS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
setMetaData(metaData);
#else
setComponentData(*createAboutData());
#endif
KActionCollection * const ac = actionCollection();
setWidget( new QWidget( parentWidget ) ); //, widgetName
......@@ -86,6 +99,7 @@ namespace Dragon
return true;
}
#if KPARTS_VERSION < QT_VERSION_CHECK(5, 77, 0)
KAboutData* Part::createAboutData()
{
// generic factory expects this on the heap
......@@ -97,6 +111,7 @@ namespace Dragon
"https://multimedia.kde.org",
"imonroe@kde.org" );
}
#endif
void Part::videoContextMenu( const QPoint & pos )
{
......
......@@ -12,11 +12,15 @@
#include <QList>
#include <kparts_version.h>
#include <KParts/StatusBarExtension>
#include <KParts/ReadOnlyPart>
#include <QUrl>
#include <Phonon/MediaSource>
#if KPARTS_VERSION < QT_VERSION_CHECK(5, 77, 0)
class KAboutData;
#endif
namespace Dragon
......@@ -27,11 +31,17 @@ class Part : public KParts::ReadOnlyPart
{
Q_OBJECT
public:
Part(QWidget* parentWidget, QObject* parent, const QList<QVariant>& /*args*/ );
#if KPARTS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
Part(QWidget* parentWidget, QObject* parent, const KPluginMetaData& metaData, const QVariantList& /*args*/);
#else
Part(QWidget* parentWidget, QObject* parent, const QVariantList& /*args*/);
#endif
bool closeUrl() override;
#if KPARTS_VERSION < QT_VERSION_CHECK(5, 77, 0)
static KAboutData *createAboutData();
#endif
public Q_SLOTS:
bool openUrl( const QUrl& ) override;
......
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