mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Remove the non-canonical Subusrface version
It no longer makes sense to lie about the version. If you are running a product build, then the canonical version is the same version as the plain version used to be. And in either case it makes much more sense to simply log the full version information. We used to have the differently styled versions for different OSs, but I don't think this is needed anymore. Let's hope this doesn't go down as one of these "famous last words" moments... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c819d40c19
commit
2882a1ef41
9 changed files with 14 additions and 25 deletions
|
@ -1,7 +1,6 @@
|
||||||
# Generate the ssrf-config.h every 'make'
|
# Generate the ssrf-config.h every 'make'
|
||||||
file(WRITE ${CMAKE_BINARY_DIR}/version.h.in
|
file(WRITE ${CMAKE_BINARY_DIR}/version.h.in
|
||||||
"#define VERSION_STRING \"@VERSION_STRING@\"
|
"#define GIT_VERSION_STRING \"@GIT_VERSION_STRING@\"
|
||||||
#define GIT_VERSION_STRING \"@GIT_VERSION_STRING@\"
|
|
||||||
#define CANONICAL_VERSION_STRING \"@CANONICAL_VERSION_STRING@\"
|
#define CANONICAL_VERSION_STRING \"@CANONICAL_VERSION_STRING@\"
|
||||||
")
|
")
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,3 @@
|
||||||
if(${APPLE})
|
|
||||||
set(VER_OS darwin)
|
|
||||||
elseif(${WIN32})
|
|
||||||
set(VER_OS win)
|
|
||||||
else()
|
|
||||||
set(VER_OS linux)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
||||||
set(VER_OS win)
|
|
||||||
endif()
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND sh ${CMAKE_TOP_SRC_DIR}/scripts/get-version linux
|
COMMAND sh ${CMAKE_TOP_SRC_DIR}/scripts/get-version linux
|
||||||
WORKING_DIRECTORY ${CMAKE_TOP_SRC_DIR}
|
WORKING_DIRECTORY ${CMAKE_TOP_SRC_DIR}
|
||||||
|
|
|
@ -1286,7 +1286,6 @@ void MainWindow::checkSurvey(QSettings *s)
|
||||||
s->setValue("FirstUse42", value);
|
s->setValue("FirstUse42", value);
|
||||||
}
|
}
|
||||||
// wait a week for production versions, but not at all for non-tagged builds
|
// wait a week for production versions, but not at all for non-tagged builds
|
||||||
QString ver(subsurface_version());
|
|
||||||
int waitTime = 7;
|
int waitTime = 7;
|
||||||
QDate firstUse42 = s->value("FirstUse42").toDate();
|
QDate firstUse42 = s->value("FirstUse42").toDate();
|
||||||
if (run_survey || (firstUse42.daysTo(QDate().currentDate()) > waitTime && !s->contains("SurveyDone"))) {
|
if (run_survey || (firstUse42.daysTo(QDate().currentDate()) > waitTime && !s->contains("SurveyDone"))) {
|
||||||
|
|
|
@ -22,7 +22,7 @@ UserSurvey::UserSurvey(QWidget *parent) : QDialog(parent),
|
||||||
QShortcut *quitKey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
|
QShortcut *quitKey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
|
||||||
connect(quitKey, SIGNAL(activated()), parent, SLOT(close()));
|
connect(quitKey, SIGNAL(activated()), parent, SLOT(close()));
|
||||||
|
|
||||||
os = QString("ssrfVers=%1").arg(subsurface_version());
|
os = QString("ssrfVers=%1").arg(subsurface_canonical_version());
|
||||||
os.append(QString("&prettyOsName=%1").arg(SubsurfaceSysInfo::prettyOsName()));
|
os.append(QString("&prettyOsName=%1").arg(SubsurfaceSysInfo::prettyOsName()));
|
||||||
QString arch = SubsurfaceSysInfo::buildCpuArchitecture();
|
QString arch = SubsurfaceSysInfo::buildCpuArchitecture();
|
||||||
os.append(QString("&appCpuArch=%1").arg(arch));
|
os.append(QString("&appCpuArch=%1").arg(arch));
|
||||||
|
@ -39,7 +39,7 @@ QString UserSurvey::getVersion()
|
||||||
{
|
{
|
||||||
QString arch;
|
QString arch;
|
||||||
// fill in the system data
|
// fill in the system data
|
||||||
QString sysInfo = QString("Subsurface %1").arg(subsurface_version());
|
QString sysInfo = QString("Subsurface %1").arg(subsurface_canonical_version());
|
||||||
sysInfo.append(tr("\nOperating system: %1").arg(SubsurfaceSysInfo::prettyOsName()));
|
sysInfo.append(tr("\nOperating system: %1").arg(SubsurfaceSysInfo::prettyOsName()));
|
||||||
arch = SubsurfaceSysInfo::buildCpuArchitecture();
|
arch = SubsurfaceSysInfo::buildCpuArchitecture();
|
||||||
sysInfo.append(tr("\nCPU architecture: %1").arg(arch));
|
sysInfo.append(tr("\nCPU architecture: %1").arg(arch));
|
||||||
|
|
|
@ -791,9 +791,9 @@ QString getUserAgent()
|
||||||
// fill in the system data - use ':' as separator
|
// fill in the system data - use ':' as separator
|
||||||
// replace all other ':' with ' ' so that this is easy to parse
|
// replace all other ':' with ' ' so that this is easy to parse
|
||||||
#ifdef SUBSURFACE_MOBILE
|
#ifdef SUBSURFACE_MOBILE
|
||||||
QString userAgent = QString("Subsurface-mobile:%1:").arg(subsurface_version());
|
QString userAgent = QString("Subsurface-mobile:%1:").arg(subsurface_canonical_version());
|
||||||
#else
|
#else
|
||||||
QString userAgent = QString("Subsurface:%1:").arg(subsurface_version());
|
QString userAgent = QString("Subsurface:%1:").arg(subsurface_canonical_version());
|
||||||
#endif
|
#endif
|
||||||
userAgent.append(SubsurfaceSysInfo::prettyOsName().replace(':', ' ') + ":");
|
userAgent.append(SubsurfaceSysInfo::prettyOsName().replace(':', ' ') + ":");
|
||||||
arch = SubsurfaceSysInfo::buildCpuArchitecture().replace(':', ' ');
|
arch = SubsurfaceSysInfo::buildCpuArchitecture().replace(':', ' ');
|
||||||
|
@ -805,6 +805,13 @@ QString getUserAgent()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" const char *subsurface_user_agent()
|
||||||
|
{
|
||||||
|
static QString uA = getUserAgent();
|
||||||
|
|
||||||
|
return strdup(qPrintable(uA));
|
||||||
|
}
|
||||||
|
|
||||||
QString uiLanguage(QLocale *callerLoc)
|
QString uiLanguage(QLocale *callerLoc)
|
||||||
{
|
{
|
||||||
QString shortDateFormat;
|
QString shortDateFormat;
|
||||||
|
|
|
@ -17,5 +17,6 @@ void cache_picture(struct picture *picture);
|
||||||
char *cloud_url();
|
char *cloud_url();
|
||||||
char *hashfile_name_string();
|
char *hashfile_name_string();
|
||||||
char *picturedir_string();
|
char *picturedir_string();
|
||||||
|
const char *subsurface_user_agent();
|
||||||
|
|
||||||
#endif // QTHELPERFROMC_H
|
#endif // QTHELPERFROMC_H
|
||||||
|
|
|
@ -1047,7 +1047,7 @@ static void create_commit_message(struct membuffer *msg)
|
||||||
} while ((dc = dc->next) != NULL);
|
} while ((dc = dc->next) != NULL);
|
||||||
put_format(msg, "\n");
|
put_format(msg, "\n");
|
||||||
}
|
}
|
||||||
put_format(msg, "Created by subsurface %s\n", subsurface_version());
|
put_format(msg, "Created by subsurface %s\n", subsurface_user_agent());
|
||||||
}
|
}
|
||||||
|
|
||||||
static int create_new_commit(git_repository *repo, const char *remote, const char *branch, git_oid *tree_id)
|
static int create_new_commit(git_repository *repo, const char *remote, const char *branch, git_oid *tree_id)
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
#include "ssrf-version.h"
|
#include "ssrf-version.h"
|
||||||
|
|
||||||
const char *subsurface_version(void)
|
|
||||||
{
|
|
||||||
return VERSION_STRING;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *subsurface_git_version(void)
|
const char *subsurface_git_version(void)
|
||||||
{
|
{
|
||||||
return GIT_VERSION_STRING;
|
return GIT_VERSION_STRING;
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *subsurface_version(void);
|
|
||||||
const char *subsurface_git_version(void);
|
const char *subsurface_git_version(void);
|
||||||
const char *subsurface_canonical_version(void);
|
const char *subsurface_canonical_version(void);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue