Cleanup
This commit is contained in:
parent
ab21d2455a
commit
d87bb3e279
|
@ -13,7 +13,6 @@ local utils = require("menubar.utils")
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
local table = table
|
local table = table
|
||||||
local gdebug = require("gears.debug")
|
|
||||||
local lgi = require("lgi")
|
local lgi = require("lgi")
|
||||||
local gio = lgi.Gio
|
local gio = lgi.Gio
|
||||||
local protected_call = require("gears.protected_call")
|
local protected_call = require("gears.protected_call")
|
||||||
|
@ -146,8 +145,6 @@ function menu_gen.generate(callback)
|
||||||
{ name = name, cmdline = cmdline, icon = icon, category = target_category }
|
{ name = name, cmdline = cmdline, icon = icon, category = target_category }
|
||||||
)
|
)
|
||||||
unique_entries[unique_key] = true
|
unique_entries[unique_key] = true
|
||||||
else
|
|
||||||
gdebug.dump(entry, "entry not included")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -382,11 +382,11 @@ function utils.parse_dir(dir_path, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
local result = {}
|
local result = {}
|
||||||
local f = gio.File.new_for_path(dir_path)
|
local dir = gio.File.new_for_path(dir_path)
|
||||||
parser(f, result)
|
parser(dir, result)
|
||||||
for i, entry in ipairs(result) do
|
for i, entry in ipairs(result) do
|
||||||
local target = gio.File.new_for_path(entry.file)
|
local desktop_file = gio.File.new_for_path(entry.file)
|
||||||
local relative_path = f:get_relative_path(target)
|
local relative_path = dir:get_relative_path(desktop_file)
|
||||||
entry.desktop_file_id = string.gsub(relative_path, "/", "-")
|
entry.desktop_file_id = string.gsub(relative_path, "/", "-")
|
||||||
result[i] = entry
|
result[i] = entry
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue