Unstable Imap Editor

Robert Fewell 14ubobit at gmail.com
Wed Mar 28 06:09:33 EDT 2018


Could some one explain the following, trying to fix the 2nd problem as I
thought was the simpler one...
If I try this ...

    std::vector<std::string> path {IMAP_FRAME};
    if (category)
        path.emplace_back (category);

    if (qof_instance_has_path_slot (QOF_INSTANCE (acc), path))

I have a slot but the following does not...

    category_head = g_strdup_printf (IMAP_FRAME "/%s", category);

    if (qof_instance_has_slot (QOF_INSTANCE(acc), category_head))

These two functions look like this...

bool qof_instance_has_path_slot (QofInstance const * inst,
std::vector<std::string> const & path)
{
    return inst->kvp_data->get_slot (path) != nullptr;
}

gboolean
qof_instance_has_slot (const QofInstance *inst, const char *path)
{
    return inst->kvp_data->get_slot({path}) != NULL;
}

Does category_head need to be in a different format ?

Regards,

Bob



On 27 March 2018 at 17:33, Robert Fewell <14ubobit at gmail.com> wrote:

> It was mentioned some where it was slow to load so thought I would have a
> look.
>
> Dropping the GtkTreeModel has improved that but that has highlighted a
> couple of problems so far...
>
> 1st, when retrieving 'import-map-bays', the list consists of the number of
> tokens squared like this...
>  imported 1 transaction which results in 3 tokens and 1 transaction which
> results in 2 tokens in the file which then leads to 25 entries in the
> treeview.
>
> So for the above the list coming back from 'gnc_account_imap_get_info_bayes'
> is 25 entries.
>
> 2nd, when retrieving 'import-map', the list is empty despite having this
> entry...
>
>   <act:description>Checking Account</act:description>
>   <act:slots>
>     <slot>
>       <slot:key>import-map</slot:key>
>       <slot:value type="frame">
>         <slot>
>           <slot:key>desc</slot:key>
>           <slot:value type="frame">
>             <slot>
>               <slot:key>'MY HEALTH</slot:key>
>               <slot:value type="guid">32282cd8503549af9cf62265df11b3
> c7</slot:value>
>             </slot>
>           </slot:value>
>         </slot>
>       </slot:value>
>     </slot>
>
> It seems that in account.cpp line 5642 which is..
>
>     if (qof_instance_has_slot (QOF_INSTANCE(acc), category_head))
>
> is returning false despite category_head being 'import-map/desc'
>
> Hopefully I will get it sorted and create a PR for it.
>
> Bob
>


More information about the gnucash-devel mailing list