Skip to content
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

pretty-printer: added saving and loading of preferences in/from a file. Fixes #494. #581

Merged
merged 2 commits into from Oct 12, 2017
Merged

pretty-printer: added saving and loading of preferences in/from a file. Fixes #494. #581

merged 2 commits into from Oct 12, 2017

Conversation

lpaulsen93
Copy link
Contributor

This pull-request implements saving and loading of the pretty-printer plugin preferences. In the current version pretty-printer simply does not save the preferences to a file so all changes to the preferences get lost after closing geany.

The code for saving and loading the preferences is adopted from the overview plugin. The config file is named geany/plugins/pretty-printer/prefs.conf.

else ppo->newLineChars = "\r\n";
if (ppo->newLineChars != NULL)
{
g_free ((gpointer)ppo->newLineChars);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(minor) freeing a NULL pointer is perfectly legal. There is no need to test nullity, you can use g_free unconditionally here. (see https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free)

{
if (ppo->newLineChars != NULL )
{
g_free ((gpointer)ppo->newLineChars);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(minor) same as above, you can use g_free unconditionally here

@lpaulsen93
Copy link
Contributor Author

@Thannoy: thanks, did not know that. Just fixed it.

@frlan
Copy link
Member

frlan commented Jun 22, 2017

Thanks for the PR. I will postpone it for 1.32 as currently there is no active maintainer for the plugin and I will not be able to do proper review until release

@frlan frlan modified the milestones: 1.31.0, 1.32.0 Jun 22, 2017
@lpaulsen93
Copy link
Contributor Author

👍 Fine for me. Thanks.

@frlan frlan merged commit c19bfd3 into geany:master Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants