mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
Ref T148, in CDbLoadOverviewComponent do not trigger info object read if DB cannot be connected
(only results in error messages)
This commit is contained in:
committed by
Mathew Sutcliffe
parent
961f47b700
commit
6f7e827492
@@ -29,9 +29,11 @@ namespace BlackGui
|
||||
ui(new Ui::CDbLoadOverviewComponent)
|
||||
{
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "missing sGui");
|
||||
|
||||
ui->setupUi(this);
|
||||
this->admitCaches(); // in background
|
||||
|
||||
//! \fixme KB 201709 It is hard to judgte if it is a good idea to trigger cache admit in a UI component
|
||||
// althought admit happens in background, this component might trigger cache reads not needed (though it is not very likely)
|
||||
this->admitCaches();
|
||||
|
||||
ui->lbl_DatabaseUrl->setTextFormat(Qt::RichText);
|
||||
ui->lbl_DatabaseUrl->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||
@@ -187,7 +189,7 @@ namespace BlackGui
|
||||
static const QString imgFailed(":/diagona/icons/diagona/icons/cross-script.png");
|
||||
const QString dbUrlHtml("<img src=\"%1\"> <a href=\"%2\">%3</a>");
|
||||
const QString url = sGui->getGlobalSetup().getDbHomePageUrl().getFullUrl();
|
||||
bool canConnect = CNetworkUtils::canConnect(sGui->getGlobalSetup().getDbHomePageUrl());
|
||||
bool canConnect = sGui->getWebDataServices() && sGui->getWebDataServices()->canConnectSwiftDb();
|
||||
ui->lbl_DatabaseUrl->setText(dbUrlHtml.arg(canConnect ? imgOk : imgFailed, url, url));
|
||||
ui->lbl_DatabaseUrl->setToolTip(url);
|
||||
|
||||
@@ -333,14 +335,16 @@ namespace BlackGui
|
||||
{
|
||||
if (m_loadInProgress) { return; }
|
||||
if (!sGui || !sGui->hasWebDataServices()) { return; }
|
||||
if (sGui->isShuttingDown()) { return; }
|
||||
bool direct = false;
|
||||
|
||||
if (sGui->getWebDataServices()->getDbInfoDataReader() && sGui->getWebDataServices()->getDbInfoDataReader()->getInfoObjectCount() > 0)
|
||||
{
|
||||
direct = true;
|
||||
}
|
||||
else
|
||||
else if (sGui->getWebDataServices()->canConnectSwiftDb())
|
||||
{
|
||||
// do not trigger if cannot be connected
|
||||
sGui->getWebDataServices()->triggerReadOfDbInfoObjects();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user