mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +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)
|
ui(new Ui::CDbLoadOverviewComponent)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "missing sGui");
|
Q_ASSERT_X(sGui, Q_FUNC_INFO, "missing sGui");
|
||||||
|
|
||||||
ui->setupUi(this);
|
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->setTextFormat(Qt::RichText);
|
||||||
ui->lbl_DatabaseUrl->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
ui->lbl_DatabaseUrl->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||||
@@ -187,7 +189,7 @@ namespace BlackGui
|
|||||||
static const QString imgFailed(":/diagona/icons/diagona/icons/cross-script.png");
|
static const QString imgFailed(":/diagona/icons/diagona/icons/cross-script.png");
|
||||||
const QString dbUrlHtml("<img src=\"%1\"> <a href=\"%2\">%3</a>");
|
const QString dbUrlHtml("<img src=\"%1\"> <a href=\"%2\">%3</a>");
|
||||||
const QString url = sGui->getGlobalSetup().getDbHomePageUrl().getFullUrl();
|
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->setText(dbUrlHtml.arg(canConnect ? imgOk : imgFailed, url, url));
|
||||||
ui->lbl_DatabaseUrl->setToolTip(url);
|
ui->lbl_DatabaseUrl->setToolTip(url);
|
||||||
|
|
||||||
@@ -333,14 +335,16 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
if (m_loadInProgress) { return; }
|
if (m_loadInProgress) { return; }
|
||||||
if (!sGui || !sGui->hasWebDataServices()) { return; }
|
if (!sGui || !sGui->hasWebDataServices()) { return; }
|
||||||
|
if (sGui->isShuttingDown()) { return; }
|
||||||
bool direct = false;
|
bool direct = false;
|
||||||
|
|
||||||
if (sGui->getWebDataServices()->getDbInfoDataReader() && sGui->getWebDataServices()->getDbInfoDataReader()->getInfoObjectCount() > 0)
|
if (sGui->getWebDataServices()->getDbInfoDataReader() && sGui->getWebDataServices()->getDbInfoDataReader()->getInfoObjectCount() > 0)
|
||||||
{
|
{
|
||||||
direct = true;
|
direct = true;
|
||||||
}
|
}
|
||||||
else
|
else if (sGui->getWebDataServices()->canConnectSwiftDb())
|
||||||
{
|
{
|
||||||
|
// do not trigger if cannot be connected
|
||||||
sGui->getWebDataServices()->triggerReadOfDbInfoObjects();
|
sGui->getWebDataServices()->triggerReadOfDbInfoObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user