diff options
author | Justin Luth <justin.luth@collabora.com> | 2021-01-13 21:27:56 +0300 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-01-19 11:45:55 +0100 |
commit | 6c580008d397f5f5f4a0bfd879308018b5d2a54f (patch) | |
tree | e868d4ae26e7b2ac0e3e366304fa5dead257072d /sw | |
parent | 2383bb3dfe489309b1b57b95bfec56b4967610fb (diff) |
tdf#119610 tdf#112634: Don't show broken connections - RevB
This changes LO 6.0 commit 75a881829f19439245cdb859fc16d59461992f79
to use a light-weight check to see if a database exists.
The previous way made a connection, which is extremely
expensive if there is a password, or if network traffic
needs to timeout, etc. And if there are multiple
registered databases like that...
Change-Id: I980cb6979cfc7cae8f1251f3459718192459aaee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109242
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
(cherry picked from commit 647c9de0338350c1b5eff4b9adf08bd06930e36b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109402
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/dbui/dbtree.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx index 4dee21a4ed0c..9b23f2a4f457 100644 --- a/sw/source/uibase/dbui/dbtree.cxx +++ b/sw/source/uibase/dbui/dbtree.cxx @@ -157,8 +157,10 @@ void SwDBTreeList::InitTreeList() OUString aImg(RID_BMP_DB); for (const OUString& rDBName : std::as_const(aDBNames)) { - Reference<XConnection> xConnection = pImpl->GetConnection(rDBName); - if (xConnection.is()) + // If this database has a password or a (missing) remote connection, + // then it might take a long time or spam for unnecessary credentials. + // Just check that it basically exists to weed out any broken/obsolete registrations. + if (SwDBManager::getDataSourceAsParent(Reference<sdbc::XConnection>(), rDBName).is()) { m_xTreeView->insert(nullptr, -1, &rDBName, nullptr, nullptr, nullptr, true, m_xScratchIter.get()); m_xTreeView->set_image(*m_xScratchIter, aImg); |