mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 14:12:44 +00:00 
			
		
		
		
	FileManager: Ignore empty selections on tree view
If the selection is empty, the model index will be invalid and the file system model will return the root directory path by default. This causes the file manager to jump to the root directory when the currently selected item on the tree view is deselected.
This commit is contained in:
		
							parent
							
								
									440f017946
								
							
						
					
					
						commit
						0ec37c0d64
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -702,6 +702,8 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio | |||
|     }; | ||||
| 
 | ||||
|     tree_view.on_selection_change = [&] { | ||||
|         if (tree_view.selection().is_empty()) | ||||
|             return; | ||||
|         auto path = directories_model->full_path(tree_view.selection().first()); | ||||
|         if (directory_view.path() == path) | ||||
|             return; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 angel
						angel