Fixed non-saving crashdump setting and some improvements for setup

Registration for "Settings::CCrashSettings::registerMetadata()" was missing
This commit is contained in:
Klaus Basan
2018-12-02 18:26:49 +01:00
parent 7fc6fcb867
commit 6ef10b92ab
5 changed files with 10 additions and 7 deletions

View File

@@ -260,7 +260,7 @@ namespace BlackCore
bool CGlobalSetup::isSwiftVersionMinimumMappingVersion() const
{
if (!this->wasLoadedFromWeb()) { return false; }
if (!this->wasLoadedFromWeb()) { return false; } // only allowed from web
if (m_mappingMinimumVersion.isEmpty()) { return false; }
const QVersionNumber min = QVersionNumber::fromString(this->getMappingMinimumVersionString());
return CBuildConfig::getVersion() >= min;

View File

@@ -224,7 +224,7 @@ namespace BlackCore
// same web load within 5000ms
const CGlobalSetup setup = m_setup.get();
if (m_setup.lastUpdatedAge() < 5000 && setup.wasLoadedFromWeb())
if (m_setup.lastUpdatedAge() < 5000 && setup.wasLoadedFromWeb()) // really loaded from web
{
const CStatusMessage m(this, CStatusMessage::SeverityInfo, "Update info just updated, skip read");
CStatusMessageList msgs(m);
@@ -679,7 +679,7 @@ namespace BlackCore
}
else
{
const bool cacheAvailable = m_setup.get().wasLoadedFromWeb();
const bool cacheAvailable = m_setup.get().wasLoaded(); // loaded from web or file
available = cacheAvailable && m_bootstrapMode != Explicit;
}

View File

@@ -162,8 +162,8 @@ namespace BlackCore
CacheOnly
};
std::atomic<bool> m_shutdown { false };
std::atomic<bool> m_setupAvailable { false }; //!< setup available
std::atomic<bool> m_shutdown { false }; //!< shutdown in progress
std::atomic<bool> m_setupAvailable { false }; //!< setup available?
std::atomic<bool> m_updateInfoAvailable { false }; //!< update info available
std::atomic<bool> m_ignoreCmdBootstrapUrl { false }; //!< ignore the explicitly set bootstrap URL
std::atomic<bool> m_checkCmdBootstrapUrl { true }; //!< check connection on CMD bootstrap URL

View File

@@ -14,6 +14,7 @@
#include "blackcore/data/globalsetup.h"
#include "blackmisc/network/url.h"
#include "blackmisc/crashsettings.h"
#include "blackmisc/logmessage.h"
#include "blackmisc/statusmessage.h"
#include "blackconfig/buildconfig.h"
@@ -37,9 +38,9 @@ namespace BlackGui
this->setChecklistInfo();
const CCrashSettings settings = m_crashDumpSettings.get();
ui->cb_CrashDumps->setChecked(settings.isEnabled());
ui->cb_Agree->setChecked(CBuildConfig::isLocalDeveloperDebugBuild());
connect(ui->cb_CrashDumps, &QCheckBox::toggled, this, &CLegalInfoComponent::onAllowCrashDumps);
QPointer<CLegalInfoComponent> myself(this);
@@ -70,7 +71,7 @@ namespace BlackGui
{
CCrashSettings settings = m_crashDumpSettings.get();
settings.setEnabled(checked);
m_crashDumpSettings.setAndSave(settings);
CLogMessage::preformatted(m_crashDumpSettings.setAndSave(settings));
}
void CLegalInfoComponent::showCrashDumpHint()

View File

@@ -20,6 +20,7 @@
#include "blackmisc/applicationinfolist.h"
#include "blackmisc/countrylist.h"
#include "blackmisc/crashsettings.h"
#include "blackmisc/dbus.h"
#include "blackmisc/directories.h"
#include "blackmisc/iconlist.h"
@@ -96,6 +97,7 @@ namespace BlackMisc
Network::registerMetadata();
PhysicalQuantities::registerMetadata();
Simulation::registerMetadata();
Settings::CCrashSettings::registerMetadata();
Weather::registerMetadata();
// needed by XSwiftBus proxy class