diff options
Diffstat (limited to 'src/gvcore/timeutils.cpp')
-rw-r--r-- | src/gvcore/timeutils.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gvcore/timeutils.cpp b/src/gvcore/timeutils.cpp index c917232..75dd41f 100644 --- a/src/gvcore/timeutils.cpp +++ b/src/gvcore/timeutils.cpp @@ -25,17 +25,22 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <tdefilemetainfo.h> #include <tdeglobal.h> #include <tdelocale.h> - + +// Local +#include "fileviewconfig.h" + namespace Gwenview { namespace TimeUtils { time_t getTime(const KFileItem* item) { - const KFileMetaInfo& info = item->metaInfo(/*autogen=*/false); - if (info.isValid()) { - TQVariant value = info.value("Date/time"); - TQDateTime dt = value.toDateTime(); - if (dt.isValid()) { - return dt.toTime_t(); + + if (FileViewConfig::loadMetadata()) { + const KFileMetaInfo& info = item->metaInfo(/*autogen=*/false); + if (info.isValid()) { + TQDateTime dt = info.value("Date/time").toDateTime(); + if (dt.isValid()) { + return dt.toTime_t(); + } } } return item->time(TDEIO::UDS_MODIFICATION_TIME); |