synfig icon indicating copy to clipboard operation
synfig copied to clipboard

Don't show warning message if config file is found

Open ice0 opened this issue 6 years ago • 8 comments

Synfig version & platform: Synfig master branch

Issue description:

When you run the synfig binary to render, it shows a warning on startup.

synfig(13472) [19:19:06] warning: Cannot open ./synfig_modules.cfg
synfig(13472) [19:19:06] warning: Cannot open C:\msys64\home\user/.local/share/synfig/synfig_modules.cfg

but this warning is incorrect because the synfig_modules.cfg file still can be found in the ../etc/ folder.

So we need to display warning only if synfig_modules.cfg file is not found in any known locations. Known locations is:

  • . (Current directory)
  • ../etc (relative from synfig binary location directory)
  • %USER_PROFILE%/.local/share/ (for Windows)
  • INSTALL_PREFIX (for example /usr/local/...) for Linux

If file is found when we need to show message with location where it is found. For example:

Using settings from `c:\synfig\etc\synfig_modules.cfg`

If file is not found then display message like this:

The configuration file `synfig_modules.cfg` was not found. Searched in the following directories (<list of directories>)

ice0 avatar Sep 29 '20 15:09 ice0

I would like to work on this , Please assign it to me.

tamerharsh avatar Sep 29 '20 18:09 tamerharsh

Please can you review for any comments or merge the PR

warlockz avatar Sep 29 '20 21:09 warlockz

@warlockz yes, it doesn't build :( You can check CI status in your PR (https://github.com/synfig/synfig/pull/1716)

I think if you are interesting in this issue (https://github.com/synfig/synfig/issues/1661) maybe pass this issue to @tamerharsh? So that everyone could participate.

@tamerharsh we also have issue here ^___^

ice0 avatar Sep 30 '20 03:09 ice0

Since there is no answer here by @warlockz, so @tamerharsh you can work on this issue if you want.

ice0 avatar Oct 03 '20 02:10 ice0

@ice0 Hey, it looks like this is being caused by main.cpp line 176. Removing that line should fix the extra warnings. As it looks like this issue is inactive, can I make a PR for this one? Do I need to modify the other warning at line 360? Thanks :)

anshitavishwa avatar Oct 07 '20 16:10 anshitavishwa

@AnshitaVishwa can you post with link to code, please? Anyway, you can a PR.

ice0 avatar Oct 08 '20 01:10 ice0

@ice0 I have made a PR. Is it okay? thanks!

anshitavishwa avatar Oct 08 '20 13:10 anshitavishwa

Yes. Already merged. Thank you!

ice0 avatar Oct 09 '20 09:10 ice0