[Digikam-devel] [Bug 138540] Pictures files are updated (but not modified) when setting new metadatas albeit they are unset
Gilles Caulier
caulier.gilles at kdemail.net
Tue Dec 12 14:22:23 GMT 2006
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=138540
caulier.gilles kdemail net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
------- Additional Comments From caulier.gilles kdemail net 2006-12-12 15:22 -------
SVN commit 612751 by cgilles:
digikam from trunk : if file dir-path is read-only, do not try to save metadata on pictures.
BUG: 138540
M +11 -4 dmetadata.cpp
--- trunk/extragear/graphics/digikam/libs/dmetadata/dmetadata.cpp #612750:612751
@ -349,14 +349,21 @
bool DMetadata::save(const QString& filePath, DImg::FORMAT ff)
{
- // NOTE: see B.K.O #137770 : never touch the file if is read only.
- QFileInfo info(filePath);
- if (!info.isWritable())
+ // NOTE: see B.K.O #137770 & #138540 : never touch the file if is read only.
+ QFileInfo finfo(filePath);
+ QFileInfo dinfo(finfo.dirPath());
+ if (!finfo.isWritable())
{
- DDebug() << "File '" << info.fileName() << "' is read-only. Metadata not saved." << endl;
+ DDebug() << "File '" << finfo.fileName() << "' is read-only. Metadata not saved." << endl;
return false;
}
+ if (!dinfo.isWritable())
+ {
+ DDebug() << "Dir '" << finfo.filePath() << "' is read-only. Metadata not saved." << endl;
+ return false;
+ }
+
switch (ff)
{
case(DImg::JPEG):
More information about the Digikam-devel
mailing list