Skip to content

Commit

Permalink
Fix issues with connection id's
Browse files Browse the repository at this point in the history
  • Loading branch information
uglide committed Nov 20, 2020
1 parent 8dff467 commit 881adfc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/app/models/connectionsmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ bool ConnectionsManager::loadConnectionsConfigFromFile(const QString& config,

if (conf.isNull()) continue;

conf.setId(QUuid::createUuid().toByteArray());
addNewConnection(conf, false, group);
}

Expand Down
4 changes: 1 addition & 3 deletions src/modules/connections-tree/items/databaseitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ DatabaseItem::DatabaseItem(unsigned int index, int keysCount,
: AbstractNamespaceItem(model, parent, operations, index),
m_keysCount(keysCount) {}

DatabaseItem::~DatabaseItem() {
if (m_operations) m_operations->notifyDbWasUnloaded(m_dbIndex);
}
DatabaseItem::~DatabaseItem() {}

QByteArray DatabaseItem::getName() const { return QByteArray(); }

Expand Down
9 changes: 9 additions & 0 deletions src/modules/connections-tree/items/serveritem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ void ServerItem::unload() {
emit m_model.itemChildsUnloaded(m_self);

m_operations->disconnect();

for (auto db : m_databases) {
auto dbItem = db.staticCast<DatabaseItem>();

if (dbItem && m_operations) {
m_operations->notifyDbWasUnloaded(dbItem->getDbIndex());
}
}

m_databases.clear();

unlock();
Expand Down

0 comments on commit 881adfc

Please sign in to comment.