Skip to content

Commit

Permalink
AboutWindow: better macOS version info
Browse files Browse the repository at this point in the history
  • Loading branch information
devernay committed Oct 24, 2021
1 parent 2a8e5aa commit 30f2da6
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions Gui/AboutWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,33 +322,40 @@ AboutWindow::AboutWindow(QWidget* parent)
//#define MAC_OS_X_VERSION_10_11_2 101102
//#define MAC_OS_X_VERSION_10_11_3 101103
//#define MAC_OS_X_VERSION_10_11_4 101104
osVer += QString::fromUtf8(" %1.%2.%3-%4.%5.%6")
//#define MAC_OS_X_VERSION_10_12 101200
//#define MAC_OS_X_VERSION_10_12_1 101201
//#define MAC_OS_X_VERSION_10_12_2 101202
//#define MAC_OS_X_VERSION_10_12_4 101204
//#define MAC_OS_X_VERSION_10_13 101300
//#define MAC_OS_X_VERSION_10_13_1 101301
//#define MAC_OS_X_VERSION_10_13_2 101302
//#define MAC_OS_X_VERSION_10_13_4 101304
//#define MAC_OS_X_VERSION_10_14 101400
//#define MAC_OS_X_VERSION_10_14_1 101401
//#define MAC_OS_X_VERSION_10_14_4 101404
//#define MAC_OS_X_VERSION_10_15 101500
//#define MAC_OS_VERSION_11_0 110000
//#define MAC_OS_VERSION_11_1 110100
//#define MAC_OS_VERSION_11_3 110300
const bool version_available = true;
#if MAC_OS_X_VERSION_MIN_REQUIRED < 100000
.arg(MAC_OS_X_VERSION_MIN_REQUIRED / 100)
.arg( (MAC_OS_X_VERSION_MIN_REQUIRED % 100) / 10)
.arg(MAC_OS_X_VERSION_MIN_REQUIRED % 10)
const unsigned major = MAC_OS_X_VERSION_MIN_REQUIRED / 100;
const unsigned minor = (MAC_OS_X_VERSION_MIN_REQUIRED % 100) / 10;
const unsigned patch = MAC_OS_X_VERSION_MIN_REQUIRED % 10;
#else
.arg(MAC_OS_X_VERSION_MIN_REQUIRED / 10000)
.arg((MAC_OS_X_VERSION_MIN_REQUIRED % 10000) / 100)
.arg(MAC_OS_X_VERSION_MIN_REQUIRED % 100)
const unsigned major = MAC_OS_X_VERSION_MIN_REQUIRED / 10000;
const unsigned minor = (MAC_OS_X_VERSION_MIN_REQUIRED % 10000) / 100;
const unsigned patch = MAC_OS_X_VERSION_MIN_REQUIRED % 100;
#endif
#if MAC_OS_X_VERSION_MAX_ALLOWED < 100000
.arg(MAC_OS_X_VERSION_MAX_ALLOWED / 100)
.arg( (MAC_OS_X_VERSION_MAX_ALLOWED % 100) / 10)
.arg(MAC_OS_X_VERSION_MAX_ALLOWED % 10)
#else
.arg(MAC_OS_X_VERSION_MAX_ALLOWED / 10000)
.arg((MAC_OS_X_VERSION_MAX_ALLOWED % 10000) / 100)
.arg(MAC_OS_X_VERSION_MAX_ALLOWED % 100)
#endif
;
#else
//#define BOOST_VERSION_NUMBER(major,minor,patch) ( (((major)%100)*10000000) + (((minor)%100)*100000) + ((patch)%100000) )
const bool version_available = BOOST_OS != BOOST_VERSION_NUMBER_NOT_AVAILABLE;
const unsigned major = BOOST_OS/10000000;
const unsigned minor = (BOOST_OS-10000000*major)/100000;
const unsigned patch = BOOST_OS % 100000;
#endif
// coverity[unsigned_compare]
if (BOOST_OS != BOOST_VERSION_NUMBER_NOT_AVAILABLE && major > 0) {
if (version_available && major > 0) {
osVer += QString::fromUtf8(" %1").arg(major);
// coverity[unsigned_compare]
if (minor > 0 || patch > 0) {
Expand All @@ -358,7 +365,6 @@ AboutWindow::AboutWindow(QWidget* parent)
}
}
}
#endif
QString gitStr = QString::fromUtf8("<p>%1</p>").arg(tr("This software was compiled from the source "
"code branch %1 at version %2 using %3 targeting %4 for %5.")
.arg( QString::fromUtf8("<a href=\"https://github.com/NatronGitHub/Natron/tree/" GIT_BRANCH "\">" GIT_BRANCH "</a>") ) // %1
Expand Down

0 comments on commit 30f2da6

Please sign in to comment.