[Gpe-list] Rationalising tasks databases

Matthew Palmer mpalmer at hezmatt.org
Wed Jan 3 04:17:20 CET 2007


On Wed, Jan 03, 2007 at 01:32:32AM +0100, Florian Boor wrote:
> Matthew Palmer schrieb:
> > The first thing to do is to rationalise the databases, so that the timesheet
> > tasks can be stored in the tododb.  As far as I can tell, the only database
> > field that's missing from the tododb when compared to the timesheet db is
> > the parent task ID.  This seems like a fairly simple change to make to
> > libtododb.
> 
> That's good - another thing we get for free with this is a proper database
> abstraction for gpe-timesheet so that the database backend isn't part of
> application itself any more once it uses libtododb.

There'll still be -- at least at first -- direct reference to the log table,
but that's (a) not such a huge problem, and (b) possible to abstract out
later.

> > My intent is to make this change in the libtododb code.  However, to do this
> > I'll need to change the todo_item struct.  It's been a while since I've
> > hacked much C, but I'm fairly certain that changing this struct will
> > incompatibly change the library ABI -- which, if I'm not mistaken, requires
> > a SONAME change.  Except I can't see anywhere to change the SONAME.  Could
> > someone point out what I'm missing here?
> 
> You can get the SONAME version information to the linker in this way:
> libtododb_la_LDFLAGS = ... -version-info 1:0:0

Shiny.  Didn't know that.

> So its just a small modification in Makefile.am. It might be worth to think
> about defining a variable for this.

Perchaps.  Depends on how abstract we want to get -- with a simple
Makefile.am like libtododb has, it probably isn't worth it.

At any rate, I've taken to following Neal's suggestion of trying to
generalise libeventdb, if reasonable, to make libtododb effectively
unnecessary.

> > Once the tododb handles hierarchical tasks, I'll need to modify the
> > timesheet app to use the tododb, and migrate the timesheet tasks to the
> > tododb and fix the task IDs in the log.  Does anyone have any suggestions
> > for how to do the data migration -- not so much the mechanics of the actual
> > transformation (which I'll work out in code), but the mechanics of the
> > higher-level stuff -- *when* to do the translation (automatically,
> > click-a-button, at package upgrade time, or what?).
> 
> I'd do this automatically on application startup. You just need to store some
> database version information or another flag that indicates that you migrated
> the data already and check this on application start.

Since asking about this, I've found all sorts of code in various databases
that shows how most apps do it -- database version tables and upgrade
scripts.  It's all a bit ad-hoc, and it would be/have been nice to have an
abstraction for the migration logic, but at least I know how it's commonly
done and can follow that pattern in my own changes.

> > Modifying the timesheet app seems... trickier than I first thought. There
> > appears to be some support for linking timesheet tasks with todo tasks, but
> > it seems mostly hidden behind '#ifdef HILDON' stuff.  Am I right in thinking
> > that Hildon is something for the Nokia 770?  At any rate, I think that some
> > of that stuff needs rethinking -- either to merge the Hildon and regular UI
> > stuff, or just get rid of the distinction between todo tasks and timesheet
> > tasks.  I'm not about to start making UI decisions, though, so I'd
> > appreciate some guidance from people who know as to which way to rewrite
> > this thing.
> 
> I think i can help with this a little bit. In theory the features of the UI in
> Hildon should be the same like with plain GTK - no idea where the difference
> comes from. The code specific for Hildon should be quite limited and is mostly
> related to using some special widgets or following different UI guidelines.

*cough*svn8906::base/gpe-timesheet/ui.c:679-744*cough*

I realise *why* there is the #ifdefs (although #else would have been better
than an #ifndef/#ifdef pair), but unless the Hildon UI widgets are *very*
strange, the Hildon UI is completely different to the standard GPE one --
the Hildon has all sorts of support for showing timesheet tasks and
non-timesheet tasks.

What concerns me is that I'm going to go blundering through there, make some
hideous change, and have the Maemo people put out a contract on me.  <grin>

- Matt

-- 
"People can be divided into three classes: The few who make things happen,
the many who watch things happen, and the overwhelming majority who have no
ides what has happened."  (Author unknown)



More information about the Gpe-list mailing list