On Friday 30 March 2007 20:04:47 Lubos Lunak wrote: > On st 28. března 2007, David Jarvie wrote: > > I want to implement a kded module to read system time zone information, > > as was previously suggested on this list. > > That's http://lists.kde.org/?l=kde-core-devel&m=115884044529385&w=2 , for > those who don't remember anymore. Yes, I'd forgotten it was your suggestion. :( > > - Where/how should the kded module store the data it reads? It needs to > > be accessible via KSystemTimeZone. The data is basically fixed - any > > changes would be very infrequent - should it be stored in ksycoca? > > IIRC the data to store are the name of the local zone and some info about > each timezone, right? The local zone name can go e.g. in kdeglobals or a > separate config file (together with some timestamp(s) for avoiding doing > anything when nothing has changed). > > As for storing timezone data, I suppose that's up to you :) and it > probably depends on the data you want to store. If everything from > /usr/share/zoneinfo is needed (that's 900k here :-/ ) and you want to do it > a simple way, then I have a class for writing a complete directory > structure into a single file and classes for accessing them > (QDir::entryList()-like listing and a function returning contents as > QByteArray) - it's for Qt3/KDE3 now though. The only data which needs to be cached is the local zone identity and on Solaris the time zone index data equivalent to zone.tab. I don't think that there's any need to cache zoneinfo data other than avoiding reading it more often than necessary during a session. > > - On some systems, a parsed copy of one of the system time zone files > > should ideally be stored in the system-wide KDE data directory so as to > > avoid having to re-parse the system file at session start. How can the > > location of this directory be accessed? KStandardDirs doesn't seem to > > provide this information except as one in a list of data directories, > > which is ambiguous. > > System-wide may be a bit problematic because of access rights and such > stuff. Maybe there could be a setuid (setuid nobody?) helper that'd create > the file, not that I'm really an expert on such things. > > For storing it per-user it'd be the "cache" KStandardDirs resource. I suppose doing it once per user isn't too much of an overhead. Thanks for your help in answering these questions. :) -- David Jarvie. KAlarm author and maintainer. http://www.astrojar.org.uk/kalarm