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

GM_Script: Add iconUrl property

This commit is contained in:
David Rosca 2018-01-29 21:39:37 +01:00
parent 1c4937b64c
commit b5b77e7932
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
2 changed files with 14 additions and 1 deletions

View File

@ -76,6 +76,11 @@ QString GM_Script::version() const
return m_version; return m_version;
} }
QUrl GM_Script::iconUrl() const
{
return m_iconUrl;
}
QUrl GM_Script::downloadUrl() const QUrl GM_Script::downloadUrl() const
{ {
return m_downloadUrl; return m_downloadUrl;
@ -178,6 +183,7 @@ void GM_Script::parseScript()
m_include.clear(); m_include.clear();
m_exclude.clear(); m_exclude.clear();
m_require.clear(); m_require.clear();
m_iconUrl.clear();
m_downloadUrl.clear(); m_downloadUrl.clear();
m_updateUrl.clear(); m_updateUrl.clear();
m_startAt = DocumentEnd; m_startAt = DocumentEnd;
@ -269,6 +275,9 @@ void GM_Script::parseScript()
m_startAt = DocumentIdle; m_startAt = DocumentIdle;
} }
} }
else if (key == QL1S("@icon")) {
m_iconUrl = QUrl(value);
}
} }
if (!inMetadata) { if (!inMetadata) {
@ -276,6 +285,8 @@ void GM_Script::parseScript()
return; return;
} }
m_iconUrl = m_downloadUrl.resolved(m_iconUrl);
if (m_include.isEmpty()) { if (m_include.isEmpty()) {
m_include.append(QSL("*")); m_include.append(QSL("*"));
} }

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* GreaseMonkey plugin for Falkon * GreaseMonkey plugin for Falkon
* Copyright (C) 2012-2017 David Rosca <nowrep@gmail.com> * Copyright (C) 2012-2018 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -44,6 +44,7 @@ public:
QString description() const; QString description() const;
QString version() const; QString version() const;
QUrl iconUrl() const;
QUrl downloadUrl() const; QUrl downloadUrl() const;
QUrl updateUrl() const; QUrl updateUrl() const;
@ -89,6 +90,7 @@ private:
QStringList m_exclude; QStringList m_exclude;
QStringList m_require; QStringList m_require;
QUrl m_iconUrl;
QUrl m_downloadUrl; QUrl m_downloadUrl;
QUrl m_updateUrl; QUrl m_updateUrl;
StartAt m_startAt; StartAt m_startAt;