Add relative path to table of desktop files

This commit is contained in:
Michael Leuchtenburg 2023-06-13 16:48:09 -04:00
parent 485661b706
commit 392976060f
1 changed files with 7 additions and 1 deletions

View File

@ -406,7 +406,13 @@ function utils.parse_dir(dir_path, callback)
gio.Async.start(do_protected_call)(function()
local result = {}
parser(gio.File.new_for_path(dir_path), result)
local f = gio.File.new_for_path(dir_path)
parser(f, result)
for i, entry in ipairs(result) do
local target = gio.File.new_for_path(entry.file)
entry.desktop_file_id = f:get_relative_path(target)
result[i] = entry
end
call_callback(callback, result)
end)
end