We have made some improvements and fixes to the first prototype:
- Disabled metadata writing when bus is down to avoid having several Gedit processes writing to it at the same time.
- Avoided application shutdown when bus shuts down.
- Fixed indentation and naming.
- Tested provided D-Bus service with a client outside Gedit.
- Implementation of GeditDbus GObject as a single instance.
- Provide a hash table to this interface to make it more extensible without breaking compatibility.
- Some other minor fixes…
Sent a patch to Paolo Borrelli, who suggested:
- Avoid using “_” as prefix for static methods.
- Use G_DEFINE_TYPE to define the GeditDbus GObject type.
Besides, he pointed out that Vytas is working on a single-application instance framework for Gnome. I’ll take a look at it to check if it could be useful for Gedit.
Build-Brigade is the name of the team that will work on continuous integration for Gnome. This team has been created during GUADEC after Juanjo’s BoF about continuous integration.
As a member of this brigade, I started developing some unit tests for Gtk+ using Check, a GNU tool for developing unit tests for C programs.
I hope we can merge this work with Gtk+ soon and make it useful for Gtk+ developers.
It is time to write some words about my experience at GUADEC in Vilanova. Let’s focus in the most interesting things and leave some annoying logistics problems for another post :).
There was a lot of interesting talks and BoFs this year, I specially liked these ones:
- Alex Graveley’s talk about Gimmie, a very interesting approach for the Gnome pannel.
- Federico Mena’s talk about Gnome performance issues. Really good work and very instructive.
- Robert Love’s talks about NetworkManager and FUSE (two intersting talks in one talk time).
- Kathy Sierra’s talk about passionate users. A very funny and useful marketing-oriented talk about how you can create passionate users about your software/community.
- Juanjo’s BoF about continuous integration for Gnome. A very interesting meeting which finally drive people to gather together to work in this topic. Hopefully I can help doing some work on gtk+ unit testing 🙂
And of course, it was time to meet a lot of people around the Gnome community. I will write more about this and other GUADEC topics in next posts.
I have removed all bacon-message stuff from Gedit, even the ASCII protocol they are using for communications and replaced it by a Dbus interface. In order to make it extensible while preventing it from breaking compatibility I added a GHashTable as argument to this interface, so extensions to it do not need to modify its signature, and so, will be compatible with older versions of the service. Besides, i added read-only metadata support, that is automatically set whenever the bus shuts down, to prevent concurrent writing access to Gedit’s metadata file. Finally, I implemented a single instance pattern for the Dbus gobject.
Now it is testing time….
It is almost GUADEC time!, this year I will attend with a lot of collegues from Igalia, it is going to be celebrated really near here, so we can not lose the chance. I hope we will have a really good time there, meet some Gnome folks and learn a lot about our favourite desktop 🙂
See you there!
At this moment, when you start a second Gedit process , it opens a new tab in your current Gedit window instead of creating a new one. This behaviour has been added from scratch in Gedit using the so called bacon-message, developed by them.
Today I’ve started working on the replacement of bacon-message stuff of Gedit with Dbus. I started by creating a GObject that contains all the Dbus related behaviour.
My first problem was that I needed to know if the current Gedit process is a server (first Gedit process in the user session) or a client (not the first). To solve this issue I had to check the result of the org_freedesktop_DBus_request_name function (which tries to register the Dbus service name). The tricky part was to find the set of result #defines and examine their behaviour depending on the flags you use when requesting the name.
Once I’ve solved this issue, it was not too dificult to finish this Dbus object, and at this moment I have tested Dbus setup inside Gedit and it seems to be working fine :).
Next time I’ll start replacing bacon-message stuff in gedit.c main with my brand new Dbus stuff. Let’s see how it works 🙂
Hackfest time at Igalia :), Sergio and me spent some time trying to get started with Dbus programming. We begun with a brief look at the Dbus Tutorial, which was an excellent place to start. However, we got stuck with some minor issues, like the need to manually start the session bus daemon using the dbus-launch program and the need to set a couple of environment variables in order to let our program connect to the bus.
Once we solved the above problems, we spent some more time before it worked properly, because we lacked one step when exporting an object using Dbus, which is to register the service name. This is done by using the org_freedesktop_DBus_request_name function.
Solved the above, all worked fine!. Next step will be to analyze how to substitute bacon-mesage-connection in Gedit with Dbus, but this will be another story ;).