-
-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move color settings from taskrc to default.theme #3775
base: develop
Are you sure you want to change the base?
Move color settings from taskrc to default.theme #3775
Conversation
…d "default.theme" and included that file in "Context.cpp"
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I can confirm that the default.theme
gets installed automatically, without having to be mentioned in doc/CMakeLists.txt
.
However, this causes a few tests to fail, and I think that's because the removed lines in src/Context.cpp
are actually the default config (as in, what Taskwarrior uses if no config file is found or a setting doesn't appear there). So when the tests run, there are no color settings at all.
I tried fixing this by putting include default.theme
in configurationDefaults
but not surprisingly, this didn't work -- it didn't find that file, since tests run from from the source code and not the installed application.
@d2718nis can correct me if I'm wrong, but I think the idea is to put the theme settings in one place (doc/rc
) so we can't forget to update them when adding a new color setting. If that's the case, then we just need to find a way to also include that information in the default settings built into the task
binary. https://stackoverflow.com/questions/410980/include-a-text-file-in-a-c-program-as-a-char/47801116 has some ideas of how to do that, but they look pretty complicated and involve messing with CMake.
Co-authored-by: Dustin J. Mitchell <[email protected]>
Co-authored-by: Dustin J. Mitchell <[email protected]>
I think the issue with that solution is it requires that the file itself have |
Ah, I see. Maybe we can create a function that reads a text file we want (like the "default.theme" file) and outputs it into a string so that we can call that function to include it in the source code? That way, we don't have to edit or add R"()" to the files! |
Maybe! Let's try that.. |
Removed all "color." related settings from "Context.cpp" and relocated them into a newly created file called "default.theme" within the same directory as the "no-color.theme" file.
Included "default.theme" file in "Context.cpp" using "#include default.theme".