[Digikam-devel] [Bug 113914] Image permissions are restricted after saving.
Renchi Raju
renchi.raju at kdemail.net
Thu Oct 6 03:22:24 BST 2005
------- 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=113914
renchi.raju kdemail net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
------- Additional Comments From renchi.raju kdemail net 2005-10-06 04:22 -------
SVN commit 467716 by pahlibar:
preserve permissions when doing save/saveAs
BUGS: 113914
M +19 -1 imlibinterface.cpp
--- trunk/extragear/graphics/digikam/utilities/imageeditor/imlibinterface.cpp #467715:467716
@ -26,6 +26,9 @
extern "C"
{
#include <tiffio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
}
// C++ includes.
@ -99,6 +102,7 @
Imlib_Color_Modifier cmod;
Imlib_Load_Error errorRet;
QString filename;
+ mode_t filePermissions;
UndoManager* undoMan;
};
@ -189,6 +193,7 @
d->gamma = 1.0;
d->contrast = 1.0;
d->brightness = 0.0;
+ d->filePermissions = 0;
imlib_context_set_color_modifier(d->cmod);
imlib_reset_color_modifier();
@ -219,7 +224,14 @
}
}
- if (d->image) {
+ if (d->image)
+ {
+ struct stat stbuf;
+ if (::stat(QFile::encodeName(filename), &stbuf) == 0)
+ {
+ d->filePermissions = stbuf.st_mode;
+ }
+
imlib_context_set_image(d->image);
imlib_image_set_changes_on_disk();
@ -1007,6 +1019,12 @
return false; // Do not reload the file if saving failed !
}
+ // file saved. now preserve the permissions
+ if (d->filePermissions != 0)
+ {
+ ::chmod(QFile::encodeName(saveFile), d->filePermissions);
+ }
+
return true;
}
More information about the Digikam-devel
mailing list