1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

[GreaseMonkey] Fixed loading userscripts when first enabling plugin.

This commit is contained in:
nowrep 2013-05-24 14:56:47 +02:00
parent ace07520d6
commit 5ee5d66e18
2 changed files with 17 additions and 3 deletions

View File

@ -10,6 +10,7 @@ Version 1.5.0
* proxy exceptions now supports wildcards (*, ?)
* cancel upload when trying to upload non-readable files
* GreaseMonkey: added support for GM_Settings
* GreaseMonkey: fixed userscripts when first loading plugin
* oxygen: set rounded corners for tooltips
* oxygen: workaround for transparent background of tooltips
* fixed: size of preferences dialog on low-res screens

View File

@ -22,6 +22,9 @@
#include "pluginproxy.h"
#include "mainapplication.h"
#include "emptynetworkreply.h"
#include "tabwidget.h"
#include "webtab.h"
#include "tabbedwebview.h"
#include <QTranslator>
#include <QNetworkRequest>
@ -38,7 +41,7 @@ PluginSpec GM_Plugin::pluginSpec()
spec.name = "GreaseMonkey";
spec.info = "Userscripts for QupZilla";
spec.description = "Provides support for userscripts (www.userscripts.org)";
spec.version = "0.3.1";
spec.version = "0.3.2";
spec.author = "David Rosca <nowrep@gmail.com>";
spec.icon = QPixmap(":gm/data/icon.png");
spec.hasSettings = true;
@ -48,12 +51,22 @@ PluginSpec GM_Plugin::pluginSpec()
void GM_Plugin::init(InitState state, const QString &settingsPath)
{
Q_UNUSED(state)
m_manager = new GM_Manager(settingsPath, this);
m_settingsPath = settingsPath;
connect(mApp->plugins(), SIGNAL(webPageCreated(WebPage*)), this, SLOT(webPageCreated(WebPage*)));
// Make sure userscripts works also with already created WebPages
if (state == LateInitState) {
foreach (QupZilla* window, mApp->mainWindows()) {
for (int i = 0; i < window->tabWidget()->count(); ++i) {
WebTab* tab = qobject_cast<WebTab*>(window->tabWidget()->widget(i));
if (tab) {
webPageCreated(tab->view()->page());
}
}
}
}
}
void GM_Plugin::unload()