Reset configuration from within Krita
Closed, ResolvedPublic

Description

We need to have a GUI button that will allow users to reset the configuration from within Krita.

tymond created this task.Dec 9 2019, 1:08 PM
tymond renamed this task from Reset configuration from inside Krita to Reset configuration from within Krita.
tymond updated the task description. (Show Details)

I wonder where this should be? I feel like this is common enough that we should make it really easy to find off the main menu...and not in the "configure krita" dialog.

One potential place could be the Settings main menu option. Maybe by the switch application language menu item

Just a reminder since it's easy to forget it exists: Holding ctrl+alt+shift when Krita is starting up will ask the user if they wish to clear Krita's settings file. This feature was originally implemented to help reset a config file that causes Krita to crash. The function responsible for this is KisApplication::askClearConfig() and KisApplication::clearConfig(). The caveat is that the functions have to be called before the config has been loaded.

It would be nice to have a way of doing this in the GUI too, though I suspect just calling the function is not going to be enough.

I would really like Krita to have also a way to reach the Krita crash log as well and maybe even a little function "install debug package". Crash logs are extremely useful and considering we're dealing with people that are not exactly technically knowledgeable, it would be useful do make sure that everything that now requires them to go through their file system and doesn't need to, is put in GUI as well.

I think that a new option in the Settings tab with a confirmation prompt would suffice. I also agree that a way to access crash logs would be really useful. Something like a pop-up showing the latest 10 crashes, maybe?

Note: we only have the crash log available on Windows. (And I've never been able to get the ctrl-alt-shift way of clearing the settings to work...)

I can try to do this issue, but this is my first time looking at Krita code, and my C++ is a bit rusty, and my Qt skills are non-existent. Still, should be an interesting challenge, if you guys don't mind!

Go ahead :-)

Okay, so I made some good progress, and there's a button in the settings to reset the Krita configurations. However, there's something strange, the code says that the file 'kritarc' is located in '.local/share/krita/', where in fact it is stored in the '.config' folder. Any pointers as to how you want this addressed (puns not intended)?

You probably should use a line like this (remember it's not only for Linux, but also Windows and Mac. And there is higher chance that the manual page is wrong (or that the location differs from one Linux system to another) than that we should change the code):
const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
(I took it from kis_config.cc)

I was using the already mentioned function 'askClearConfig()' on KisApplication. It does in fact delete the kritarc file from '.local/share/krita', but not the correct file. After switching to your line, it works! It requires a restart to apply theme changes though, so I have a feeling that I'm still missing one last piece of the puzzle. After that I'll create a PR!

Humm, I'm getting a bit of strange behavior. If I alter any settings, and then reset the configurations, everything in the 'kritarc' file is deleted EXCEPT the changes done BEFORE resetting the configurations. Any clues?

I can't look into this any further today maybe, but here's what I have so far. There's still that bug that I mentioned in the previous message, as well as the changes not being reflected immediately.

Oh damn... I know it's confusing, but the whole KDE is switching to giltab and Krita already switched (...mostly, at least what we could switch); hence, all code review is done on Gitlab on our KDE Invent instance: https://invent.kde.org/kde/krita
Instruction how to use it: https://docs.krita.org/en/untranslatable_pages/intro_hacking_krita.html#contributing-patches (you can use your current KDE account).

Oh, my bad, sorry! I'll look into it later today :)

This was worked in https://invent.kde.org/kde/krita/-/merge_requests/281 - and it was merged, so I'm going to close this task.

tymond closed this task as Resolved.May 6 2020, 11:32 AM
tymond triaged this task as Normal priority.