mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-16 07:22:16 -07:00
fix: build on both qt < and >= 6.10.0
This commit is contained in:
parent
3ae4a7d8a7
commit
1a62ee2e57
8 changed files with 57 additions and 27 deletions
|
|
@ -51,7 +51,11 @@ void Logger::openLogfileSession()
|
|||
}
|
||||
|
||||
fileHandle.setFileName(LOGGER_FILENAME);
|
||||
fileHandle.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text);
|
||||
const auto result = fileHandle.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text);
|
||||
if (!result) {
|
||||
std::cerr << "Error: Failed to open log file: " << fileHandle.errorString().toStdString() << std::endl;
|
||||
return;
|
||||
}
|
||||
fileStream.setDevice(&fileHandle);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
fileStream << "Log session started at " << QDateTime::currentDateTime().toString() << Qt::endl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue