Browse Source

Merge pull request #12350 from Chocobo1/log

Improve logging for errors
adaptive-webui-19844
Mike Tzou 5 years ago committed by GitHub
parent
commit
e7392de04c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/base/bittorrent/private/resumedatasavingmanager.cpp

9
src/base/bittorrent/private/resumedatasavingmanager.cpp

@ -44,12 +44,9 @@ void ResumeDataSavingManager::save(const QString &filename, const QByteArray &da @@ -44,12 +44,9 @@ void ResumeDataSavingManager::save(const QString &filename, const QByteArray &da
const QString filepath = m_resumeDataDir.absoluteFilePath(filename);
QSaveFile file {filepath};
if (file.open(QIODevice::WriteOnly)) {
file.write(data);
if (!file.commit()) {
Logger::instance()->addMessage(QString("Couldn't save data in '%1'. Error: %2")
.arg(filepath, file.errorString()), Log::WARNING);
}
if (!file.open(QIODevice::WriteOnly) || (file.write(data) != data.size()) || !file.commit()) {
LogMsg(tr("Couldn't save data to '%1'. Error: %2")
.arg(filepath, file.errorString()), Log::CRITICAL);
}
}

Loading…
Cancel
Save