From db2ebb63fa5d4d3f1120308683db7fabb2097be4 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Sat, 7 Apr 2018 09:29:22 +0100 Subject: [PATCH] Disable OpenData if Secret not defined .. developer builds will try and post and continue to try to post despite the fact it will never work. --- src/Core/Secrets.h | 1 + src/Gui/MainWindow.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Core/Secrets.h b/src/Core/Secrets.h index cce99a61d..a9f9cfde7 100644 --- a/src/Core/Secrets.h +++ b/src/Core/Secrets.h @@ -55,6 +55,7 @@ #endif #ifndef GC_CLOUD_OPENDATA_SECRET +#define OPENDATA_DISABLE #define GC_CLOUD_OPENDATA_SECRET "__GC_OPENDATA_SECRET__" #endif diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 71507b75d..0c81cc6bd 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -110,6 +110,7 @@ #include "CloudDBVersion.h" #include "GcUpgrade.h" #endif +#include "Secrets.h" #if defined(_MSC_VER) && defined(_WIN64) #include "WindowsCrashHandler.cpp" @@ -611,11 +612,13 @@ MainWindow::MainWindow(const QDir &home) * Lets ask for telemetry and check for updates *--------------------------------------------------------------------*/ -#if QT_VERSION > 0x050000 +#if QT_VERSION > 0x050000 && !defined(OPENDATA_DISABLE) OpenData::check(currentTab->context); +#else + fprintf(stderr, "OpenData disabled, secret not defined.\n"); fflush(stderr); #endif -#ifdef GC_HAS_CLOUD_DB +#ifdef GC_HAS_CLOUD_DB telemetryClient = new CloudDBTelemetryClient(); if (appsettings->value(NULL, GC_ALLOW_TELEMETRY, "undefined").toString() == "undefined" ) { // ask user if storing is allowed