KDECore
ksystemtimezone.cpp
Go to the documentation of this file.
22 // This file requires HAVE_STRUCT_TM_TM_ZONE to be defined if struct tm member tm_zone is available.
185 dbus.connect(QString(), QString(), dbusIface, QLatin1String("configChanged"), this, SLOT(configChanged()));
186 dbus.connect(QString(), QString(), dbusIface, QLatin1String("zonetabChanged"), this, SLOT(zonetabChanged(QString)));
188 //dbus.connect(QString(), QString(), dbusIface, QLatin1String("definitionChanged"), this, SLOT(zoneDefinitionChanged(QString)));
301 if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(QLatin1String("org.kde.kded")))
304 QDBusInterface *ktimezoned = new QDBusInterface(QLatin1String("org.kde.kded"), QLatin1String("/modules/ktimezoned"), dbusIface);
308 kError(161) << "KSystemTimeZones: ktimezoned initialize() D-Bus call failed: " << reply.error().message() << endl;
485 const KTzfileTimeZone tz(tzfileSource(), tokens[2], tokens[0], latitude, longitude, (n > 3 ? tokens[3] : QString()));
546 KSystemTimeZoneBackend::KSystemTimeZoneBackend(KSystemTimeZoneSource *source, const QString &name,
564 int KSystemTimeZoneBackend::offsetAtZoneTime(const KTimeZone *caller, const QDateTime &zoneDateTime, int *secondOffset) const
633 int KSystemTimeZoneBackend::offsetAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const
668 bool KSystemTimeZoneBackend::isDstAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const
696 : KTimeZone(new KSystemTimeZoneBackend(source, name, countryCode, latitude, longitude, comment))
722 static QByteArray originalTZ; // saved value of TZ environment variable during multiple parse() calls
static bool isSimulated()
Check whether there is a simulated local system time zone.
Definition: ksystemtimezone.cpp:219
int minute() const
static bool isTimeZoneDaemonAvailable()
Return whether the KDE time zone daemon, ktimezoned, appears to be available and working.
Definition: ksystemtimezone.cpp:234
KSystemTimeZone(KSystemTimeZoneSource *source, const QString &name, const QString &countryCode=QString(), float latitude=UNKNOWN, float longitude=UNKNOWN, const QString &comment=QString())
Creates a time zone.
Definition: ksystemtimezone.cpp:694
virtual ~KSystemTimeZoneData()
Definition: ksystemtimezone.cpp:830
virtual QByteArray abbreviation(const QDateTime &utcDateTime) const
Returns the time zone abbreviation current at a specified time.
Definition: ksystemtimezone.cpp:852
static KTimeZone zone(const QString &name)
Returns the time zone with the given name.
Definition: ksystemtimezone.cpp:255
Definition: kmacroexpander_unix.cpp:34
Base class for the parsed data returned by a KTimeZoneSource class.
Definition: ktimezone.h:1302
#define K_GLOBAL_STATIC(TYPE, NAME)
This macro makes it easy to use non-POD types as global statics.
Definition: kglobal.h:221
static QStringList listTimeZones()
Static helper method that lists all availalbe timezones on the system as per the information in the W...
Definition: ktimezone_win.cpp:687
virtual KTimeZoneData * clone() const
Creates a new copy of this object.
Definition: ksystemtimezone.cpp:842
bool isEmpty() const
void setFileName(const QString &name)
static const KTimeZones::ZoneMap zones()
Returns all the time zones defined in this collection.
Definition: ksystemtimezone.cpp:250
static QString zoneinfoDir()
Returns the location of the system time zone zoneinfo database.
Definition: ksystemtimezone.cpp:228
QString message() const
QTime time() const
bool isValid() const
QDBusConnection sessionBus()
The KSystemTimeZoneWindows class represents a time zone defined in the Windows registry.
Definition: ktimezone_win.h:77
static void setLocalZone(const KTimeZone &tz)
Set or clear the simulated local system time zone.
Definition: ksystemtimezone.cpp:211
int month() const
The KTimeZones class represents a time zone database which consists of a collection of individual tim...
Definition: ktimezone.h:308
QDBusMessage call(const QString &method, const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8)
int second() const
static KTimeZones * timeZones()
Returns the unique KTimeZones instance containing the system time zones collection.
Definition: ksystemtimezone.cpp:240
friend class KSystemTimeZonesPrivate
Definition: ksystemtimezone.h:257
const char * name() const
KSystemTimeZoneData & operator=(const KSystemTimeZoneData &)
Assignment; no special ownership assumed.
Definition: ksystemtimezone.cpp:835
int count(const T &value) const
static time_t toTime_t(const QDateTime &utcDateTime)
Converts a UTC QDateTime to a UTC time, measured in seconds since 00:00:00 UTC 1st January 1970 (as r...
Definition: ktimezone.cpp:934
QByteArray type() const
Returns the class name of the data represented by this instance.
Definition: ktimezone.cpp:639
static KTimeZone readZone(const QString &name)
Returns the time zone with the given name, containing the full time zone definition read directly fro...
Definition: ksystemtimezone.cpp:245
virtual bool isDstAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const
Implements KSystemTimeZone::isDstAtUtc().
Definition: ksystemtimezone.cpp:668
QByteArray & prepend(char ch)
int toInt(bool *ok, int base) const
bool isEmpty() const
virtual bool isDst(const KTimeZone *caller, time_t t) const
Implements KSystemTimeZone::isDst().
Definition: ksystemtimezone.cpp:673
The KTzfileTimeZone class represents a time zone defined in tzfile(5) format.
Definition: ktzfiletimezone.h:50
int day() const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
KSystemTimeZoneBackend(KSystemTimeZoneSource *source, const QString &name, const QString &countryCode, float latitude, float longitude, const QString &comment)
Implements KSystemTimeZone::KSystemTimeZone().
Definition: ksystemtimezone.cpp:546
virtual QList< int > utcOffsets() const
Returns the complete list of UTC offsets for the time zone.
Definition: ksystemtimezone.cpp:888
static KTimeZone local()
Returns the current local system time zone.
Definition: ksystemtimezone.cpp:195
int year() const
bool updateBase(const KTimeZone &other)
Update the definition of the time zone to be identical to another KTimeZone instance.
Definition: ktimezone.cpp:773
virtual QList< QByteArray > abbreviations() const
Returns the complete list of time zone abbreviations.
Definition: ksystemtimezone.cpp:847
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
A class to read and parse system time zone data.
Definition: ksystemtimezone.h:441
int hour() const
A class to read and parse the timezone information from the Windows registry.
Definition: ktimezone_win.h:43
static KTimeZone realLocalZone()
Return the real (not simulated) local system time zone.
Definition: ksystemtimezone.cpp:205
Qt::TimeSpec timeSpec() const
virtual ~KSystemTimeZoneSource()
Definition: ksystemtimezone.cpp:739
virtual void close()
QStringList perlSplit(const QString &sep, const QString &s, int max=0)
Split a QString into a QStringList in a similar fashion to the static QStringList function in Qt...
Definition: kstringhandler.cpp:89
virtual int offsetAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const
Implements KSystemTimeZone::offsetAtUtc().
Definition: ksystemtimezone.cpp:633
uint toTime_t() const
~KSystemTimeZoneBackend()
Definition: ksystemtimezone.cpp:551
bool isValid() const
static void startParseBlock()
Use in conjunction with endParseBlock() to improve efficiency when calling parse() for a group of KSy...
Definition: ksystemtimezone.cpp:762
QString mid(int position, int n) const
QDate date() const
virtual KTimeZoneData * parse(const KTimeZone &zone) const
Extract detailed information for one time zone, via the system time zone library functions.
Definition: ksystemtimezone.cpp:744
virtual QByteArray type() const
Returns the class name of the data represented by this instance.
Definition: ksystemtimezone.cpp:559
int length() const
QString fromLatin1(const char *str, int size)
int indexOf(const QRegExp &rx, int from) const
virtual KTimeZoneBackend * clone() const
Creates a copy of this instance.
Definition: ksystemtimezone.cpp:554
virtual int offsetAtZoneTime(const KTimeZone *caller, const QDateTime &zoneDateTime, int *secondOffset) const
Implements KSystemTimeZone::offsetAtZoneTime().
Definition: ksystemtimezone.cpp:564
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)
const QDBusError & error()
virtual int offset(const KTimeZone *caller, time_t t) const
Implements KSystemTimeZone::offset().
Definition: ksystemtimezone.cpp:638
static KTimeZone utc()
Returns a standard UTC time zone, with name "UTC".
Definition: ktimezone.cpp:911
The KSystemTimeZones class represents the system time zone database, consisting of a collection of in...
Definition: ksystemtimezone.h:94
TZFILE time zone functions.
A class to read and parse tzfile time zone definition files.
Definition: ktzfiletimezone.h:138
static OrgKdeKLauncherInterface * klauncher()
Returns the D-Bus interface of the service launcher.
QByteArray toUtf8() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.