mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
9d19ea1ebc
* also abstract version info into a standalone namespace
25 lines
623 B
C++
25 lines
623 B
C++
#include "version.hh"
|
|
#include <QFile>
|
|
|
|
namespace Version {
|
|
QString version()
|
|
{
|
|
QFile versionFile( ":/version.txt" );
|
|
|
|
if ( !versionFile.open( QFile::ReadOnly ) ) {
|
|
return QStringLiteral( "[Unknown Version]" );
|
|
}
|
|
else {
|
|
return versionFile.readAll().trimmed();
|
|
}
|
|
}
|
|
|
|
QString everything()
|
|
{
|
|
return QStringLiteral( "Goldendict-ng " ) + Version::version() + "\n" + "Qt " + QLatin1String( qVersion() ) + " "
|
|
+ Version::compiler + QSysInfo::productType() + " " + QSysInfo::kernelType() + " " + QSysInfo::kernelVersion() + " "
|
|
+ QSysInfo::buildAbi() + "\n" + "Flags:" + flags;
|
|
}
|
|
|
|
} // namespace Version
|