From 5c2befabff2184ce0ca1087d4ccfd121d806a239 Mon Sep 17 00:00:00 2001 From: nowrep Date: Wed, 7 Mar 2012 20:01:57 +0100 Subject: [PATCH] Fixed loading of plugins. Regression from previous commit. --- src/lib/navigation/websearchbar.cpp | 4 ++-- src/lib/navigation/websearchbar.h | 2 +- src/lib/other/pagescreen.cpp | 5 +++-- src/lib/plugins/pluginproxy.cpp | 2 +- src/lib/plugins/pluginproxy.h | 3 ++- src/lib/plugins/plugins.cpp | 9 +++------ 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/lib/navigation/websearchbar.cpp b/src/lib/navigation/websearchbar.cpp index 0fa375420..33072a62d 100644 --- a/src/lib/navigation/websearchbar.cpp +++ b/src/lib/navigation/websearchbar.cpp @@ -34,7 +34,7 @@ #include #include -WebSearchBar_Button::WebSearchBar_Button(QWidget *parent) +WebSearchBar_Button::WebSearchBar_Button(QWidget* parent) : ClickableLabel(parent) { setObjectName("websearchbar-searchbutton"); @@ -42,7 +42,7 @@ WebSearchBar_Button::WebSearchBar_Button(QWidget *parent) setFocusPolicy(Qt::ClickFocus); } -void WebSearchBar_Button::contextMenuEvent(QContextMenuEvent *event) +void WebSearchBar_Button::contextMenuEvent(QContextMenuEvent* event) { event->accept(); } diff --git a/src/lib/navigation/websearchbar.h b/src/lib/navigation/websearchbar.h index 514017db6..22452cec2 100644 --- a/src/lib/navigation/websearchbar.h +++ b/src/lib/navigation/websearchbar.h @@ -41,7 +41,7 @@ public: explicit WebSearchBar_Button(QWidget* parent = 0); private: - void contextMenuEvent(QContextMenuEvent *event); + void contextMenuEvent(QContextMenuEvent* event); }; class QT_QUPZILLA_EXPORT WebSearchBar : public LineEdit diff --git a/src/lib/other/pagescreen.cpp b/src/lib/other/pagescreen.cpp index 996e87016..9a50e4653 100644 --- a/src/lib/other/pagescreen.cpp +++ b/src/lib/other/pagescreen.cpp @@ -53,11 +53,12 @@ PageScreen::PageScreen(WebView* view, QWidget* parent) void PageScreen::dialogAccepted() { const QString &path = QFileDialog::getSaveFileName(this, tr("Save Page Screen..."), - QString("%1.png").arg(qz_filterCharsFromFilename(m_pageTitle))); + QDir::homePath() + "/" + QString("%1.png").arg(qz_filterCharsFromFilename(m_pageTitle))); if (!path.isEmpty()) { m_pageImage.save(path); - close(); + + QTimer::singleShot(0, this, SLOT(close())); } } diff --git a/src/lib/plugins/pluginproxy.cpp b/src/lib/plugins/pluginproxy.cpp index a5a8a98f5..1379aa82c 100644 --- a/src/lib/plugins/pluginproxy.cpp +++ b/src/lib/plugins/pluginproxy.cpp @@ -160,7 +160,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(const Qz::ObjectName &type, QObject* obj, QWheelEvent* event) { bool accepted = false; diff --git a/src/lib/plugins/pluginproxy.h b/src/lib/plugins/pluginproxy.h index b716a1a95..cd14e1806 100644 --- a/src/lib/plugins/pluginproxy.h +++ b/src/lib/plugins/pluginproxy.h @@ -28,7 +28,8 @@ class QT_QUPZILLA_EXPORT PluginProxy : public Plugins public: enum EventHandlerType { MouseDoubleClickHandler, MousePressHandler, MouseReleaseHandler, MouseMoveHandler, KeyPressHandler, KeyReleaseHandler, - WheelEventHandler}; + WheelEventHandler + }; explicit PluginProxy(); diff --git a/src/lib/plugins/plugins.cpp b/src/lib/plugins/plugins.cpp index 0ecf516eb..a7fbdf508 100644 --- a/src/lib/plugins/plugins.cpp +++ b/src/lib/plugins/plugins.cpp @@ -50,12 +50,9 @@ bool Plugins::loadPlugin(Plugins::Plugin* plugin) return false; } - int index = m_availablePlugins.indexOf(*plugin); - if (index == -1) { - return false; - } - - m_availablePlugins[index].instance = initPlugin(iPlugin, plugin->pluginLoader); + m_availablePlugins.removeOne(*plugin); + plugin->instance = initPlugin(iPlugin, plugin->pluginLoader); + m_availablePlugins.append(*plugin); refreshLoadedPlugins();