fix crash when directory is changed
This commit is contained in:
parent
881fa8c9bd
commit
ed5f825b5a
|
@ -145,6 +145,12 @@ namespace Arc {
|
||||||
|
|
||||||
void Model::setDir(Dir *dir) {
|
void Model::setDir(Dir *dir) {
|
||||||
if(dir != m_dir) {
|
if(dir != m_dir) {
|
||||||
|
emit layoutAboutToBeChanged();
|
||||||
|
for(int row = 0, rows = rowCount(); row < rows; row++) {
|
||||||
|
for(int col = 0, cols = columnCount(); col < cols; col++) {
|
||||||
|
changePersistentIndex(index(row, col), QModelIndex{});
|
||||||
|
}
|
||||||
|
}
|
||||||
m_dir = dir;
|
m_dir = dir;
|
||||||
emit layoutChanged();
|
emit layoutChanged();
|
||||||
emit dirChanged(dir);
|
emit dirChanged(dir);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user