From 5e1635bffa842e9f6ed0abe16dc69fa3256c50a8 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sun, 25 Feb 2018 21:54:25 +0100 Subject: [PATCH] PluginProxy: Don't pass enum as constref --- src/lib/plugins/pluginproxy.cpp | 17 ++++++++--------- src/lib/plugins/pluginproxy.h | 16 ++++++++-------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/lib/plugins/pluginproxy.cpp b/src/lib/plugins/pluginproxy.cpp index 3a0f0750c..6f6a5df05 100644 --- a/src/lib/plugins/pluginproxy.cpp +++ b/src/lib/plugins/pluginproxy.cpp @@ -28,7 +28,7 @@ PluginProxy::PluginProxy(QObject *parent) connect(this, SIGNAL(pluginUnloaded(PluginInterface*)), this, SLOT(pluginUnloaded(PluginInterface*))); } -void PluginProxy::registerAppEventHandler(const PluginProxy::EventHandlerType &type, PluginInterface* obj) +void PluginProxy::registerAppEventHandler(PluginProxy::EventHandlerType type, PluginInterface* obj) { switch (type) { case MouseDoubleClickHandler: @@ -112,7 +112,7 @@ void PluginProxy::populateExtensionsMenu(QMenu *menu) } } -bool PluginProxy::processMouseDoubleClick(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event) +bool PluginProxy::processMouseDoubleClick(Qz::ObjectName type, QObject* obj, QMouseEvent* event) { bool accepted = false; @@ -125,7 +125,7 @@ bool PluginProxy::processMouseDoubleClick(const Qz::ObjectName &type, QObject* o return accepted; } -bool PluginProxy::processMousePress(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event) +bool PluginProxy::processMousePress(Qz::ObjectName type, QObject* obj, QMouseEvent* event) { bool accepted = false; @@ -138,7 +138,7 @@ bool PluginProxy::processMousePress(const Qz::ObjectName &type, QObject* obj, QM return accepted; } -bool PluginProxy::processMouseRelease(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event) +bool PluginProxy::processMouseRelease(Qz::ObjectName type, QObject* obj, QMouseEvent* event) { bool accepted = false; @@ -151,7 +151,7 @@ bool PluginProxy::processMouseRelease(const Qz::ObjectName &type, QObject* obj, return accepted; } -bool PluginProxy::processMouseMove(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event) +bool PluginProxy::processMouseMove(Qz::ObjectName type, QObject* obj, QMouseEvent* event) { bool accepted = false; @@ -164,7 +164,7 @@ bool PluginProxy::processMouseMove(const Qz::ObjectName &type, QObject* obj, QMo return accepted; } -bool PluginProxy::processWheelEvent(const Qz::ObjectName &type, QObject* obj, QWheelEvent* event) +bool PluginProxy::processWheelEvent(Qz::ObjectName type, QObject* obj, QWheelEvent* event) { bool accepted = false; @@ -177,7 +177,7 @@ bool PluginProxy::processWheelEvent(const Qz::ObjectName &type, QObject* obj, QW return accepted; } -bool PluginProxy::processKeyPress(const Qz::ObjectName &type, QObject* obj, QKeyEvent* event) +bool PluginProxy::processKeyPress(Qz::ObjectName type, QObject* obj, QKeyEvent* event) { bool accepted = false; @@ -190,7 +190,7 @@ bool PluginProxy::processKeyPress(const Qz::ObjectName &type, QObject* obj, QKey return accepted; } -bool PluginProxy::processKeyRelease(const Qz::ObjectName &type, QObject* obj, QKeyEvent* event) +bool PluginProxy::processKeyRelease(Qz::ObjectName type, QObject* obj, QKeyEvent* event) { bool accepted = false; @@ -235,4 +235,3 @@ void PluginProxy::emitMainWindowDeleted(BrowserWindow* window) { emit mainWindowDeleted(window); } - diff --git a/src/lib/plugins/pluginproxy.h b/src/lib/plugins/pluginproxy.h index a7ae9a874..f1bacecab 100644 --- a/src/lib/plugins/pluginproxy.h +++ b/src/lib/plugins/pluginproxy.h @@ -37,20 +37,20 @@ public: explicit PluginProxy(QObject *parent = nullptr); - void registerAppEventHandler(const EventHandlerType &type, PluginInterface* obj); + void registerAppEventHandler(EventHandlerType type, PluginInterface* obj); void populateWebViewMenu(QMenu* menu, WebView* view, const WebHitTestResult &r); void populateExtensionsMenu(QMenu *menu); - bool processMouseDoubleClick(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event); - bool processMousePress(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event); - bool processMouseRelease(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event); - bool processMouseMove(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event); + bool processMouseDoubleClick(Qz::ObjectName type, QObject* obj, QMouseEvent* event); + bool processMousePress(Qz::ObjectName type, QObject* obj, QMouseEvent* event); + bool processMouseRelease(Qz::ObjectName type, QObject* obj, QMouseEvent* event); + bool processMouseMove(Qz::ObjectName type, QObject* obj, QMouseEvent* event); - bool processWheelEvent(const Qz::ObjectName &type, QObject* obj, QWheelEvent* event); + bool processWheelEvent(Qz::ObjectName type, QObject* obj, QWheelEvent* event); - bool processKeyPress(const Qz::ObjectName &type, QObject* obj, QKeyEvent* event); - bool processKeyRelease(const Qz::ObjectName &type, QObject* obj, QKeyEvent* event); + bool processKeyPress(Qz::ObjectName type, QObject* obj, QKeyEvent* event); + bool processKeyRelease(Qz::ObjectName type, QObject* obj, QKeyEvent* event); bool acceptNavigationRequest(WebPage *page, const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame);