mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-24 22:48:23 -05:00
dbhub: Fix sporadic crashes when selecting an identity
This fixes a sporadic crash when selecting an identity in the Remote dock. It happened because selecting an identity removes the first dummy entry in the drop down list of identities which for some reason emits the signal which then calls the same function to update the root dir again. Depending on the timing of the network requests this could lead to some confusion when building the tree structure. Also fix an off-by-one error when building the tree structure. See issue #2333.
This commit is contained in:
@@ -119,7 +119,11 @@ void RemoteDock::setNewIdentity(const QString& identity)
|
||||
|
||||
// Check if the dummy item is still there and remove it if it is
|
||||
if(ui->comboUser->itemData(0) == "dummy")
|
||||
{
|
||||
ui->comboUser->blockSignals(true);
|
||||
ui->comboUser->removeItem(0);
|
||||
ui->comboUser->blockSignals(false);
|
||||
}
|
||||
|
||||
// Get certificate file name
|
||||
QString cert = ui->comboUser->itemData(ui->comboUser->findText(identity), Qt::UserRole).toString();
|
||||
|
||||
+1
-1
@@ -158,8 +158,8 @@ void RemoteModel::parseDirectoryListing(const QString& text, const QVariant& use
|
||||
}
|
||||
|
||||
// Insert data
|
||||
beginInsertRows(parent, 0, static_cast<int>(array.size()));
|
||||
std::vector<RemoteModelItem*> items = RemoteModelItem::loadArray(array, parentItem);
|
||||
beginInsertRows(parent, 0, static_cast<int>(items.size() - 1));
|
||||
for(RemoteModelItem* item : items)
|
||||
parentItem->appendChild(item);
|
||||
endInsertRows();
|
||||
|
||||
Reference in New Issue
Block a user