Skip to content

Commit 31a7709

Browse files
authored
Fix regression in connection tree module (RedisInsight#3674)
Fix issue RedisInsight#3666
1 parent 80d9416 commit 31a7709

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/modules/connections-tree/items/abstractnamespaceitem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void KeysTreeRenderer::renderLazily(
7474
QSharedPointer<AbstractNamespaceItem> namespaceItem = parent->findChildNamespace(firstNamespaceName);
7575

7676
if (namespaceItem.isNull()) {
77-
QString namespaceFullPath = fullKey.mid(0, fullKey.indexOf(firstNamespaceName) + firstNamespaceName.size());
77+
QString namespaceFullPath = fullKey.mid(0, fullKey.indexOf(notProcessedKeyPart) + firstNamespaceName.size());
7878
namespaceItem = QSharedPointer<NamespaceItem>(new NamespaceItem(namespaceFullPath,
7979
m_operations, currentParent,
8080
parent->model(), settings));

src/modules/connections-tree/items/databaseitem.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ DatabaseItem::DatabaseItem(unsigned int index, int keysCount,
2929
m_parentView(nullptr)
3030
{
3131
m_renderingSettings.nsSeparator = operations->getNamespaceSeparator();
32+
m_renderingSettings.dbIndex = index;
3233
}
3334

3435
DatabaseItem::~DatabaseItem()

src/modules/connections-tree/model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ void Model::onItemChildsLoaded(QWeakPointer<TreeItem> item)
143143

144144
auto index = getIndexFromItem(item);
145145

146-
if (!index.isValid())
146+
if (!index.isValid() || item.toStrongRef()->childCount() == 0)
147147
return;
148148

149149
emit beginInsertRows(index, 0, item.toStrongRef()->childCount() - 1);

0 commit comments

Comments
 (0)