Add support for printing more information in diagnosis log

Also yacreaderlibraryserver can now print this with the --system-info option

This will help when giving support to users.
This commit is contained in:
Luis Ángel San Martín
2024-09-05 17:48:48 +02:00
parent a3f3149764
commit 1c48f05398
7 changed files with 90 additions and 49 deletions

View File

@ -0,0 +1,51 @@
#include "global_info_provider.h"
#include <QtCore>
#include <QImageReader>
#include <QPaintDevice>
#ifdef YACREADER_LIBRARY
#include <QSqlDatabase>
#endif
QString YACReader::getGlobalInfo()
{
QString text;
text.append("SYSTEM INFORMATION\n");
text.append(QString("Qt version: %1\n").arg(qVersion()));
text.append(QString("Build ABI: %1\n").arg(QSysInfo::buildAbi()));
text.append(QString("build CPU architecture: %1\n").arg(QSysInfo::buildCpuArchitecture()));
text.append(QString("CPU architecture: %1\n").arg(QSysInfo::currentCpuArchitecture()));
text.append(QString("Kernel type: %1\n").arg(QSysInfo::kernelType()));
text.append(QString("Kernel version: %1\n").arg(QSysInfo::kernelVersion()));
text.append(QString("Product info: %1\n").arg(QSysInfo::prettyProductName()));
text.append("\nAPP INFORMATION\n");
text.append(QString("Image formats supported: %1\n").arg(QImageReader::supportedImageFormats().join(", ")));
// append if sqlite driver is available
#ifdef YACREADER_LIBRARY
text.append(QString("SQLite driver available: %1\n").arg(QSqlDatabase::isDriverAvailable("QSQLITE") ? "yes" : "no"));
#endif
#ifdef use_unarr
text.append("Compression backend: unarr (no RAR5 support)\n");
#elif defined use_libarchive
text.append("Compression backend: libarchive\n");
#else
text.append("Compression backend: 7zip\n");
#endif
// print pdf backend used, poppler, pdfkit, pdfium
#ifdef NO_PDF
text.append("PDF support: None\n");
#elif defined USE_PDFKIT
text.append("PDF support: PDFKit\n");
#elif defined USE_PDFIUM
text.append("PDF support: PDFium\n");
#else
text.append("PDF support: Poppler\n");
#endif
return text;
}

View File

@ -0,0 +1,12 @@
#ifndef GLOBAL_INFO_PROVIDER_H
#define GLOBAL_INFO_PROVIDER_H
#include <QString>
namespace YACReader {
QString getGlobalInfo();
}
#endif // GLOBAL_INFO_PROVIDER_H