Here is the 7th opus of the slack-get development diary. There is a lot to say because I made lots of changes since the last diary.
1) The C++ API's first parts :
Since the last post where I was talking about this I added to the existing Slackget::Package and Slackget::PackageList 3 new classes : Slackget::Config, Slackget::Utils and Slackget::QSimpleUpdate.
Slackget::Config is used to represent slack-get's XML configuration file and Slackget::Utils contains some static utilitary methods.
Slackget::QSimpleUpdate is a Qt 4 widget. Its goal is to present a list of packages to users in the most simple way. It behave very simply by showing a list of items wich contains an image, a package name and its version. More informations about a package are available via the Qt's traditionnal tooltip system.
I plan in renaming Slackget::Utils to simply Slackget but I am not yet sure. I am not sure because I want to re-organize the C++ api's tree.
There is currently a trunk/src/ directory which contains QSimpleUpdate sources, and a trunk/lib/Cpp/ which contains the other classes.
More specifically, it contains the SlackgetCore module. I plan on modify this tree the following way :
trunk/lib/Cpp/SlackgetCore/src/ -> contains all source files for the SlackgetCore modules (currently : Slackget::Package, Slackget::PackageList, Slackget::Config and Slackget::Utils)
trunk/lib/Cpp/SlackgetCore/include/ -> contains all headers file for the SlackgetCore modules
trunk/lib/Cpp/SlackgetGui/src/ -> contains all source files for the SlackgetGui modules (currently : Slackget::QSimpleUpdate)... This module actually do not exists at the time I am writting this article

trunk/lib/Cpp/SlackgetGui/include/ -> contains all headers file for the SlackgetCore modules
And of course I want to delete the trunk/src/ directory.
I am indeed a big fan of the Qt 4 modular architecture. Talking about Qt 4, all parts of the slack-get C++ api links against Qt 4. SlackgetCore links against QtCore (for all the super handy data types) and, of course, SlackgetGui will links against QtGui.
2) The Perl API and sg_daemon :
Well... It changed a lot so I made a new release of Slackware::Slackget on CPAN ... And again it changed so much since then that I could make another release !
The medias variables system is one of the good examples. But the huge bugs in sg_daemon which was not managing media's host efficiently is the main cause of changes in the Perl API.
This bug (or bugs) was preventing the sg_daemon to switch from a media's host to the next one. I corrected this issue and it is now working as it should do.
The main changes in the Slackware::Slackget Perl module are :
* I changed Slackware::Slackget::Network::Connection behavior by replacing the host's constructor parameter by a media one (see modules documentation). I also added a next_host() method to this module. The goal is to take care of operations needed by the Connection.pm module (like parsing the URL and loading drivers).
* I fixed a little bug in Slackware::Slackget::Network::Connection::HTTP.pm (the file was moved to its final destination before all tests).
* I fixed a bug in Slackware::Slackget::Base and Slackware::Slackget::MediaList. The bug was very simple : I forgot to tell XML::Simple's parser to force array on all <li> elements. This result in a bug when there was only one element in a list.
* I also spent some time cleanning lots of code (removed unneccessary comments, comments unnecessary code, etc.).
* All this things result in a massive documentation's update.
* I finally made all needed changes in the sg_daemon (which is not part of the Perl API...) which is now handling well dead hosts and host changing.
The next focus points in the development are :
1 - Improve the C++ api (and particularly develop all classes needed to connect to a sg_daemon)
2 - Port the plugin system to the new daemon.
3 - Develop a real working GUI.
4 - Start coding the multi-daemon cooperative work.
Still a lot to do !
Enjoy !
Arnaud Dupuis
)



