plugins/applications: several fixes - #326
Open
mlebloi wants to merge 22 commits into
Open
Conversation
Makes this function more generic, accepting any &Path as it doesn't need an &DirEntry.
The return type has been changed from Result<Vec<_>, Box<dyn Error>> to
Vec<_>, removing the two errors which were both unnecessary:
1. when the XDG_DATA_DIRS were all empty and
2. when fs::read_dir("/usr/share/applications") failed.
These cases are now ignored by scrubber(), which seems more coherent as
other fs::read_dir() errors were already ignored, and a warning has been
added to init() when scrubber() finds no desktop entries.
They are unnecessary as State.entries is already a Vec so ordered, we can use the DesktopEntry index as an id (actually, the id was already equals to the index, so storing it is useless). Note: It works only because State.entries doesn't change between get_matches() and handler(), if it did we would need to store an id, like before this commit.
Ok, the performance impact is negligible here but the repeated String::replace()s which create a new String everytime... I couldn't let it like that.
Split into several functions, avoid repetition...
(konsole, xterm...)
Defaults to true to not change the default behaviour.
The plugin doesn't exit with failure on other error so, to be coherent, it shouldn't do it for this error neither.
message when script fail
non-valid UTF-8 string
allow partial config files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Terminal=truedesktop entries)prioritize_actionsconfig option to allow user choosing whether to prioritize actions or not (could not be disabled before)[applications]prefix before all stderr messages (some of them had it, some didn't)std::process::exit()for some errors and not others with no reasonspreprocess_exec_scriptstderr output.desktopfiles comments%%in theExec=property of.desktopfiles#[serde(default)]to the wholestruct Configin order to allow partial config filesIt is my first pull request by the way, so please tell me if I do something wrong.