It looks like thunar is loading directories twice in some cases

When directory specific settings are enabled, and a new folder is opened, that new folder is loaded twice in some occasions.

If I am not mistaken, it always happens when the folder which is opened uses a different view-type than the original folder.

Version information

thunar 4.21.5

Steps to reproduce

  • Add some printf into thunar_tree_view_model_load_dir e.g. before the signal connects: printf("thunar_tree_view_model_load_dir: %s\n", thunar_file_get_basename(node->file));, build thunar.
  • mkdir -p /tmp/test/sub
  • Open thunar and navigate into /tmp/test
  • Enable directory specific settings
  • Use "icon view"
  • Navigate into /tmp/test/sub
  • Use "list view"

Current behavior

Whenever switching between both directories, the printf is printed twice.

Expected outcome

Directory should only be loaded once, to minimize filesystem IO

Additional information

Original issue: #1723 (comment 112894)