sw/source/uibase/dbui/dbtree.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 647c9de0338350c1b5eff4b9adf08bd06930e36b
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Wed Jan 13 21:27:56 2021 +0300
Commit:     Justin Luth <justin_l...@sil.org>
CommitDate: Sat Jan 16 08:37:39 2021 +0100

    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_l...@sil.org>

diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx
index e47c7dc92c9c..9d1aa0f73436 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);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to