Improved how connection is removed from the configuration file.

This commit is contained in:
eelke 2019-08-25 08:00:54 +02:00
parent b09e8a6d4b
commit b65edaa6ee
2 changed files with 8 additions and 17 deletions

View file

@ -210,26 +210,21 @@ bool ConnectionListModel::removeRows(int row, int count, const QModelIndex &pare
QSettings settings(file_name, QSettings::IniFormat);
for (int idx = 0; idx < count; ++idx) {
auto&& cc = m_connections[idx+row];
{
settings.beginGroup(cc.uuid().toString());
SCOPE_EXIT { settings.endGroup(); };
for (auto&& k : settings.childKeys()) {
settings.remove(k);
}
}
settings.remove(cc.uuid().toString());
}
settings.sync();
m_connections.remove(row, count);
result = true;
}
return result;
}
void ConnectionListModel::newItem()
{
// int i = m_connections->createNew();
// auto idx = createIndex(i, 0);
// emit dataChanged(idx, idx);
}
//void ConnectionListModel::newItem()
//{
//// int i = m_connections->createNew();
//// auto idx = createIndex(i, 0);
//// emit dataChanged(idx, idx);
//}
Expected<ConnectionConfig> ConnectionListModel::get(int row)
{