diff options
author | Alexander Golubev <[email protected]> | 2024-02-21 00:11:00 +0300 |
---|---|---|
committer | Alexander Golubev <[email protected]> | 2024-02-21 05:50:59 +0300 |
commit | 13d26b59848dce276051f8f322bf82d291aa0c23 (patch) | |
tree | 4d80ac84406936fdbc4495fcc8d4f6b5c333fe0e /src/gvcore/timeutils.cpp | |
parent | 985d8126df0c00fb0a04b57f7a92acd9952d369e (diff) | |
download | gwenview-13d26b59848dce276051f8f322bf82d291aa0c23.tar.gz gwenview-13d26b59848dce276051f8f322bf82d291aa0c23.zip |
Make metadata loading optional
See: https://mirror.git.trinitydesktop.org/gitea/TDE/gwenview/issues/17#issuecomment-44076
Signed-off-by: Alexander Golubev <[email protected]>
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); |