replace 'folder' with 'path' in icon functionality#170
replace 'folder' with 'path' in icon functionality#170tsipinakis merged 2 commits intodunst-project:masterfrom
Conversation
|
I agree with your point but this would break running configs. I'm still considering merging this because the configuration option hastn't been in the last release so anyone using this is using a development version anyway. I'll make a decision on this before I make the next release. |
|
👍 Path is much better |
|
👍 for Merge and tag with |
29763ec to
5320e38
Compare
|
rebased on master |
|
This will probably be merged for the next release. @lathan can you resolve the merge conflicts? |
|
Could you also please use path instead of paths. Please use it in singular form, as most unices name such a variable type in singular form. |
"folder" is more of a windows term. In unix we have paths and directories.
|
oops, sorry for disappearing for 3 years. I went back to Beyond my mad sed skillz, maybe it would be useful to retain @tsipinakis your thoughs? |
Nice timing, I was just trying to decide how long I want to hold off before closing PRs due to inactivity.
We obviously should since this change is probably going to break many configs that rely heavily on icons. There are some examples in |
|
I think 095b310 should cover the backwards compatibility. This is probably the first real C code I've ever written, so if someone can review it, that'd be nice. Also, I noticed that other existing if/else backwards compatibility code is enclosed in curly braces Finally, I think there is some issue with the help output generation when running |
|
Regarding the output of This is also the case for |
|
when you call The function |
|
sec... I think I got it. testing stuff... |
|
Just put the correct call of |
|
scheme: I think this might give all neccessary hints to rearrange the code. |
|
@bebehei I'm afraid I don't really understand where you were going with that. How about 2c917cb? It's basically this: The logic is straightforward. icon_path takes precedence. There is only one thing which bothers me. Help output differs depending on which combination of options is used. I don't see how I can control help output generation independently of setting the value for The problem is that I cannot not call I'll note again, that this issue is not unique to |
|
That's the code, what should be in there: if (ini_is_set("global", "icon_folders") || cmdline_is_set("-icon_folders")) {
settings.icon_path = option_get_string(
"global",
"icon_folders", "-icon_folders", icon_path,
"folders to default icons (deprecated, please use 'icon_path' instead"
);
fprintf(stderr, "Warning: 'icon_folders' is deprecated, please use 'icon_path' instead.\n");
}
settings.icon_path = option_get_string(
"global",
"icon_path", "-icon_path", icon_path,
"paths to default icons"
);
Copy it. You're allowed to do it.
Yes, I've already prepared a branch for this. I will create a separate PR for this. |
|
Ok, that's one of the many approaches I tried but it doesn't work. The reason it doesn't work is because the Also, code duplication isn't always bad, especially when it makes the code easier to comprehend. :) |
Ah, yes. That's a point. What about using a ternary operator? settings.icon_path = option_get_string(
"global",
"icon_path", "-icon_path",
settings.icon_path ? settings.icon_path : icon_path,
"paths to default icons"
); |
Yes, but we have to execute |
My proposal was "if, else if, else". One of these three always runs. I like the ternary operator approach though. Commit incoming... |
|
The last four commits could be squashed into one. Let me know if you want me to do that or keep all of them. |
🤦♂️ 🙈 Yes, you're right.
I'd guess you should squash them. |
Existing configurations will continue to work but now print a warning. New, icon_path option takes precedence if both options are used. If icon_folders option is used, its usage string also appears in --help output.
|
Squashed and force pushed. Old branch backed up as |
|
LGTM 👍 Thanks a lot to both of you for working on this! |
|
ty @tsipinakis thanks for the tips @bebehei ! |
This bothered me.
I replaced all the instances of 'folder' with 'path'.
I tested the icon functionality and it worked, including the relevant configuration option; but please somebody else also look at it because I'm unfamiliar with the code.