Skip to content

Commit

Permalink
[gnc-plugin-page-register] retrieve filter from .gcm properly
Browse files Browse the repository at this point in the history
ce34d0a had bug -- filter was retrieved but not returned.
  • Loading branch information
christopherlam committed May 18, 2021
1 parent c1cb29d commit 48f7e33
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions gnucash/gnome/gnc-plugin-page-register.c
Original file line number Diff line number Diff line change
Expand Up @@ -2124,21 +2124,20 @@ gnc_plugin_page_register_get_filter_gcm (Account* leader)
{
GKeyFile* state_file = gnc_state_get_current();
gchar* state_section;
gchar* filter_text;
gchar acct_guid[GUID_ENCODING_LENGTH + 1];
GError* error = NULL;
char* filter = NULL;

// get the filter from the .gcm file
guid_to_string_buff (xaccAccountGetGUID (leader), acct_guid);
state_section = g_strconcat (STATE_SECTION_REG_PREFIX, " ", acct_guid, NULL);
filter_text = g_key_file_get_string (state_file, state_section,
KEY_PAGE_FILTER, &error);
filter = g_key_file_get_string (state_file, state_section,
KEY_PAGE_FILTER, &error);

if (error)
g_clear_error (&error);
else
g_strdelimit (filter_text, ";", ',');
g_strdelimit (filter, ";", ',');

g_free (state_section);
return filter;
Expand Down

0 comments on commit 48f7e33

Please sign in to comment.