all repos — mgba @ 1089285b45c1213fff87e0518fc45a327b8ede8b

mGBA Game Boy Advance Emulator

Qt: Add linked library info to report generator
Vicki Pfau vi@endrift.com
Wed, 03 Feb 2021 21:10:25 -0800
commit

1089285b45c1213fff87e0518fc45a327b8ede8b

parent

2498f85cda6a8d3e2b4904a920b84d2cc9ffb02a

1 files changed, 107 insertions(+), 0 deletions(-)

jump to
M src/platform/qt/ReportView.cppsrc/platform/qt/ReportView.cpp

@@ -12,7 +12,9 @@ #include <QScreen>

#include <QSysInfo> #include <QWindow> +#include <mgba/core/serialize.h> #include <mgba/core/version.h> +#include <mgba-util/png-io.h> #include <mgba-util/vfs.h> #include "CoreController.h"

@@ -37,8 +39,43 @@

#include <QOpenGLFunctions> #endif +#ifdef USE_EDITLINE +#include <histedit.h> +#endif + +#ifdef USE_FFMPEG +#include <libavcodec/version.h> +#include <libavfilter/version.h> +#include <libavformat/version.h> +#include <libavutil/version.h> +#include <libswscale/version.h> +#ifdef USE_LIBAVRESAMPLE +#include <libavresample/version.h> +#endif +#ifdef USE_LIBSWRESAMPLE +#include <libswresample/version.h> +#endif +#endif + +#ifdef USE_LIBZIP +#include <zip.h> +#endif + +#ifdef USE_LZMA +#include <7zVersion.h> +#endif + +#ifdef BUILD_SDL +#include <SDL_version.h> +#endif + #ifdef USE_SQLITE3 #include "feature/sqlite3/no-intro.h" +#include <sqlite3.h> +#endif + +#ifdef USE_ZLIB +#include <zlib.h> #endif using namespace QGBA;

@@ -84,6 +121,72 @@ swReport << QString("OS: %1").arg(QSysInfo::prettyProductName());

swReport << QString("Build architecture: %1").arg(QSysInfo::buildCpuArchitecture()); swReport << QString("Run architecture: %1").arg(QSysInfo::currentCpuArchitecture()); swReport << QString("Qt version: %1").arg(QLatin1String(qVersion())); +#ifdef USE_FFMPEG + QStringList libavVers; + libavVers << QLatin1String(LIBAVCODEC_IDENT); + libavVers << QLatin1String(LIBAVFILTER_IDENT); + libavVers << QLatin1String(LIBAVFORMAT_IDENT); +#ifdef USE_LIBAVRESAMPLE + libavVers << QLatin1String(LIBAVRESAMPLE_IDENT); +#endif + libavVers << QLatin1String(LIBAVUTIL_IDENT); +#ifdef USE_LIBSWRESAMPLE + libavVers << QLatin1String(LIBSWRESAMPLE_IDENT); +#endif + libavVers << QLatin1String(LIBSWSCALE_IDENT); +#ifdef USE_LIBAV + swReport << QString("Libav versions: %1.%2").arg(libavVers.join(", ")); +#else + swReport << QString("FFmpeg versions: %1.%2").arg(libavVers.join(", ")); +#endif +#else + swReport << QString("FFmpeg not linked"); +#endif +#ifdef USE_EDITLINE + swReport << QString("libedit version: %1.%2").arg(LIBEDIT_MAJOR).arg(LIBEDIT_MINOR); +#else + swReport << QString("libedit not linked"); +#endif +#ifdef USE_ELF + swReport << QString("libelf linked"); +#else + swReport << QString("libelf not linked"); +#endif +#ifdef USE_PNG + swReport << QString("libpng version: %1").arg(QLatin1String(PNG_LIBPNG_VER_STRING)); +#else + swReport << QString("libpng not linked"); +#endif +#ifdef USE_LIBZIP + swReport << QString("libzip version: %1").arg(QLatin1String(LIBZIP_VERSION)); +#else + swReport << QString("libzip not linked"); +#endif +#ifdef USE_LZMA + swReport << QString("libLZMA version: %1").arg(QLatin1String(MY_VERSION_NUMBERS)); +#else + swReport << QString("libLZMA not linked"); +#endif +#ifdef USE_MINIZIP + swReport << QString("minizip linked"); +#else + swReport << QString("minizip not linked"); +#endif +#ifdef BUILD_SDL + swReport << QString("SDL version: %1.%2.%3").arg(SDL_MAJOR_VERSION).arg(SDL_MINOR_VERSION).arg(SDL_PATCHLEVEL); +#else + swReport << QString("SDL not linked"); +#endif +#ifdef USE_SQLITE3 + swReport << QString("SQLite3 version: %1").arg(QLatin1String(SQLITE_VERSION)); +#else + swReport << QString("SQLite3 not linked"); +#endif +#ifdef USE_ZLIB + swReport << QString("zlib version: %1").arg(QLatin1String(ZLIB_VERSION)); +#else + swReport << QString("zlib not linked"); +#endif addReport(QString("System info"), swReport.join('\n')); QStringList hwReport;

@@ -209,6 +312,7 @@ rebuildModel();

} void ReportView::save() { +#if defined(USE_LIBZIP) || defined(USE_MINIZIP) QString filename = GBAApp::app()->getSaveFileName(this, tr("Bug report archive"), tr("ZIP archive (*.zip)")); if (filename.isNull()) { return;

@@ -228,6 +332,7 @@ }

vf.close(); } zip->close(zip); +#endif } void ReportView::setShownReport(const QString& filename) {

@@ -243,7 +348,9 @@ item->setFlags(item->flags() & ~Qt::ItemIsEnabled);

} m_ui.fileList->addItem(item); } +#if defined(USE_LIBZIP) || defined(USE_MINIZIP) m_ui.save->setEnabled(true); +#endif m_ui.fileList->setEnabled(true); m_ui.fileView->setEnabled(true); m_ui.openList->setEnabled(true);