Bug 308465 - TimeAdjust cannot change file modification timestamp for files with non-ASCII characters in path
Summary: TimeAdjust cannot change file modification timestamp for files with non-ASCII...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Generic-TimeAdjust (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-15 22:51 UTC by Karol Slanina
Modified: 2018-09-22 08:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 3.0.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karol Slanina 2012-10-15 22:51:36 UTC
TimeAdjust is not able to change the file modification timestamps in case that the filesystem uses UTF-8 (or any non-ASCII or non-Latin1 encoding) and there's a file that has a non-ASCII character in its path. Timestamps for ASCII-only files can be successfully processed though. This bug does not affect timestamps in metadata such as EXIF, IPTC or XMP, which can be successfully modified for all files regardless of the characters in their names.

Reproducible: Always

Steps to Reproduce:
1. Create an image with a non-ASCII character in its name or path, e.g. "Besançon.jpg" or "Kraków.jpg"
2. Try to modify its file last modified timestamp via the TimeAdjust plugin
Actual Results:  
Files with non-ASCII characters cannot be processed (Status = "Failed to update file timestamp"), while files with ASCII only characters are updated successfully (Status = "Processed without error")

Expected Results:  
All files are processed successfully

TimeAdjust plugin assumes that all characters in the file path are encoded with Latin1 encoding:
if (utime(m_url.path().toLatin1().constData(), &times) != 0)

Instead of calling m_url.path().toLatin1().constData(), the conversion to const char* should be done by
QFile::encodeName(m_url.toLocalFile()).constData()
which respects the user's locale.
Comment 1 Smit Mehta 2012-10-16 13:49:28 UTC
Git commit 88341ba21071deeffe7dba1b453e5d6c37253389 by Smit Mehta.
Committed on 16/10/2012 at 15:46.
Pushed by smitmehta into branch 'master'.

Fix for changing file modification timestamp with files having non ASCII characters

M  +2    -1    NEWS
M  +1    -1    timeadjust/actionthread.cpp

http://commits.kde.org/kipi-plugins/88341ba21071deeffe7dba1b453e5d6c37253389