Avoid potential access of .last() on empty list
Review Request #129400 - Created Nov. 14, 2016 and submitted
locateAll can return nothing, therefore we can't always call .last() on it. Existing code should be able to handle an empty package root as the user could also also have provided a broken package root as an argument.
Ran kpackagetool --generate-index -g
Previously asserted. No longer asserted.
other than that, ship it
no, locate would return the first most suitable it found, that is usually the local one under ~/.local
whuile this being with global option we need the system one instead. I don't see an option in qstandardpaths to ignore the local stuff, so using the last one of the things returned by locateAll is the better heuristic i found for having this behavior