fix: warnings when compiling with Qt 6.10 (#6422)
This commit is contained in:
@@ -140,7 +140,12 @@ void ImageUploader::logToFile(const QString &originalFilePath,
|
||||
// local path to an image (can be empty)
|
||||
// timestamp
|
||||
QSaveFile logSaveFile(logFileName);
|
||||
logSaveFile.open(QIODevice::WriteOnly | QIODevice::Text);
|
||||
if (!logSaveFile.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
{
|
||||
qCDebug(chatterinoImageuploader)
|
||||
<< "Failed to open log file" << logSaveFile.errorString();
|
||||
return;
|
||||
}
|
||||
QJsonArray entries = QJsonDocument::fromJson(logs).array();
|
||||
entries.push_back(newLogEntry);
|
||||
logSaveFile.write(QJsonDocument(entries).toJson());
|
||||
|
||||
@@ -178,7 +178,13 @@ void Updates::installUpdates()
|
||||
combinePath(this->paths.miscDirectory, "update.zip");
|
||||
|
||||
QFile file(filename);
|
||||
file.open(QIODevice::Truncate | QIODevice::WriteOnly);
|
||||
if (!file.open(QIODevice::Truncate | QIODevice::WriteOnly))
|
||||
{
|
||||
qCWarning(chatterinoUpdate)
|
||||
<< "Failed to save update.zip" << file.errorString();
|
||||
this->setStatus_(WriteFileFailed);
|
||||
return;
|
||||
}
|
||||
|
||||
if (file.write(object) == -1)
|
||||
{
|
||||
@@ -238,7 +244,9 @@ void Updates::installUpdates()
|
||||
combinePath(this->paths.miscDirectory, "Update.exe");
|
||||
|
||||
QFile file(filePath);
|
||||
file.open(QIODevice::Truncate | QIODevice::WriteOnly);
|
||||
// write() will fail if we couldn't open
|
||||
std::ignore =
|
||||
file.open(QIODevice::Truncate | QIODevice::WriteOnly);
|
||||
|
||||
if (file.write(object) == -1)
|
||||
{
|
||||
|
||||
@@ -128,7 +128,12 @@ void LoggingChannel::openLogFile()
|
||||
qCDebug(chatterinoHelper) << "Logging to" << fileName;
|
||||
this->fileHandle.setFileName(fileName);
|
||||
|
||||
this->fileHandle.open(QIODevice::Append);
|
||||
if (!this->fileHandle.open(QIODevice::Append))
|
||||
{
|
||||
qCDebug(chatterinoHelper)
|
||||
<< "Failed to open file" << this->fileHandle.errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
appendLine(this->fileHandle, generateOpeningString(now));
|
||||
}
|
||||
@@ -159,7 +164,13 @@ void LoggingChannel::openStreamLogFile(const QString &streamID)
|
||||
qCDebug(chatterinoHelper) << "Logging stream to" << fileName;
|
||||
this->currentStreamFileHandle.setFileName(fileName);
|
||||
|
||||
this->currentStreamFileHandle.open(QIODevice::Append);
|
||||
if (!this->currentStreamFileHandle.open(QIODevice::Append))
|
||||
{
|
||||
qCDebug(chatterinoHelper)
|
||||
<< "Failed to open file"
|
||||
<< this->currentStreamFileHandle.errorString();
|
||||
return;
|
||||
}
|
||||
appendLine(this->currentStreamFileHandle, generateOpeningString(now));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user