Add qmake DEFINES and CONFIG in About Info to know how RS was compiled.

This commit is contained in:
Phenom 2021-02-12 12:06:37 +01:00
parent 8e0e4eb138
commit c0478d4a97
3 changed files with 73 additions and 52 deletions

View File

@ -21,6 +21,7 @@
#include "AboutDialog.h"
#include "HelpDialog.h"
#include "qmake_info.h"
#include "rshare.h"
#ifdef RS_JSONAPI
@ -302,17 +303,13 @@ void AWidget::drawBitField()
p.end() ;
}
AWidget::AWidget() {
AWidget::AWidget()
: page(0), density(5)
, mImagesReady(false), mState(0), mTimerId(0)
, mStep(1.0f), mMaxStep(QFontMetricsF(font()).width(' '))
{
setMouseTracking(true);
density = 5;
page = 0;
mMaxStep = QFontMetricsF(font()).width(' ') ;
mStep = 1.0f ;
mState = 0 ;
mImagesReady = false ;
// startTimer(15);
//startTimer(15);
}
void AWidget::computeNextState()
@ -946,21 +943,20 @@ void AboutWidget::on_copy_button_clicked()
#endif
verInfo+="\n";
#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)
#if QT_VERSION >= QT_VERSION_CHECK (5, 4, 0)
#if QT_VERSION >= QT_VERSION_CHECK (5, 4, 0)
verInfo+=QSysInfo::prettyProductName();
#endif
#endif
#else
#ifdef Q_OS_LINUX
#ifdef Q_OS_LINUX
verInfo+="Linux";
#endif
#ifdef Q_OS_WIN
#endif
#ifdef Q_OS_WIN
verInfo+="Windows";
#endif
#ifdef Q_OS_MAC
#endif
#ifdef Q_OS_MAC
verInfo+="Mac";
#endif
#endif
#endif
verInfo+=" ";
QString qtver = QString("QT ")+QT_VERSION_STR;
@ -973,12 +969,12 @@ void AboutWidget::on_copy_button_clicked()
verInfo+=addLibraries("libretroshare", libraries);
#ifdef RS_JSONAPI
// Disabled because I could not find how to get restbed version number
// /* Add version numbers of RetroShare */
// // Add versions here. Find a better place.
// libraries.clear();
// libraries.push_back(RsLibraryInfo("RestBed", restbed::get_version()));
// verInfo+=addLibraries("RetroShare", libraries);
// Disabled because I could not find how to get restbed version number
// /* Add version numbers of RetroShare */
// // Add versions here. Find a better place.
// libraries.clear();
// libraries.push_back(RsLibraryInfo("RestBed", restbed::get_version()));
// verInfo+=addLibraries("RetroShare", libraries);
#endif
/* Add version numbers of plugins */
@ -993,6 +989,8 @@ void AboutWidget::on_copy_button_clicked()
}
}
verInfo+= "DEFINES:" + Rs_qmake_DEFINES + "\n";
verInfo+= "CONFIG:" + Rs_qmake_CONFIG + "\n";
QApplication::clipboard()->setText(verInfo);
}

View File

@ -0,0 +1,8 @@
#ifndef INFO_H
#define INFO_H
#include <QString>
static const QString Rs_qmake_DEFINES = QStringLiteral(\"$$RS_QMAKE_DEFINES\");
static const QString Rs_qmake_CONFIG = QStringLiteral(\"$$RS_QMAKE_CONFIG\");
#endif // INFO_H

View File

@ -1514,3 +1514,18 @@ wikipoos {
gui/gxs/RsGxsUpdateBroadcastWidget.cpp \
gui/gxs/RsGxsUpdateBroadcastPage.cpp \
}
################################################################
#Define qmake_info.h file so GUI can get wath was used to compil
# This must be at end to get all informations
################################################################
RS_QMAKE_DEFINES=\\\"$${DEFINES}\\\"
RS_QMAKE_CONFIG=\\\"$${CONFIG}\\\"
INCLUDEPATH += $$OUT_PWD/include
info_file.input = $$PWD/qmake_info.h.in
info_file.output = $$OUT_PWD/include/qmake_info.h
QMAKE_SUBSTITUTES += info_file
OTHER_FILES += \
qmake_info.h.in