2015-12-10 GnuCash IRC logs

01:05:46 *** MechtiIde has joined #gnucash
01:32:36 *** autoditac__ has joined #gnucash
01:55:49 *** MechtiIde has quit IRC
03:06:28 *** gour has joined #gnucash
03:16:16 *** uXus has quit IRC
03:19:56 *** uXus has joined #gnucash
03:31:31 *** nomeata has joined #gnucash
04:00:37 *** Unhammer has quit IRC
04:00:56 *** Unhammer has joined #gnucash
04:01:22 *** fabior has joined #gnucash
04:42:02 *** fabior has quit IRC
04:42:33 *** fabior has joined #gnucash
04:45:42 *** ErKa has joined #gnucash
05:38:15 *** lmat has quit IRC
05:38:31 *** Unhammer has quit IRC
05:38:31 *** mikee has quit IRC
05:38:31 *** fell has quit IRC
05:38:31 *** CDB-Man has quit IRC
05:38:31 *** Simon has quit IRC
05:38:33 *** ErKa has quit IRC
05:38:36 *** Unhammer has joined #gnucash
05:38:36 *** mikee has joined #gnucash
05:38:36 *** fell has joined #gnucash
05:38:36 *** CDB-Man has joined #gnucash
05:38:36 *** Simon has joined #gnucash
05:40:14 *** lmat has joined #gnucash
05:44:09 *** gour has quit IRC
05:49:59 *** gour has joined #gnucash
05:54:20 *** ErKa has joined #gnucash
06:35:07 *** srbaker has joined #gnucash
06:54:40 *** mlncn has joined #gnucash
07:06:54 *** Jimraehl1 has left #gnucash
07:10:59 *** Jimraehl1 has joined #gnucash
07:18:14 *** fabior has quit IRC
07:51:19 *** mlncn has quit IRC
07:54:28 *** jralls_ has joined #gnucash
07:54:41 *** Jimraehl1 has quit IRC
07:55:17 *** jralls has quit IRC
08:16:02 *** mlncn_ has joined #gnucash
08:30:37 *** autoditac__ has quit IRC
08:31:46 *** autoditac__ has joined #gnucash
08:32:05 *** fabior has joined #gnucash
08:32:07 *** himaxx has joined #gnucash
08:39:34 *** mlncn_ has quit IRC
08:41:20 *** himaxx has quit IRC
08:51:26 *** gjanssens has joined #gnucash
08:51:26 *** ChanServ sets mode: +o gjanssens
09:22:54 *** aqua_ has joined #gnucash
09:26:02 *** mlncn has joined #gnucash
09:37:06 *** mlncn has quit IRC
09:42:49 *** aqua_ has quit IRC
09:43:43 *** codesmythe has joined #gnucash
09:48:35 *** mlncn_ has joined #gnucash
09:55:11 *** mlncn_ has quit IRC
09:55:54 *** aqua_ has joined #gnucash
10:14:24 *** mlncn_ has joined #gnucash
10:39:07 *** fell has quit IRC
11:09:15 *** nomeata has quit IRC
11:18:24 *** mlncn_ has quit IRC
11:20:15 *** autoditac__ has quit IRC
11:25:49 *** srbaker has quit IRC
11:38:27 *** JeanValjean has joined #gnucash
11:40:12 *** MechtiIde has joined #gnucash
12:44:06 *** srbaker has joined #gnucash
12:58:23 <gjanssens> Yay, I managed to squeeze one more bugfix in before the release weekend
13:05:48 <jralls_> gjanssens: Good thing you mentioned that! I was thinking 12/27... but the schedule says the 18th, a week from tomorrow. I think I'll change that to the 20th so it's on Sunday as usual.
13:07:10 <gjanssens> That's fine jralls_
13:07:25 *** jralls_ is now known as jralls
13:07:59 <gjanssens> That gives my patch a few more days of testing also. I'm not that familiar with the qof internals so I hope it doesn't have unintended side effects.
13:08:07 *** gncbot sets mode: +o jralls
13:08:11 <gjanssens> Feel free to point them out if you find any
13:08:34 <jralls> ;)
13:10:33 *** uXus has quit IRC
13:11:06 <jralls> codesmythe: You probably saw that I merged your cmake PR. Are you planning to get the tests working?
13:11:16 <MechtiIde> do you want another release this year?
13:16:01 <codesmythe> Yep saw that. So you where able to get a Win7 build through, then?
13:16:25 <gjanssens> MechtiIde: yes, as the roadmap indicates there will be one more by the end of next week
13:16:33 <codesmythe> Working on tests as we type…. qof is mostly done, working on backend/xml
13:16:42 <gjanssens> jralls: my commit breaks make check in qof
13:17:37 <gjanssens> There's a test that no providers are initialized before qof_session_load_backend is called
13:18:07 <gjanssens> However, after my commit, qof_session_init already calls qf_session_load_backend hence the providers are initialized
13:18:55 <gjanssens> Perhaps I created a hard-to-test situation here.
13:19:47 <gjanssens> Any suggestions to do this in a cleaner way or should I just drop the assertion that no providers are set up prior to calling qof_session_load_backend ?
13:19:52 *** gour1 has joined #gnucash
13:22:11 *** gour has quit IRC
13:23:13 *** srbaker has quit IRC
13:24:33 <jralls> gjanssens: I'd have done it a bit differently. Somewhere there's logic that doesn't mark the book dirty if there's no backend. I'd have removed that. Most apps will open the save as dialog on a save if they don't already have a filename, so that's what users expect. That behavior might already be baked into Gtk.
13:25:29 <gjanssens> jralls: that's the lead I was following as well...
13:26:30 <gjanssens> It turns out the gnucash save logic does work like that: if no filename exists it will go into save as mode
13:27:26 <gjanssens> The issue in this case was lower level: if no backend is set (as was the case for File->New), this logic is never triggered, because there is nothing that will mark the book as dirty
13:28:06 <gjanssens> This is handled solely in the xml backend in xml_commit_edit
13:28:12 <jralls> Huh? QofInstance manages dirty, not QofSession.
13:28:23 <gjanssens> Nope, only part of it
13:28:47 <gjanssens> That is, it manages dirty but won't trigger gui updates of the save button or * in the title
13:29:02 <gjanssens> This is triggered only if the session is marked dirty
13:29:16 <gjanssens> And that is done only for the xml backend
13:29:34 <gjanssens> Which kind of makes sense as the sql backend doesn't need the save button to get activated
13:30:38 <gjanssens> This code to mark the session dirty used to be in qof_commit_edit_part2 and it's still there but commented out
13:31:11 <gjanssens> My first attempt was to enable that code again, but this would interfere with the sql backends
13:31:25 <jralls> Ok. That's screwed up. There shouldn't be any dependencies between the GUI and the backend -- in either direction. The save button should toggle on the state of QofBook.session_dirty; the SQL backend instantly clears that when it commits the edit.
13:32:28 <gjanssens> Hmm, I'm cutting corners to not having to write a book :)
13:32:31 <jralls> Might even happen between draw cycles so that the GUI never sees the flag toggle.
13:32:47 <gjanssens> The gui code does trigger on session-dirty
13:33:41 <gjanssens> Which is indeed set by the backends (I'm sure about the xml backend, I haven't checked the sql backend)
13:34:18 <jralls> Wait. Qfo_commit_edit_part2 should *clear* session_dirty, not set it!
13:34:44 * gjanssens goes back into the code to re-read...
13:36:28 <gjanssens> qof_commit_edit_part2 doesn't do anything with the dirty flag. It just hands this part off to the respective backends
13:37:17 <gjanssens> xml_commit_edit (which gets called for the xml backend) sets the dirty flag, which will eventually trigger the gui to enable the save button
13:38:15 *** srbaker has joined #gnucash
13:39:18 <gjanssens> sql_commit_edit on the other hand will call qof_book_mark_session_saved (clearing the dirty flag on the session)
13:39:47 <gjanssens> I suppose this function is also called somewhere in the xml backend when a save action is triggered.
13:40:02 *** autoditac__ has joined #gnucash
13:40:13 <jralls> Hmm, and xml_commit_edit has immediate save code that's ifdeffed out.
13:41:50 <gjanssens> gnc_xml_be_write_to_file does indeed call qof_book_mark_session_saved
13:42:56 <gjanssens> That code is rightfully ifdeffed out imo.
13:43:13 <gjanssens> If not gnucash would trigger a save on each commit
13:43:44 <gjanssens> Which is not what we want in the current xml code (it's not incremental saves like in sql)
13:45:01 <jralls> Right, no argument. It should just be removed along with the rest of xml_commit_edit's guts. The mark-dirty code belongs in qof_commit_edit_part2.
13:45:02 * gjanssens is kind of relieved he's not the only one to loose the overview from time to time in the qof and backend code...
13:45:31 <gjanssens> Let me try...
13:45:51 * jralls would be amazed if anyone can keep that enormous pile of spaghetti *straight* for more than a millisecond or two.
13:48:31 <gjanssens> LOL
13:48:45 <warlord> I used to understand it all.
13:52:42 *** MechtiIde has quit IRC
13:52:43 <gjanssens> Which makes you worthy of your nick, warlord :)
13:53:13 *** aqua_ has quit IRC
14:00:24 <gjanssens> jralls: moving the session-dirty part back to qof_commit_edit_part2 works for xml and no file, but breaks for sql (tried with an existing sqlite file)
14:00:45 <gjanssens> Making a change in an sql db will enable the save button
14:00:57 * gjanssens will dig a bit deeper
14:01:55 <warlord> LOL
14:02:00 <jralls> Bet the only code to disable the save button is in the button's press event handler.
14:02:13 *** chazdiezal has joined #gnucash
14:02:17 <warlord> The way I think it needs to work is:
14:02:29 <warlord> commit_part_N sets the dirty flag
14:02:47 <warlord> backend clears it if necessary (backend dependent)
14:03:10 <warlord> I dont think part2 is the right place -- but it depends when the backend commit() is called
14:04:37 <gjanssens> warlord: when a new file is created there is no backend yet, so there's nothing setting the dirty flag
14:04:45 <gjanssens> That's the issue I'm trying to solve
14:05:08 <gjanssens> My first attempt was to always have a backend set, even on new files
14:05:23 <gjanssens> The xml backend code works fine even if no filename is given yet
14:06:01 *** chazdiezal has left #gnucash
14:06:07 <jralls> warlord: The backend should clear it when the change is written out. When that happens depends on the backend type.
14:06:11 <gjanssens> That does pollute the session code though, so we started looking for other ways
14:07:20 <gjanssens> Here's another question: we have qof_book_mark_session_dirty and qof_collection_mark_dirty
14:07:35 <gjanssens> What is the second one supposed to do ?
14:08:55 <jralls> Force the backend to evaluate the contents of the collection for things that need to be saved. The SQL backend in particular ignores saving any QofInstance that isn't marked dirty.
14:10:45 <jralls> Now, whether that's necessary or not is another matter. Book uses collections as a directory of objects loaded in memory for searches and iterations. I think that the only other use is in business for collecting transactions into bills and invoices.
14:11:13 *** chazdiezal has joined #gnucash
14:12:38 <warlord> jralls: yes, but we need to make sure that the backend clearning it happens *after* the commit_part_N sets it.
14:14:21 <gjanssens> warlord: and that was the part I did wrong in my recent test
14:14:30 <gjanssens> I changed this and now everything appears to work ok
14:14:37 <jralls> Excellent!
14:15:16 <jralls> Did you move it to qof_commit_edit or just in front of calling the backend's commit?
14:15:37 <gjanssens> The latter
14:18:21 <jralls> Does make check now pass?
14:24:23 <gjanssens> Yes.
14:24:36 <gjanssens> I'm still cleaning up my commit however before pushing it
14:37:12 <gjanssens> While investigating all this, I also discovered gnucash has two commit modes, a default one and one that's enabled by setting qof_set_alt_dirty_mode
14:37:43 <gjanssens> However, we enable the alt_dirty_mode at engine initialization
14:37:58 <gjanssens> Which means in practise we only use the alternative way
14:38:31 <gjanssens> Should we just drop the "default" mode then to simplify the code ?
14:43:00 * jralls is looking at alt_dirty_mode's history
14:43:12 *** chazdiezal has left #gnucash
14:49:53 <jralls> Hampton made that the only mode without explanation in 57a11ea (r13927) 5 May 2006. So the qof_collection_mark_dirty bit *is* superfluous. Yes, by all means clean it up.
14:54:15 <gjanssens> Ok
14:55:14 <gjanssens> I'm not sure yet if it's superfluous everywhere though
14:55:38 <gjanssens> It's supposed to be called now in qof_commit_edit_part2 IIUC
14:55:50 <gjanssens> Which is where I've added it as well
14:56:19 <gjanssens> The collection dirty bit is seemingly still in use in other parts of the code
14:57:02 <gjanssens> But I can for sure drop the alt mode stuff (I mean make that behaviour default and drop the other behaviour)
14:57:37 <gjanssens> Maybe later, it's time for diner here...
14:59:16 <jralls> Ah, I misread that. Alt dirty mode means that it called *only* in qof_commit_edit_part2.
14:59:44 <gjanssens> Yep. See my relief statement earlier today ;)
15:09:00 *** ErKa has quit IRC
15:31:23 *** srbaker has quit IRC
16:10:57 *** gour1 has quit IRC
16:36:02 *** aqua_ has joined #gnucash
16:36:42 *** gjanssens has quit IRC
16:39:32 *** JeanValjean has quit IRC
17:10:20 *** jralls has quit IRC
17:11:40 *** mlncn_ has joined #gnucash
17:13:43 *** jralls has joined #gnucash
17:13:43 *** ChanServ sets mode: +o jralls
17:23:18 *** mlncn_ has quit IRC
17:24:48 *** mlncn_ has joined #gnucash
17:29:25 *** mlncn_ has quit IRC
17:33:55 *** mlncn has joined #gnucash
17:45:42 *** ErKa has joined #gnucash
17:53:33 *** black_flag_022 has joined #gnucash
17:54:46 *** black_flag_022 has left #gnucash
18:16:25 *** mlncn has quit IRC
18:23:07 *** mlncn_ has joined #gnucash
18:23:41 *** fabior has quit IRC
18:33:09 *** mlncn_ has quit IRC
19:14:33 *** fell has joined #gnucash
20:05:16 *** ErKa has quit IRC
20:16:30 *** autoditac__ has quit IRC
20:50:57 *** jralls has quit IRC
21:08:26 *** gncbot sets mode: +o fell
23:15:58 *** aqua__ has joined #gnucash
23:18:07 *** aqua_ has quit IRC