Files
yacreader/common/global_info_provider.cpp

56 lines
1.9 KiB
C++

#include "global_info_provider.h"
#include "yacreader_global.h"
#include <QImageReader>
#include <QPaintDevice>
#include <QtCore>
#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");
QString supportedImageFormats = QImageReader::supportedImageFormats().join(", ");
text.append(QString("Image formats supported: %1\n").arg(supportedImageFormats));
text.append(QString("User image plugin folder: %1\n").arg(YACReader::getImageFormatsPluginsPath()));
// 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;
}