mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
fix: crash when renaming top-level folder in qt (#2230)
This commit is contained in:
@@ -91,9 +91,9 @@ public:
|
||||
} // namespace
|
||||
|
||||
FileTreeModel::FileTreeModel(QObject* parent, bool is_editable)
|
||||
: QAbstractItemModel(parent)
|
||||
, root_item_(new FileTreeItem)
|
||||
, is_editable_(is_editable)
|
||||
: QAbstractItemModel{ parent }
|
||||
, root_item_{ new FileTreeItem }
|
||||
, is_editable_{ is_editable }
|
||||
{
|
||||
}
|
||||
|
||||
@@ -320,6 +320,8 @@ void FileTreeModel::clear()
|
||||
{
|
||||
beginResetModel();
|
||||
clearSubtree(QModelIndex());
|
||||
delete root_item_;
|
||||
root_item_ = new FileTreeItem{};
|
||||
endResetModel();
|
||||
|
||||
assert(index_cache_.isEmpty());
|
||||
|
||||
Reference in New Issue
Block a user