Skip to content

Commit 6dc2492

Browse files
committed
Bootstrap: Remove wasLoadedFromWeb flag
1 parent acf8df9 commit 6dc2492

File tree

7 files changed

+1
-50
lines changed

7 files changed

+1
-50
lines changed

resources/share/shared/bootstrap/bootstrap.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,4 @@
7979
]
8080
},
8181
"wasLoadedFromFile": false,
82-
"wasLoadedFromWeb": false
8382
}

src/blackcore/data/globalsetup.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace BlackCore::Data
4141

4242
bool CGlobalSetup::wasLoaded() const
4343
{
44-
return this->wasLoadedFromWeb() || this->wasLoadedFromFile();
44+
return this->wasLoadedFromFile();
4545
}
4646

4747
void CGlobalSetup::initDefaultValues()
@@ -272,7 +272,6 @@ namespace BlackCore::Data
272272

273273
bool CGlobalSetup::isSwiftVersionMinimumMappingVersion() const
274274
{
275-
if (!this->wasLoadedFromWeb()) { return false; } // only allowed from web
276275
if (m_mappingMinimumVersion.isEmpty()) { return false; }
277276
const QVersionNumber min = QVersionNumber::fromString(this->getMappingMinimumVersionString());
278277
return CBuildConfig::getVersion() >= min;
@@ -290,8 +289,6 @@ namespace BlackCore::Data
290289
% this->getFormattedUtcTimestampYmdhms()
291290
% separator
292291
% u"Global setup loaded: "
293-
% boolToYesNo(this->wasLoadedFromWeb())
294-
% u'/'
295292
% boolToYesNo(this->wasLoadedFromFile())
296293
% separator
297294

@@ -381,7 +378,6 @@ namespace BlackCore::Data
381378
case IndexSharedUrls: return QVariant::fromValue(m_sharedUrls);
382379
case IndexOnlineHelpUrls: return QVariant::fromValue(m_onlineHelpUrls);
383380
case IndexCrashReportServerUrl: return QVariant::fromValue(m_crashReportServerUrl);
384-
case IndexWasLoadedFromWeb: return QVariant::fromValue(m_wasLoadedFromWeb);
385381
case IndexWasLoadedFromFile: return QVariant::fromValue(m_wasLoadedFromFile);
386382
case IndexMappingMinimumVersion: return QVariant::fromValue(m_mappingMinimumVersion);
387383
case IndexPredefinedServers: return QVariant::fromValue(m_predefinedServers);
@@ -414,7 +410,6 @@ namespace BlackCore::Data
414410
case IndexSharedUrls: m_sharedUrls = variant.value<CUrlList>(); break;
415411
case IndexOnlineHelpUrls: m_onlineHelpUrls = variant.value<CUrlList>(); break;
416412
case IndexCrashReportServerUrl: m_crashReportServerUrl = variant.value<CUrl>(); break;
417-
case IndexWasLoadedFromWeb: m_wasLoadedFromWeb = variant.toBool(); break;
418413
case IndexWasLoadedFromFile: m_wasLoadedFromFile = variant.toBool(); break;
419414
case IndexMappingMinimumVersion: m_mappingMinimumVersion = variant.toString(); break;
420415
case IndexPredefinedServers: m_predefinedServers = variant.value<CServerList>(); break;

src/blackcore/data/globalsetup.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,12 @@ namespace BlackCore::Data
7878
//! Default constructor
7979
CGlobalSetup();
8080

81-
//! Has data loaded from web
82-
bool wasLoadedFromWeb() const { return m_wasLoadedFromWeb; }
83-
8481
//! Has data loaded from file
8582
bool wasLoadedFromFile() const { return m_wasLoadedFromFile; }
8683

8784
//! Loaded (web/file)
8885
bool wasLoaded() const;
8986

90-
//! Mark as loaded from web
91-
void markAsLoadedFromWeb(bool loaded) { m_wasLoadedFromWeb = loaded; }
92-
9387
//! Mark as loaded from file
9488
void markAsLoadedFromFile(bool loaded) { m_wasLoadedFromFile = loaded; }
9589

@@ -244,7 +238,6 @@ namespace BlackCore::Data
244238
static CGlobalSetup fromJsonFile(const QString &fileNameAndPath, bool acceptCacheFormat);
245239

246240
private:
247-
bool m_wasLoadedFromWeb = false; //!< Loaded from web
248241
bool m_wasLoadedFromFile = false; //!< Loaded from local file
249242
int m_dbHttpPort = 80; //!< port
250243
int m_dbHttpsPort = 443; //!< SSL port
@@ -273,7 +266,6 @@ namespace BlackCore::Data
273266

274267
BLACK_METACLASS(
275268
CGlobalSetup,
276-
BLACK_METAMEMBER(wasLoadedFromWeb),
277269
BLACK_METAMEMBER(wasLoadedFromFile),
278270
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
279271
BLACK_METAMEMBER(crashReportServerUrl),

src/blackcore/db/networkwatchdog.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ namespace BlackCore::Db
286286
if (!sApp || sApp->isShuttingDown()) { return; }
287287
if (!force && !this->isSwiftDbAccessible()) { return; }
288288
const CGlobalSetup gs = sApp->getGlobalSetup();
289-
if (!gs.wasLoadedFromWeb()) { return; }
290289
const CUrl pingUrl = gs.getDbClientPingServiceUrl(type);
291290
sApp->getFromNetwork(pingUrl, { this, &CNetworkWatchdog::replyPingClientService });
292291
}

src/blackcore/setupreader.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ namespace BlackCore
186186
{
187187
CGlobalSetup s;
188188
s.convertFromJson(content);
189-
s.markAsLoadedFromWeb(false);
190189
s.markAsLoadedFromFile(true);
191190
const CStatusMessage setMsg = m_setup.set(s);
192191
const CStatusMessage setInfo = CStatusMessage(this).info(u"Setup cache updated from local file '%1'") << fn;

src/blackgui/components/setuploadingdialog.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ namespace BlackGui::Components
5353

5454
this->displaySetupCacheInfo();
5555
this->displayCmdBoostrapUrl();
56-
this->displayBootstrapUrls();
5756
this->displayGlobalSetup();
5857
this->displayOtherVersionsInfo();
5958

@@ -77,35 +76,6 @@ namespace BlackGui::Components
7776
return sApp && sApp->hasSetupReader();
7877
}
7978

80-
void CSetupLoadingDialog::displayBootstrapUrls()
81-
{
82-
if (!sApp || sApp->isShuttingDown()) { return; }
83-
const CGlobalSetup setup = sApp->getGlobalSetup();
84-
if (setup.wasLoadedFromWeb())
85-
{
86-
QPointer<CSetupLoadingDialog> myself(this);
87-
QTimer::singleShot(250, this, [ = ]
88-
{
89-
if (!myself) { return; }
90-
const CUrlList bootstrapUrls = setup.getSwiftBootstrapFileUrls();
91-
for (const CUrl &url : bootstrapUrls)
92-
{
93-
const bool cc = CNetworkUtils::canConnect(url);
94-
if (!myself) { return; } // because of CEventLoop::processEventsUntil
95-
const CStatusMessage msg = cc ?
96-
CStatusMessage(this).info(u"Can connect to '%1'") << url.getFullUrl() :
97-
CStatusMessage(this).warning(u"Cannot connect to '%1'") << url.getFullUrl();
98-
ui->comp_Messages->appendStatusMessageToList(msg);
99-
}
100-
});
101-
}
102-
else
103-
{
104-
const CStatusMessage msg = CStatusMessage(this).warning(u"No loaded bootstrap setup available, skipping URL test");
105-
ui->comp_Messages->appendStatusMessageToList(msg);
106-
}
107-
}
108-
10979
void CSetupLoadingDialog::displayCmdBoostrapUrl()
11080
{
11181
if (!sApp->hasSetupReader()) { return; }

src/blackgui/components/setuploadingdialog.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ namespace BlackGui::Components
4646
//! Setup reader?
4747
bool hasSetupReader() const;
4848

49-
//! Set info fields
50-
void displayBootstrapUrls();
51-
5249
//! Display bootstrap URL
5350
void displayCmdBoostrapUrl();
5451

0 commit comments

Comments
 (0)