mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
GreaseMonkey: Don't store absolute path to require scripts
This commit is contained in:
parent
f57d6d0682
commit
84477aa2dc
@ -1,6 +1,6 @@
|
||||
/* ============================================================
|
||||
* GreaseMonkey plugin for QupZilla
|
||||
* Copyright (C) 2012-2016 David Rosca <nowrep@gmail.com>
|
||||
* Copyright (C) 2012-2017 David Rosca <nowrep@gmail.com>
|
||||
*
|
||||
* 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
|
||||
@ -127,7 +127,7 @@ void GM_Downloader::requireDownloaded()
|
||||
|
||||
QSettings settings(m_manager->settinsPath() + QL1S("/greasemonkey/requires/requires.ini"), QSettings::IniFormat);
|
||||
settings.beginGroup("Files");
|
||||
settings.setValue(m_reply->request().url().toString(), fileName);
|
||||
settings.setValue(m_reply->request().url().toString(), QFileInfo(fileName).fileName());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,10 @@ QString GM_Manager::requireScripts(const QStringList &urlList) const
|
||||
|
||||
foreach (const QString &url, urlList) {
|
||||
if (settings.contains(url)) {
|
||||
const QString fileName = settings.value(url).toString();
|
||||
QString fileName = settings.value(url).toString();
|
||||
if (!QFileInfo(fileName).isAbsolute()) {
|
||||
fileName = m_settingsPath + QL1S("/greasemonkey/requires/") + fileName;
|
||||
}
|
||||
script.append(QzTools::readAllFileContents(fileName).trimmed() + '\n');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user