Commit dce7d686 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Port away from deprecated KF methods

parent fb87efe4
......@@ -48,17 +48,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "gvbrowserextension.h"
#include "gvpart.h"
//Factory Code
K_PLUGIN_FACTORY_WITH_JSON(GVPartFactory, "gvpart.json", registerPlugin<Gwenview::GVPart>();)
namespace Gwenview
{
GVPart::GVPart(QWidget* parentWidget, QObject* parent, const QVariantList& /*args*/)
K_PLUGIN_CLASS_WITH_JSON(GVPart, "gvpart.json")
GVPart::GVPart(QWidget* parentWidget, QObject* parent, const KPluginMetaData &metaData, const QVariantList& /*args*/)
: KParts::ReadOnlyPart(parent)
{
QScopedPointer<KAboutData> aboutData(createAboutData());
setComponentData(*aboutData, false);
setMetaData(metaData);
auto* container = new DocumentViewContainer(parentWidget);
setWidget(container);
......@@ -117,16 +115,6 @@ bool GVPart::openUrl(const QUrl& url)
return true;
}
KAboutData* GVPart::createAboutData()
{
KAboutData* aboutData = Gwenview::createAboutData(
QStringLiteral("gvpart"), /* appname */
i18n("Gwenview KPart") /* programName */
);
aboutData->setShortDescription(i18n("An Image Viewer"));
return aboutData;
}
inline void addActionToMenu(QMenu* menu, KActionCollection* actionCollection, const char* name)
{
QAction* action = actionCollection->action(name);
......
......@@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <lib/document/document.h>
class KAboutData;
class KPluginMetaData;
namespace Gwenview
{
......@@ -39,9 +40,7 @@ class GVPart : public KParts::ReadOnlyPart
{
Q_OBJECT
public:
GVPart(QWidget* parentWidget, QObject* parent, const QVariantList&);
static KAboutData* createAboutData();
GVPart(QWidget* parentWidget, QObject* parent, const KPluginMetaData &metaData, const QVariantList &);
protected:
bool openUrl(const QUrl &url) override;
......
......@@ -93,7 +93,7 @@ void ContextManagerTest::testInvalidDirUrl()
DirLister()
: mOpenUrlCalled(false)
{
setAutoErrorHandlingEnabled(false, nullptr);
setAutoErrorHandlingEnabled(false);
}
bool openUrl(const QUrl &url, OpenUrlFlags flags = NoFlags) 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