aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2017-03-15 13:27:08 +0100
committerDavid Faure <faure@kde.org>2017-03-15 13:27:09 +0100
commite1fd748982dc5c335aa66766c62aa4e4d5d1bc6c (patch)
tree34604fac9db00b4ddc51dffdcb2568d54f33f87b /src
parentc5be11a789837095f587fadd684584b767e33ee9 (diff)
downloadkconfig-e1fd748982dc5c335aa66766c62aa4e4d5d1bc6c.tar.gz
kconfig-e1fd748982dc5c335aa66766c62aa4e4d5d1bc6c.tar.bz2
Remove unused QDateTime in KConfigBackend.
Spotted because it leads to race conditions due to tzset (surely a Qt bug, but anyway no point in finding out lastModified for nothing). While at it, remove the unused size field as well.
Diffstat (limited to 'src')
-rw-r--r--src/core/kconfigbackend.cpp22
-rw-r--r--src/core/kconfigbackend_p.h9
-rw-r--r--src/core/kconfigini.cpp6
3 files changed, 0 insertions, 37 deletions
diff --git a/src/core/kconfigbackend.cpp b/src/core/kconfigbackend.cpp
index 9d9fa47e..0c18f2c8 100644
--- a/src/core/kconfigbackend.cpp
+++ b/src/core/kconfigbackend.cpp
@@ -38,8 +38,6 @@ typedef QExplicitlySharedDataPointer<KConfigBackend> BackendPtr;
class KConfigBackendPrivate
{
public:
- qint64 size;
- QDateTime lastModified;
QString localFileName;
static QString whatSystem(const QString & /*fileName*/)
@@ -93,26 +91,6 @@ KConfigBackend::~KConfigBackend()
delete d;
}
-QDateTime KConfigBackend::lastModified() const
-{
- return d->lastModified;
-}
-
-void KConfigBackend::setLastModified(const QDateTime &dt)
-{
- d->lastModified = dt;
-}
-
-qint64 KConfigBackend::size() const
-{
- return d->size;
-}
-
-void KConfigBackend::setSize(qint64 sz)
-{
- d->size = sz;
-}
-
QString KConfigBackend::filePath() const
{
return d->localFileName;
diff --git a/src/core/kconfigbackend_p.h b/src/core/kconfigbackend_p.h
index 0a63a687..d2e3de4e 100644
--- a/src/core/kconfigbackend_p.h
+++ b/src/core/kconfigbackend_p.h
@@ -34,7 +34,6 @@ class KConfigBackendPrivate;
class KEntryMap;
class QFile;
class QByteArray;
-class QDateTime;
/**
* \class KConfigBackend kconfigbackend_p.h <KConfigBackend>
@@ -181,19 +180,11 @@ public:
*/
virtual bool isLocked() const = 0;
- /**
- * @return the date and time when the object was last modified
- */
- QDateTime lastModified() const;
/** @return the absolute path to the object */
QString filePath() const;
- /** @return the size of the object */
- qint64 size() const;
protected:
KConfigBackend();
- void setLastModified(const QDateTime &dt);
- void setSize(qint64 sz);
void setLocalFilePath(const QString &file);
private:
diff --git a/src/core/kconfigini.cpp b/src/core/kconfigini.cpp
index 49ec150f..a5ecc00d 100644
--- a/src/core/kconfigini.cpp
+++ b/src/core/kconfigini.cpp
@@ -600,14 +600,8 @@ void KConfigIniBackend::setFilePath(const QString &file)
const QFileInfo info(file);
if (info.exists()) {
setLocalFilePath(info.canonicalFilePath());
- setLastModified(info.lastModified());
- setSize(info.size());
} else {
setLocalFilePath(file);
- setSize(0);
- QDateTime dummy;
- dummy.setTime_t(0);
- setLastModified(dummy);
}
}