[Kde-games-devel] Bug or feature? Making write protection in Palapeli work on Windows

Parker Coates parker.coates at gmail.com
Tue Dec 8 18:37:12 CET 2009


On Tue, Dec 8, 2009 at 12:16, Stefan Majewsky wrote:
> Hi,
>
> Patrick Spendrin of kde-windows fame approached me a week ago that it is not
> nice how I implement write protection in Palapeli.
>
> Currently, Palapeli uses the file permissions to determine whether a puzzle
> may be deleted or not. Consequently, the write flags are not set for the
> default puzzles (during install time). Patrick informed me that this might
> likely break on Windows, and it is also not usual to use the PERMISSIONS
> syntax in CMake's install() directive.
>
> Attached is a patch that changes the write protection mechanism: Instead of
> checking the file permissions, Palapeli will forbid to delete any puzzle that
> has the new "Collection/ModifyProtection" flag set. This patch
>
> 1. is backward-compatible: Older Palapeli versions will simply ignore this
> flag.
>
> 2. is forward-compatible, in the sense that the update doesn't break anything:
> The metadata cache in palapeli-collectionrc will be rewritten because the
> puzzles have changed, and the new flag will be set accordingly.
>
> 3. does not introduce any new i18n strings.
>
> However, I'm not sure whether this is a bug or a feature, i.e. whether I may
> commit that to trunk now. Advice?

I think depending on file system permissions can be easily considered
a bug, as it broke things on Windows and this change definitely isn't
a feature, as it isn't user visible. If the existing implementation
wasn't broken, then I would say hold off until 4.5, but it is broken,
so commit it as soon as possible.

Parker


More information about the kde-games-devel mailing list