naughty: remove score system, merge presets

Scoring is broken, it's more useful to merge all presets, and declares that
order matters.
This commit is contained in:
Julien Danjou 2011-12-27 11:23:51 +01:00
parent 20cafb4851
commit f2872190d5
1 changed files with 1 additions and 6 deletions

View File

@ -509,17 +509,12 @@ if capi.dbus then
return return
end end
end end
local score = 0
for i, obj in pairs(config.mapping) do for i, obj in pairs(config.mapping) do
local filter, preset, s = obj[1], obj[2], 0 local filter, preset, s = obj[1], obj[2], 0
if (not filter.urgency or filter.urgency == hints.urgency) and if (not filter.urgency or filter.urgency == hints.urgency) and
(not filter.category or filter.category == hints.category) and (not filter.category or filter.category == hints.category) and
(not filter.appname or filter.appname == appname) then (not filter.appname or filter.appname == appname) then
for j, el in pairs(filter) do s = s + 1 end args.preset = util.table.join(args.preset, preset)
if s > score then
score = s
args.preset = preset
end
end end
end end
if not args.preset.callback or (type(args.preset.callback) == "function" and if not args.preset.callback or (type(args.preset.callback) == "function" and