Skip to content
Permalink
Browse files

implemented getCompilerVersion().(refs #62)

  • Loading branch information...
haraki committed Jun 27, 2019
1 parent 5ee13db commit eff172c29e3398015024de7d9c951469ce850994
Showing with 70 additions and 7 deletions.
  1. +7 −7 mainwindow.cpp
  2. +49 −0 win32.cpp
  3. +1 −0 win32.h
  4. +12 −0 xnix.cpp
  5. +1 −0 xnix.h
@@ -15,6 +15,12 @@
#include "imageviewer.h"
#include "file.h"

#ifdef Q_OS_WIN
# include "win32.h"
#else
# include "xnix.h"
#endif

namespace Farman
{

@@ -863,13 +869,7 @@ void MainWindow::about()
tr("About %1").arg(qApp->applicationName()),
QString("<p><font size = '+4'>%1<font size = '+1'> Version %2</font></font></p>").arg(qApp->applicationName()).arg(qApp->applicationVersion())
+ QString("<p style = 'font-weight:normal'>Based on Qt %1 ").arg(qVersion())
#if defined(_MSC_VER)
+ QString("(MSVC %1)</p>").arg(_MSC_VER)
#elif defined(__clang__)
+ QString("(Clang %1)</p>").arg(__clang_version__)
#elif defined(__GNUC__)
+ QString("(gcc %1.%2.%3)</p>").arg(__GNUC__).arg(__GNUC_MINOR__).arg(__GNUC_PATCHLEVEL__)
#endif
+ QString("(%1)").arg(getCompilerVersion())
+ QString("<p style = 'font-weight:normal'>Copyright 2019 %1 All right reserved.</p>").arg(qApp->organizationName())
);
}
@@ -59,6 +59,55 @@ qint64 getFileSizeOnDisk(const QString& filePath)
return sizeOnDisk;
}

QString getCompilerVersion()
{
#ifdef _MSC_VER
return QString("MSVC %1(%2), %3")
.arg(
# if _MSC_VER >= 1920
"2019"
# elif _MSC_VER >= 1910
"2017"
# elif _MSC_VER >= 1900
"2015"
# elif _MSC_VER >= 1800
"2013"
# elif _MSC_VER >= 1700
"2012"
# elif _MSC_VER >= 1600
"2010"
# elif _MSC_VER >= 1500
"2008"
# elif _MSC_VER >= 1400
"2005"
# elif _MSC_VER >= 1310
"2003"
# elif _MSC_VER >= 1300
"2002"
# elif _MSC_VER >= 1200
"6.0"
# else
"unknown"
# endif
)
.arg(_MSC_FULL_VER)
.arg(
# if defined(_WIN64)
"64bit"
# else
"32bit"
# endif
)
#elif defined(__MINGW64__)
return QString("MinGW %1, 64bit").arg(__MINGW64_VERSION_STR)
#elif defined(__MINGW32__)
return QString("MinGW %1.%2, 32bit").arg(__MINGW32_MAJOR_VERSION).arg(__MINGW32_MINOR_VERSION)
#else
return QString("unknown")
#endif
;
}

} // namespace Win32

} // namespace Farman
@@ -16,6 +16,7 @@ namespace Win32

extern bool isSystemFile(const QFileInfo& fileInfo);
extern qint64 getFileSizeOnDisk(const QString& filePath);
extern QString getCompilerVersion();

} // namespace Win32

@@ -27,6 +27,18 @@ qint64 getFileSizeOnDisk(const QString& filePath)
return statBuf.st_blocks * 512;
}

extern QString getCompilerVersion()
{
#if defined(__clang__)
return QString("Clang %1").arg(__clang_version__)
#elif defined(__GNUC__)
return QString("gcc %1.%2.%3").arg(__GNUC__).arg(__GNUC_MINOR__).arg(__GNUC_PATCHLEVEL__)
#else
return QString("unknown")
#endif
;
}

} // namespace Xnix

} // namespace Farman
1 xnix.h
@@ -14,6 +14,7 @@ namespace Xnix
{

extern qint64 getFileSizeOnDisk(const QString& filePath);
extern QString getCompilerVersion();

} // namespace Xnix

0 comments on commit eff172c

Please sign in to comment.
You can’t perform that action at this time.