v29.4-roots.4 · Commit 15: [PATCH 15/37] fix(qt): clear stale peer details on refresh
src/qt/peertablemodel.cpp
Before: src/qt/peertablemodel.cpp · After: src/qt/peertablemodel.cpp
File metadata
index 9f47213ed92d6fe9f9ed3a2441c1d97d64b0abfa..2912138b9fe77aaadc4ef219a8df8c5b0f7b5f22 100644
Download original patch · Release notes
Diff rows 1–12 of 12. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.
src/qt/peertablemodel.cpp
CHANGED
|
@@ -184,7 +184,9 @@ void PeerTableModel::refresh()
|
|
|
184
184
|
m_peers_data.swap(new_peers_data);
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
const auto top_left = index(0, 0);
|
|
188
|
-
const auto bottom_right = index(rowCount() - 1, columnCount() - 1);
|
|
189
|
-
Q_EMIT dataChanged(top_left, bottom_right);
|
|
187
|
+
if (rowCount() > 0) {
|
|
188
|
+
const auto top_left = index(0, 0);
|
|
189
|
+
const auto bottom_right = index(rowCount() - 1, columnCount() - 1);
|
|
190
|
+
Q_EMIT dataChanged(top_left, bottom_right);
|
|
191
|
+
}
|
|
190
192
|
}
|