Skip to content

Commit

Permalink
Use GncImapInfo instead of struct imap_info where
Browse files Browse the repository at this point in the history
it makes sense to.
  • Loading branch information
Bob-IT authored and gjanssens committed Mar 13, 2016
1 parent 427d62e commit 213db2d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
10 changes: 4 additions & 6 deletions src/engine/Account.c
Expand Up @@ -5639,7 +5639,7 @@ gnc_account_imap_get_info_bayes (Account *acc)
{
GList *list = NULL;

struct imap_info imapInfo;
GncImapInfo imapInfo;

imapInfo.source_account = acc;
imapInfo.list = list;
Expand All @@ -5658,7 +5658,7 @@ gnc_account_imap_get_info (Account *acc, const char *category)
GList *list = NULL;
gchar *category_head = NULL;

struct imap_info imapInfo;
GncImapInfo imapInfo;

imapInfo.source_account = acc;
imapInfo.list = list;
Expand Down Expand Up @@ -5770,14 +5770,12 @@ look_for_old_separator_descendants (Account *root, gchar *full_name, const gchar
}

static void
change_imap_entry (Account *root, gpointer user_data)
change_imap_entry (Account *root, GncImapInfo *imapInfo)
{
Account *map_account = NULL;
const gchar *sep = gnc_get_account_separator_string ();
gchar *full_name;

struct imap_info *imapInfo = (struct imap_info*)user_data;

PINFO("Category Head is '%s', Full Category is '%s'", imapInfo->category_head, imapInfo->full_category);

// do we have a map_account all ready, implying a guid string
Expand Down Expand Up @@ -5870,7 +5868,7 @@ get_account_imap_info (Account *root, Account *acc)

for (node = imap_list; node; node = g_list_next (node))
{
struct imap_info *imapInfo = node->data;
GncImapInfo *imapInfo = node->data;

// Lets start doing stuff
change_imap_entry (root, imapInfo);
Expand Down
4 changes: 2 additions & 2 deletions src/engine/Account.h
Expand Up @@ -1406,7 +1406,7 @@ Account* gnc_account_imap_find_account_bayes (GncImportMatchMap *imap, GList* to
void gnc_account_imap_add_account_bayes (GncImportMatchMap *imap, GList* tokens,
Account *acc);

struct imap_info
typedef struct imap_info
{
Account *source_account;
Account *map_account;
Expand All @@ -1415,7 +1415,7 @@ struct imap_info
char *full_category;
char *match_string;
char *count;
};
}GncImapInfo;

/** Returns a GList of structure imap_info of all Bayesian mappings for
* required Account
Expand Down
8 changes: 3 additions & 5 deletions src/gnome/dialog-imap-editor.c
Expand Up @@ -400,13 +400,11 @@ show_count_column (ImapDialog *imap_dialog, gboolean show)
}

static void
add_to_store (GtkTreeModel *model, GtkTreeIter *iter, const gchar *text, gpointer user_data)
add_to_store (GtkTreeModel *model, GtkTreeIter *iter, const gchar *text, GncImapInfo *imapInfo)
{
gchar *fullname = NULL;
gchar *map_fullname = NULL;

struct imap_info *imapInfo = (struct imap_info*)user_data;

fullname = gnc_account_get_full_name (imapInfo->source_account);

// Do we have a valid map account
Expand Down Expand Up @@ -455,7 +453,7 @@ get_imap_info (Account *acc, const gchar *category, GtkTreeModel *model, const g

for (node = imap_list; node; node = g_list_next (node))
{
struct imap_info *imapInfo = node->data;
GncImapInfo *imapInfo = node->data;

// First add a child entry and pass iter to add_to_store
gtk_tree_store_append (GTK_TREE_STORE(model), &child, &toplevel);
Expand Down Expand Up @@ -533,7 +531,7 @@ get_account_info_online (GList *accts, GtkTreeModel *model)
GList *ptr;
GtkTreeIter toplevel;

struct imap_info imapInfo;
GncImapInfo imapInfo;

/* Go through list of accounts */
for (ptr = accts; ptr; ptr = g_list_next (ptr))
Expand Down

0 comments on commit 213db2d

Please sign in to comment.