Hi all,
  I hope I won't annoy you too much if I shortly introduce myself. :-)
I'm a developer from the Nokia Accounts&SSO team, which developed the libaccounts and libsignon components now available in MeeGo core. Unfortunately so far we have not been active in the MeeGo (and earlier, Maemo) community, that's why I don't expect many people here to know what Accounts&SSO is about; but I hope this is going to change, and with time (and public docs) we'll eventually get to present us better.

The development in the Accounts & SSO (Single Sign On) components is still mostly driven by Nokia, but the git repositories are open [0] and we should soon have our bugzilla component.


Now, to the point. Our current APIs in libaccounts-glib and libaccounts-qt for accessing account service settings could be much simpler to use than how they are now, so I've sketched some API of a new AccountService class and I'd like to be informed of any dislike, before we start implementing it.

For those who don't know the current API: our Account object holds all the settings for an account; there are some global settings (such as username, display name) and service-specific settings (for e-mail, IM, calendar,...) which are all accessible on the same Account object, by first selecting the service one needs to work with. In pseudo-code, this shows like this:

========
// get the username from the global settings
username = account->value("username");
enabled = account->enabled();

// get some e-mail settings
account->selectService(Service("gmail"));
imapServer = account->value("server");
imapPort = account->value("port");
emailEnabled = account->enabled();

// get some IM settings
account->selectService(Service("google-talk"));
jabberServer = account->value("server");
jabberPort = account->value("port");
imEnabled = account->enabled();
========

This approach carries the risk that if clients forget calling selectService(), they can easily get wrong data out of the account.

The new proposed classes for libaccounts-glib [1] and libaccounts-qt [2] aim at solving this, by introducing an AccountService object which represents an account configuration always selected on the given service:

========
accountService = new AccountService(account, Service("gmail"));
imapServer = accountService->value("server");
imapPort = accountService->value("port");
// the next line returns true only if the account is enabled *and* the
// "gmail" service is enabled on it
emailEnabled = accountService->enabled();
========

Feel free to add your comments on the gitorious web interface or here in the mailing-list.

Ciao,
  Alberto

[0] http://gitorious.org/accounts-sso
[1] http://gitorious.org/accounts-sso/accounts-glib/commit/2f4c9f9f8e0bb822068e959c44cfb493356af9ab [2] http://gitorious.org/accounts-sso/accounts-qt/commit/aa8ebd500175e8bc14aaaaa195c6119365c2e22c

--
http://blog.mardy.it <- geek in un lingua international!
_______________________________________________
MeeGo-dev mailing list
[email protected]
http://lists.meego.com/listinfo/meego-dev

Reply via email to