Skip to content

Sort by type should thread symlinks like regular files

Amrit Kashyap Borah requested to merge Elessar1802/thunar:issue-71 into master

Problem

Described in #71 (closed)

Solution

As mentioned in the issue thread, @andreldm had a WIP, which I have rebased and worked upon.

What's been done

  • For querying the content_type of the symlink's target, we need to create a GFile for the target.
  • This had a problem. Since, there maybe symlinks defined using relative paths.
  • If g_file_new_for_path is used for creating the GFile using the path returned by g_file_info_get_symlink_target then the new GFile may not be the right one in the case of symlinks defined using relative paths.
  • Thus a new function was needed to handle this case.
  • What this function does is that, if the target_path is an absolute path, then that is used for creating the GFile. If not, then the target_path is resolved with respect to the symlink file's parent folder.

Related MR: !228 (closed)

Edited by Amrit Kashyap Borah

Merge request reports