-
Notifications
You must be signed in to change notification settings - Fork 238
Where available, use the commit time rather than commit id, for sort #3562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ contains(CONFIG, "noupcasename") { | |
| # allow detailed version info for intermediate builds (#475) | ||
| contains(VERSION, .*dev.*) { | ||
| exists(".git/config") { | ||
| GIT_DESCRIPTION=$$system(git describe --match=xxxxxxxxxxxxxxxxxxxx --always --abbrev --dirty) # the match should never match | ||
| GIT_DESCRIPTION=$$system(git describe --match=xxxxxxxxxxxxxxxxxxxx --always --abbrev --dirty):$$system(git show -s "--pretty=format:%ct") # commit_id(-dirty):seconds_since_epoch | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Append seconds since epoch of HEAD commit id (so |
||
| VERSION = "$$VERSION"-$$GIT_DESCRIPTION | ||
| message("building version \"$$VERSION\" (intermediate in git repository)") | ||
| } else { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,7 @@ static QString mapVersionStr ( const QString& versionStr ) | |
| QString x = ">"; // default suffix is later (git, dev, nightly, etc) | ||
|
|
||
| // Regex for SemVer: major.minor.patch-suffix | ||
| QRegularExpression semVerRegex ( R"(^(\d+)\.(\d+)\.(\d+)-?(.*)$)" ); | ||
| QRegularExpression semVerRegex ( R"(^(\d+)\.(\d+)\.(\d+)-?(.*):?(.*)$)" ); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Capture seconds since epoch if present. |
||
| QRegularExpressionMatch match = semVerRegex.match ( versionStr ); | ||
|
|
||
| if ( !match.hasMatch() ) | ||
|
|
@@ -45,6 +45,7 @@ static QString mapVersionStr ( const QString& versionStr ) | |
| int minor = match.captured ( 2 ).toInt(); | ||
| int patch = match.captured ( 3 ).toInt(); | ||
| QString suffix = match.captured ( 4 ); // may be empty | ||
| QString tstamp = match.captured ( 5 ); // may be empty | ||
|
|
||
| if ( suffix.isEmpty() ) | ||
| { | ||
|
|
@@ -66,7 +67,7 @@ static QString mapVersionStr ( const QString& versionStr ) | |
| .arg ( minor, 3, 10, QLatin1Char ( '0' ) ) | ||
| .arg ( patch, 3, 10, QLatin1Char ( '0' ) ) | ||
| .arg ( x ) | ||
| .arg ( suffix ); | ||
| .arg ( tstamp.isEmpty() ? suffix : tstamp ); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use seconds since epoch, rather than commit id, if present. |
||
|
|
||
| return key; | ||
| } | ||
|
|
@@ -184,13 +185,13 @@ CConnectDlg::CConnectDlg ( CClientSettings* pNSetP, const bool bNewShowCompleteR | |
| lvwServers->setColumnWidth ( LVC_NAME, 200 ); | ||
| lvwServers->setColumnWidth ( LVC_PING, 130 ); | ||
| lvwServers->setColumnWidth ( LVC_CLIENTS, 100 ); | ||
| lvwServers->setColumnWidth ( LVC_VERSION, 110 ); | ||
| lvwServers->setColumnWidth ( LVC_VERSION, 150 ); | ||
| #else | ||
| lvwServers->setColumnWidth ( LVC_NAME, 180 ); | ||
| lvwServers->setColumnWidth ( LVC_PING, 75 ); | ||
| lvwServers->setColumnWidth ( LVC_CLIENTS, 70 ); | ||
| lvwServers->setColumnWidth ( LVC_LOCATION, 220 ); | ||
| lvwServers->setColumnWidth ( LVC_VERSION, 95 ); | ||
| lvwServers->setColumnWidth ( LVC_VERSION, 135 ); | ||
| #endif | ||
| lvwServers->clear(); | ||
|
|
||
|
|
@@ -1024,7 +1025,7 @@ void CConnectDlg::SetServerVersionResult ( const CHostAddress& InetAddr, const Q | |
|
|
||
| if ( pCurListViewItem ) | ||
| { | ||
| pCurListViewItem->setText ( LVC_VERSION, strVersion ); | ||
| pCurListViewItem->setText ( LVC_VERSION, GetDisplayVersion ( strVersion ) ); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As this method gets passed the protocol version ( (Also note this only gets called once each time the server is seen, not on every refresh.) |
||
|
|
||
| // and store sortable mapped version number | ||
| pCurListViewItem->setData ( LVC_VERSION, Qt::UserRole, mapVersionStr ( strVersion ) ); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,7 +73,7 @@ LED bar: lbr | |
|
|
||
| // version and application name (use version from qt prject file) | ||
| #undef VERSION | ||
| #define VERSION APP_VERSION | ||
| #define VERSION GetDisplayVersion ( APP_VERSION ) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| #define APP_NAME "Jamulus" | ||
|
|
||
| // Windows registry key name of auto run entry for the server | ||
|
|
@@ -374,3 +374,5 @@ bool GetNumericArgument ( int argc, | |
| double rRangeStart, | ||
| double rRangeStop, | ||
| double& rValue ); | ||
|
|
||
| inline QString GetDisplayVersion ( QString str ) { return str.contains ( ':' ) ? str.mid ( 0, str.lastIndexOf ( ':' ) ) : str; } | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
Uh oh!
There was an error while loading. Please reload this page.