Ref T125, allow to get distribution list by JSON string. Also setup value object directly using JSON string now.

This commit is contained in:
Klaus Basan
2017-08-15 02:10:27 +02:00
committed by Mathew Sutcliffe
parent 15f5a7f489
commit 8c032fb4d7
3 changed files with 11 additions and 5 deletions

View File

@@ -13,7 +13,6 @@
#include "blackmisc/compare.h"
#include "blackmisc/fileutils.h"
#include "blackmisc/directoryutils.h"
#include "blackmisc/json.h"
#include "blackmisc/logcategory.h"
#include "blackmisc/logcategorylist.h"
#include "blackmisc/logmessage.h"
@@ -331,7 +330,7 @@ namespace BlackCore
{
const CGlobalSetup currentSetup = m_setup.get();
CGlobalSetup loadedSetup;
loadedSetup.convertFromJson(Json::jsonObjectFromString(setupJson));
loadedSetup.convertFromJson(setupJson);
loadedSetup.markAsLoaded(true);
if (lastModified > 0 && lastModified > loadedSetup.getMSecsSinceEpoch()) { loadedSetup.setMSecsSinceEpoch(lastModified); }
bool sameVersionLoaded = (loadedSetup == currentSetup);
@@ -422,9 +421,7 @@ namespace BlackCore
{
try
{
const CDistributionList loadedDistributions = CDistributionList::fromDatabaseJson(
Json::jsonArrayFromString(distributionJson)
);
const CDistributionList loadedDistributions = CDistributionList::fromDatabaseJson(distributionJson);
if (loadedDistributions.isEmpty())
{
CLogMessage(this).error("Loading of distribution yielded no data");