mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Make xxxBuildInfo functions to create and return build information.
This commit is contained in:
parent
86d0c11ddd
commit
9561e56ad9
@ -122,7 +122,7 @@ QString getOpenGLVersionString()
|
||||
QOpenGLFunctions f;
|
||||
f.initializeOpenGLFunctions();
|
||||
glversion = QString(QLatin1String(reinterpret_cast<const char*>(f.glGetString(GL_VERSION))));
|
||||
qDebug() << "Graphics Engine:" << glversion;
|
||||
// qDebug() << "Graphics Engine:" << glversion;
|
||||
#endif
|
||||
}
|
||||
return glversion;
|
||||
@ -193,6 +193,27 @@ QString getBranchVersion()
|
||||
return version;
|
||||
}
|
||||
|
||||
QStringList buildInfo;
|
||||
|
||||
QStringList makeBuildInfo (QString relinfo, QString forcedEngine){
|
||||
buildInfo << (STR_AppName + " " + VersionString + (relinfo!="" ? " " : "") + relinfo);
|
||||
buildInfo << (QObject::tr("Built with Qt") + " " + QT_VERSION_STR + " on " + __DATE__ + " " + __TIME__);
|
||||
buildInfo << (QObject::tr("Branch") + " " + GIT_BRANCH + ", "
|
||||
+ QObject::tr("Revision") + " " + GIT_REVISION);
|
||||
buildInfo << (QObject::tr("Built on") + " " + QSysInfo::machineHostName() + " "
|
||||
+ QObject::tr("running") + " " + QSysInfo::prettyProductName());
|
||||
buildInfo << (QObject::tr("Graphics Engine:") + " " + getOpenGLVersionString());
|
||||
buildInfo << (QObject::tr("Graphics Engine type:") + " " + getGraphicsEngine());
|
||||
if (forcedEngine != "")
|
||||
buildInfo << forcedEngine;
|
||||
|
||||
return buildInfo;
|
||||
}
|
||||
|
||||
QStringList getBuildInfo() {
|
||||
return buildInfo;
|
||||
}
|
||||
|
||||
QString appResourcePath()
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
|
@ -45,6 +45,8 @@ float getOpenGLVersion();
|
||||
const QString & gitRevision();
|
||||
const QString & gitBranch();
|
||||
|
||||
QStringList makeBuildInfo(QString relinfo, QString forcedEngine);
|
||||
QStringList getBuildInfo();
|
||||
|
||||
QByteArray gCompress(const QByteArray& data);
|
||||
QByteArray gUncompress(const QByteArray &data);
|
||||
|
@ -22,7 +22,8 @@
|
||||
#include <QProgressDialog>
|
||||
|
||||
#include "version.h"
|
||||
#include "git_info.h"
|
||||
//#include "git_info.h"
|
||||
//#include "SleepLib/common.h"
|
||||
#include "logger.h"
|
||||
#include "mainwindow.h"
|
||||
#include "SleepLib/profiles.h"
|
||||
@ -348,12 +349,10 @@ int main(int argc, char *argv[]) {
|
||||
QString relinfo = "";
|
||||
#endif
|
||||
relinfo = "("+QSysInfo::kernelType()+" "+QSysInfo::currentCpuArchitecture()+relinfo+")";
|
||||
qDebug() << STR_AppName.toLocal8Bit().data() << VersionString.toLocal8Bit().data() << relinfo.toLocal8Bit().data() << "built with Qt" << QT_VERSION_STR << "on" << __DATE__ << __TIME__;
|
||||
qDebug() << "Branch" << GIT_BRANCH.toLocal8Bit().data() << "Revision" << GIT_REVISION.toLocal8Bit().data();
|
||||
qDebug() << "Built on" << QSysInfo::machineHostName().toLocal8Bit().data() << "running" << QSysInfo::prettyProductName().toLocal8Bit().data();
|
||||
qDebug() << "Graphics Engine:" << getGraphicsEngine().toLocal8Bit().data();
|
||||
if (forcedEngine != "")
|
||||
qDebug() << forcedEngine;
|
||||
|
||||
QStringList info = makeBuildInfo(relinfo, forcedEngine);
|
||||
for (int i = 0; i < info.size(); ++i)
|
||||
qDebug().noquote() << info.at(i);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Language Selection
|
||||
|
Loading…
Reference in New Issue
Block a user