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:
Dirk Hohndel 2015-12-20 07:59:50 -08:00
parent c819d40c19
commit 2882a1ef41
9 changed files with 14 additions and 25 deletions

View file

@ -1,7 +1,6 @@
# Generate the ssrf-config.h every 'make'
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@\"
")

View file

@ -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(
COMMAND sh ${CMAKE_TOP_SRC_DIR}/scripts/get-version linux
WORKING_DIRECTORY ${CMAKE_TOP_SRC_DIR}

View file

@ -1286,7 +1286,6 @@ void MainWindow::checkSurvey(QSettings *s)
s->setValue("FirstUse42", value);
}
// wait a week for production versions, but not at all for non-tagged builds
QString ver(subsurface_version());
int waitTime = 7;
QDate firstUse42 = s->value("FirstUse42").toDate();
if (run_survey || (firstUse42.daysTo(QDate().currentDate()) > waitTime && !s->contains("SurveyDone"))) {

View file

@ -22,7 +22,7 @@ UserSurvey::UserSurvey(QWidget *parent) : QDialog(parent),
QShortcut *quitKey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
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()));
QString arch = SubsurfaceSysInfo::buildCpuArchitecture();
os.append(QString("&appCpuArch=%1").arg(arch));
@ -39,7 +39,7 @@ QString UserSurvey::getVersion()
{
QString arch;
// 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()));
arch = SubsurfaceSysInfo::buildCpuArchitecture();
sysInfo.append(tr("\nCPU architecture: %1").arg(arch));

View file

@ -791,9 +791,9 @@ QString getUserAgent()
// fill in the system data - use ':' as separator
// replace all other ':' with ' ' so that this is easy to parse
#ifdef SUBSURFACE_MOBILE
QString userAgent = QString("Subsurface-mobile:%1:").arg(subsurface_version());
QString userAgent = QString("Subsurface-mobile:%1:").arg(subsurface_canonical_version());
#else
QString userAgent = QString("Subsurface:%1:").arg(subsurface_version());
QString userAgent = QString("Subsurface:%1:").arg(subsurface_canonical_version());
#endif
userAgent.append(SubsurfaceSysInfo::prettyOsName().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 shortDateFormat;

View file

@ -17,5 +17,6 @@ void cache_picture(struct picture *picture);
char *cloud_url();
char *hashfile_name_string();
char *picturedir_string();
const char *subsurface_user_agent();
#endif // QTHELPERFROMC_H

View file

@ -1047,7 +1047,7 @@ static void create_commit_message(struct membuffer *msg)
} while ((dc = dc->next) != NULL);
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)

View file

@ -1,10 +1,5 @@
#include "ssrf-version.h"
const char *subsurface_version(void)
{
return VERSION_STRING;
}
const char *subsurface_git_version(void)
{
return GIT_VERSION_STRING;

View file

@ -5,7 +5,6 @@
extern "C" {
#endif
const char *subsurface_version(void);
const char *subsurface_git_version(void);
const char *subsurface_canonical_version(void);