Version: 0.8.0-beta2 (using KDE KDE 3.4.2) Installed from: Compiled From Sources OS: Linux After modifying and saving an image, permissions "rw-rw-rw" become "rw------" with the Image Editor and "rw-r--r-" with ShowFoto. Is it possible not to touch these permission after saving ?
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; }
I have tested this bug fix with the lastest SVN, permissions are now preserved after saving. Thank you.
Fixed by Renchi. Closed. Gilles