devel questions

Chris Shoemaker c.shoemaker at cox.net
Thu Sep 16 18:58:13 EDT 2004


On Thu, Sep 16, 2004 at 11:38:27AM -0400, Derek Atkins wrote:
> Hi,
> 
> Chris Shoemaker <c.shoemaker at cox.net> writes:
> 
> > I've been using gnucash lightly for several (6?) months now.  I'm pretty
> > impressed with it, but I've always wondered why there wasn't more development
> > activity.  I code for fun (and profit) so any open source software I use
> > is theoretically fair game for playing with.
> 
> Mostly because the major devs are busy with other aspects in their lives.

I know what that's like... my first kid is on the way... exciting.

> 
> > What's the status of libegg stuff?  On its way out?  on its way in?
> > static?
> 
> It's code that's there until we decide that a minimum requirement is
> gtk2.4.  We always have a "base OS" that we use and require our code
> to build on that base OS with the minimum of additional dependencies.
> As of our last discussion, FC1 was the base OS.  We may decide to
> change that to FC2, in which case I think we could drop libegg and
> migrate to the gtk2.4 integration.

I see.  I was just naively using the docs for gtk2.4.  I didn't see
_any_ info about differences between 2.4 and 2.2.  I'll keep that in
mind.

> 
> > Why does removing/commenting out "gtk_container_add(GTK_CONTAINER(box),
> > GTK_WIDGET(dlg->relatedView));" from category_dialog_create(), prevent
> > the consistent SEGV upon closing the dialog?
> 
> Perhaps it's double-freed?  I dont know, you tell me.

I suspected double-free, but I don't know either.  It dies in the
library, but I'll keep digging.
> 
> > Is it valid to cast a (GtkTreeModel *) using GTK_TREE_MODEL_SORT()?
> 
> Maybe, if the runtime object is a GtkTreeModelSort or subclass
> thereof.

These GTK_XXX() macros aren't in the gtk docs.  I'm going to have to
check the source.  [time passes]

[ more time passes as I find out more about GLib and GObject ]

Ok, I did: 
ln -s /usr/include/gtk-2.0/ ./gtk;
ln -s /usr/include/glib-2.0/ ./glib;
etags -R

Now I can see the various GTK_XXX() macros, and trace all the way back
to gtype.h.  Ok.  Nice, it's a full-blown extensible dynamic typing system.
Ambitious, but it looks well thought-out.  Somebody (or many people) went
through a lot of trouble to make OO easy with C.  There must have been
some really compelling reason not to use some language with all these
features built-in.  No wonder it's a library.

> 
> > Why do I get:
> > (gnucash:18491): GLib-GObject-WARNING **: invalid cast from
> > `GncTreeModelAccount' to `GtkTreeModelSort'
> >  
> >  (gnucash:18491): Gtk-CRITICAL **: file gtktreemodelsort.c: line 2016
> >  (gtk_tree_model_sort_get_model): assertion `GTK_IS_TREE_MODEL_SORT
> >  (tree_model)' failed
> >  
> > when executing:   
> > f_model = gtk_tree_model_sort_get_model(GTK_TREE_MODEL_SORT(s_model));
> >
> > where f_model and s_model are (GtkTreeModel *).
> 
> Because the runtime object is a GncTreeModelAccount which apparantly
> is not a subclass of GtkTreeModelSort (but it IS a subclass of
> GtkTreeModel).

which one can tell by noticing in gnc_tree_model_account_get_type (void):

g_type_add_interface_static (gnc_tree_model_account_type, 
   GTK_TYPE_TREE_MODEL, &tree_model_info);

right?  I'm not missing any more explicit declaration of object
hierarchy, am I?


> 
> > Am I confusing compile-time types (which are clear) with the
> > run-time typing (which I haven't totally figured out yet)?
> 
> Yes.

figures.

> 
> > Finally, the most important question:  What tips do you have for
> > development environment/style?
> >
> > Here's what I got:  
> > 	CVS code checked out, editting w/ emacs, ran etags,
> > 	gtk docs at /usr/share/gtk-doc/html/gtk, I snipped "-02" out of
> > 	CFLAGS in Makefile.  (already had -g)  I'm usually doing "make;
> > 	sudo make install" in the highest dir I'm modifying (currently
> > 	gnucash/src/gnome/)  Then 10 min. later I run from
> > 	/usr/local/bin/gnucash, along with "gdb /usr/local/bin/gnucash
> > 	12345"
> 
> I would suggest you build into /opt/gnucash-<vers> instead of
> /usr/local, and you don't need to wait 10 minutes after the make
	:) You're right, it's more like 20-25 min before the make install
completes if I'm making from the top.  (300 MHz P2 laptop here )-:

> install before you run the program.  Also, if you do use the /opt
> model then you don't need to use sudo make install, you can just chown
> the /opt/gnucash-<vers> directory and make install as yourself.

Good idea.  So, do you use a lot of options? or just:
./configure --prefix=/opt/gnucash-2.0pre --enable-debug

> 
> > Oh, and I grabbed glade2 just to see what that was about.  Am I
> > missing anything?  Should I recomp all my libs with similar CFLAGS?
> > (I think _most_ of them have symbol info, but I suspect they're also -02 because gdb jumps a little erratically in the libs.
> 
> I dont feel the need to remove optimization unless I'm really getting
> confused by a particular function.  Usually I can figure out what's
> going on even with optimization turned on.  But that's all up to you.
> 
> > What tools/techniques are other devs using?
> >
> > I realize that I probably don't know as much as I should about autoconf,
> > automake, libtool, GTK, GLib, Glade, and many more.  I'm trying to "pick it up
> > along the way."  It all seems reasonably accessible.  I'm trying to steer clear
> > of gdk, pango, guile (but scheme's ok), and others.  Is this strategy
> > feasible, or am I going to have to learn _everything_ before being able
> > to intelligently hack on gnucash?
> 
> You can learn it peacemeal.  You can certainly delay learning about
> auto*, libtool, and probably glade (unless you intend to build/modify
> the UIs) for a while.  Gtk and Glib you should learn, but again you
> can learn on the fly.  They have pretty decent online docs for most of
> gnome.

That's good to know.

> 
> I look forward to seeing your patches.  :)

me too.  hehe.

Thanks for the tips.

-chris


More information about the gnucash-devel mailing list