Skip to content

Commit

Permalink
Fix regression in connection tree module (#3674)
Browse files Browse the repository at this point in the history
Fix issue #3666
  • Loading branch information
uglide authored Aug 17, 2016
1 parent 80d9416 commit 31a7709
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void KeysTreeRenderer::renderLazily(
QSharedPointer<AbstractNamespaceItem> namespaceItem = parent->findChildNamespace(firstNamespaceName);

if (namespaceItem.isNull()) {
QString namespaceFullPath = fullKey.mid(0, fullKey.indexOf(firstNamespaceName) + firstNamespaceName.size());
QString namespaceFullPath = fullKey.mid(0, fullKey.indexOf(notProcessedKeyPart) + firstNamespaceName.size());
namespaceItem = QSharedPointer<NamespaceItem>(new NamespaceItem(namespaceFullPath,
m_operations, currentParent,
parent->model(), settings));
Expand Down
1 change: 1 addition & 0 deletions src/modules/connections-tree/items/databaseitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ DatabaseItem::DatabaseItem(unsigned int index, int keysCount,
m_parentView(nullptr)
{
m_renderingSettings.nsSeparator = operations->getNamespaceSeparator();
m_renderingSettings.dbIndex = index;
}

DatabaseItem::~DatabaseItem()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/connections-tree/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void Model::onItemChildsLoaded(QWeakPointer<TreeItem> item)

auto index = getIndexFromItem(item);

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

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

0 comments on commit 31a7709

Please sign in to comment.