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:
parent
d6b142bba2
commit
54a6f65bee
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user