summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2012-07-31 14:34:05 (GMT)
committerChristian Mollekopf <chrigi_1@fastmail.fm>2012-07-31 14:34:05 (GMT)
commit54f68ec7841179659ae311a680063c0e986d8f57 (patch)
tree52caf8baa235fa7957cc0638fdfbc239e76e0553
parent744ba7fda608f630df8b4985b0df87fbc7570e94 (diff)
downloadlibcalendaring-54f68ec7841179659ae311a680063c0e986d8f57.tar.gz
Remvoe the dependency on the ktimezonedrc configfile and hardcode the required information.
-rw-r--r--kdecore/date/ksystemtimezone.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/kdecore/date/ksystemtimezone.cpp b/kdecore/date/ksystemtimezone.cpp
index cdb71fb..ff66297 100644
--- a/kdecore/date/ksystemtimezone.cpp
+++ b/kdecore/date/ksystemtimezone.cpp
@@ -342,6 +342,18 @@ kDebug(161)<<"instance(): ... initialised";
void KSystemTimeZonesPrivate::readConfig(bool init)
{
+#ifdef KDE_NO_TIMEZONED
+ if (QFile(QLatin1String("/usr/share/zoneinfo/zone.tab")).exists()) {
+ m_zoneinfoDir = QLatin1String("/usr/share/zoneinfo");
+ m_zonetab = QLatin1String("/usr/share/zoneinfo/zone.tab");
+ } else if (QFile(QLatin1String("/usr/lib/zoneinfo/zone.tab")).exists()) {
+ m_zoneinfoDir = QLatin1String("/usr/lib/zoneinfo");
+ m_zonetab = QLatin1String("/usr/lib/zoneinfo/zone.tab");
+ } else {
+ kError(161) << "No time zone information obtained, could not find zone.tab";
+ }
+ m_localZoneName = QLatin1String("UTC");
+#else
KConfig config(QLatin1String("ktimezonedrc"));
if (!init)
config.reparseConfiguration();
@@ -354,6 +366,7 @@ void KSystemTimeZonesPrivate::readConfig(bool init)
m_zoneinfoDir = group.readEntry("ZoneinfoDir");
m_zonetab = group.readEntry("Zonetab");
m_localZoneName = group.readEntry("LocalZone");
+#endif
if (m_zoneinfoDir.length() > 1 && m_zoneinfoDir.endsWith(QLatin1Char('/')))
m_zoneinfoDir.truncate(m_zoneinfoDir.length() - 1); // strip trailing '/'
if (!init)