small RagePhoto cleanup
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Syping 2021-03-26 09:51:39 +01:00
parent b747f7cda5
commit 44ab5caedf

View file

@ -259,10 +259,10 @@ bool RagePhoto::load()
auto benchmark_parse_end = std::chrono::high_resolution_clock::now(); auto benchmark_parse_end = std::chrono::high_resolution_clock::now();
auto benchmark_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(benchmark_parse_end - benchmark_parse_start); auto benchmark_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(benchmark_parse_end - benchmark_parse_start);
if (p_inputMode == 1) { if (p_inputMode == 1) {
QTextStream(stdout) << QFileInfo(p_filePath).fileName() << ": " << static_cast<int>(benchmark_ns.count()) << "ns" << Qt::endl; QTextStream(stdout) << QFileInfo(p_filePath).fileName() << ": " << benchmark_ns.count() << "ns" << Qt::endl;
} }
else { else {
QTextStream(stdout) << "PGTA5" << p_jsonObject.value("uid").toInt() << ": " << static_cast<int>(benchmark_ns.count()) << "ns" << Qt::endl; QTextStream(stdout) << "PGTA5" << p_jsonObject.value("uid").toInt() << ": " << benchmark_ns.count() << "ns" << Qt::endl;
} }
#endif #endif
@ -424,10 +424,10 @@ bool RagePhoto::load()
auto benchmark_parse_end = std::chrono::high_resolution_clock::now(); auto benchmark_parse_end = std::chrono::high_resolution_clock::now();
auto benchmark_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(benchmark_parse_end - benchmark_parse_start); auto benchmark_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(benchmark_parse_end - benchmark_parse_start);
if (p_inputMode == 1) { if (p_inputMode == 1) {
QTextStream(stdout) << QFileInfo(p_filePath).fileName() << ": " << static_cast<int>(benchmark_ns.count()) << "ns" << Qt::endl; QTextStream(stdout) << QFileInfo(p_filePath).fileName() << ": " << benchmark_ns.count() << "ns" << Qt::endl;
} }
else { else {
QTextStream(stdout) << "PGTA5" << p_jsonObject.value("uid").toInt() << ": " << static_cast<int>(benchmark_ns.count()) << "ns" << Qt::endl; QTextStream(stdout) << "PGTA5" << p_jsonObject.value("uid").toInt() << ": " << benchmark_ns.count() << "ns" << Qt::endl;
} }
#endif #endif
@ -702,10 +702,6 @@ void RagePhoto::save(QIODevice *ioDevice, PhotoFormat photoFormat)
uInt32ToCharLE(p_endOfFile, uInt32Buffer); uInt32ToCharLE(p_endOfFile, uInt32Buffer);
ioDevice->write(uInt32Buffer, 4); ioDevice->write(uInt32Buffer, 4);
#if QT_VERSION >= 0x050000
ioDevice->aboutToClose();
#endif
} }
else if (photoFormat == PhotoFormat::GTA5) { else if (photoFormat == PhotoFormat::GTA5) {
char uInt32Buffer[4]; char uInt32Buffer[4];