Actually looking at the code (GConf vs. BonoboConfig)



OK.  I must say I just had an incredible laugh.  That's because I just looked
at the actual use of configuration stuff in libgnome* nowdays.

OK, Why was gnome-config bad?  You get no notification when things change.
So doing desktop things with it sucks cuz apps don't redraw according to
current settings.

OK, so where is it used now:

  gnome-exec:  to get the user's terminal preference, no need for
               notification
  gnome-url:   Get the users preferences of how to display urls.
               OK a bit more complex, still no need for notification.
  gnome-preferences:  This is an incredibly weird API as all it does
               is wrap a couple of boolean gets.  Also this is a place
               where you need notification, but with this API you don't
               get it.  Usefulness of these functions compared to just
               getting the key? 0.  Ease of notification? 0.

Yes folks this is all.  All in all, the code required to init bonobo, get the
monickers, set things up, is about the same size as the code actually using
these config keys.  And on the whole, it acts in EXACTLY THE SAME MANNER AS
THE GNOME-CONFIG usage.

Look ma! we've spent the last few years working on an API so that we can do
EXACTLY THE SAME STUFF as we did before.  And have the EXACT SAME PROBLEMS.

I don't know about the rest of you, I find this hilarious.

In the meantime I think we can safely dump the gconf init on program init,
and just use it in places where we actually need notification or config keys.
This means it adds 0 startup time.  oafd is NOT started on program init,
gconfd is not started on program init.  No CORBA calls are made.  No extra
code needs to be run.  No components are dlopened into memory.  Bonobo need
not be initialized.  I think removing all init whatsoever, definately speeds
up startup.  Don't you think?

All code that we will need to write is:

client = gnome_client_get_default ();
bool = gnome_client_get_boolean (client, "foo", &error);
g_object_unref (G_OBJECT (client));

Three magical lines of code.  Aren't they beautiful ...

George

-- 
George <jirka 5z com>
   Originality is undetected plagiarism.
                       -- Dean W. R. Inge




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]