COMP: Fix [-Wconversion-null] in qSlicerScriptedFileWriter.cxx

git-svn-id: http://svn.slicer.org/Slicer4/branches/Slicer-4-3@22565 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix qSlicerUtilsTest1

Following Qt 4.8.1, setting permission on a folder with a parent folder
not being executable leads to an error.

As it should always have:

$ mkdir bar/foo
$ chmod u-x bar
$ chmod u-x bar/foo
chmod: cannot access ‘bar/foo’: Permission denied

This commit implement the correct behavior by setting flags in the
right order depending if Executable but is passed or not.

Since it is not possible to change permission of directory without executable
bit set to off, if flag "with executable bit off" is recursively set to
path /a/b/c/d, permission should be set to d, c, b and then a.

[1] and probably 4.8.0 but this hasn't been tested.

git-svn-id: http://svn.slicer.org/Slicer4/branches/Slicer-4-3@22566 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix qSlicerExtensionsManagerModelTest.testExtractExtensionArchive

By using QFile static function each time permission are set/get, we
ensure that the permissions of the file are fully re-stated [1]. Indeed,
internally it create a QFile object for each call.

Doing so fix the test ensuring the call to:

  QFile(this->Tmp.absolutePath()).permissions() & QFile::WriteUser)

returns the expected value just after permission has been set.

This is a know Qt issue. See https://bugreports.qt-project.org/browse/QTBUG-7211

[1] http://en.wikipedia.org/wiki/Stat_%28system_call%29

git-svn-id: http://svn.slicer.org/Slicer4/branches/Slicer-4-3@22567 3bd1e089-480b-0410-8dfb-8563597acbee