LibGUI+FileManager: Fix forgetting to map sorting proxy model indexes

Also assert indexes are valid in a few more places.

Finally fixes https://github.com/SerenityOS/serenity/issues/1440 and
https://github.com/SerenityOS/serenity/issues/2787 :^)
This commit is contained in:
Sergey Bugaev 2020-07-15 14:33:12 +03:00 committed by Andreas Kling
parent e12b591509
commit 5fd8dbacb1
Notes: sideshowbarker 2024-07-19 04:48:44 +09:00
4 changed files with 21 additions and 17 deletions

View file

@ -332,6 +332,7 @@ const FileSystemModel::Node& FileSystemModel::node(const ModelIndex& index) cons
{
if (!index.is_valid())
return *m_root;
ASSERT(index.internal_data());
return *(Node*)index.internal_data();
}