[GNC] Cut/paste between databases

John Ralls jralls at ceridwen.us
Mon May 10 12:52:30 EDT 2021

> On May 10, 2021, at 7:35 AM, Tommy Trussell <tommy.trussell at gmail.com> wrote:
> On Sun, May 9, 2021 at 11:06 AM Paul Kinzelman <paul at kinzelman.com> wrote:
>> In that case, it'd be good to clear the transaction paste buffer
>> when reading in a new file so that people won't make the
>> mistake of thinking they can cut/paste between databases.
> It's a little more complicated than that -- even though GnuCash doesn't
> EXPLICITLY support having more than one book open at the same time, many of
> us have done it for years, so I think the protocol ought to be to check the
> paste buffer to make sure the transaction to be pasted is from the same
> book, and if not, disallow the paste. Ideally there'd also be some
> indication about why the paste failed, but that's probably optional as long
> as the behavior is explained somewhere.

It's not that complicated, because GnuCash doesn't put the cut/copied transaction and splits on a clipboard notwithstanding the function names xaccTransCopyToClipBoard and xaccTransCopyFromClipboard. The clipboard in this case is a variable in gnc-tree-control-split-register.c, completely inaccessible to anywhere else in the running GnuCash instance never mind another process. It also shouldn't survive changing books, though I haven't tested to see what happens: A crash is entirely possible.

John Ralls

More information about the gnucash-user mailing list