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

AdBlock: Fix saving subscriptions

QSaveFile doesn't support QFile::Truncate mode
This commit is contained in:
David Rosca 2017-07-01 18:50:25 +02:00
parent d6b142bba2
commit 54a6f65bee
2 changed files with 2 additions and 2 deletions

View File

@ -202,7 +202,7 @@ AdBlockSubscription* AdBlockManager::addSubscription(const QString &title, const
QByteArray data = QString("Title: %1\nUrl: %2\n[Adblock Plus 1.1.1]").arg(title, url).toLatin1();
QSaveFile file(filePath);
if (!file.open(QFile::WriteOnly | QFile::Truncate)) {
if (!file.open(QFile::WriteOnly)) {
qWarning() << "AdBlockManager: Cannot write to file" << filePath;
return 0;
}

View File

@ -182,7 +182,7 @@ bool AdBlockSubscription::saveDownloadedData(const QByteArray &data)
{
QSaveFile file(m_filePath);
if (!file.open(QFile::ReadWrite | QFile::Truncate)) {
if (!file.open(QFile::WriteOnly)) {
qWarning() << "AdBlockSubscription::" << __FUNCTION__ << "Unable to open adblock file for writing:" << m_filePath;
return false;
}