mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
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:
51
common/global_info_provider.cpp
Normal file
51
common/global_info_provider.cpp
Normal 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;
|
||||
}
|
12
common/global_info_provider.h
Normal file
12
common/global_info_provider.h
Normal 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
|
Reference in New Issue
Block a user