ENH: Update code to be independent of KWSys function signature changes
Future version of VTK depends on a more recent version of KWSys changing
signatures of function like SystemTools::FileIsDirectory to accept only
a "std::string" instead of a "const char". This commit anticipates
build error like the one reported below by either depending on Qt/CTK API
where possible and/or providing a "const char" instead of "QByteArray*"
that can be implicitly converted to a "std::string".
The KWSYS commits introducing these changes are:
kitware/KWSys@6cc2451
kitware/KWSys@f3fb01c
kitware/KWSys@0dfbe56
kitware/KWSys@4690fc8
kitware/KWSys@9927862
kitware/KWSys@e9204f8
kitware/KWSys@d2dbff0
kitware/KWSys@4b409aa
kitware/KWSys@84db9ee
kitware/KWSys@2c2f660
kitware/KWSys@153f6df
kitware/KWSys@b07b5fc
Example of build error:
/path/to/Slicer/Base/QTCore/qSlicerSceneBundleReader.cxx: In member function ‘virtual bool qSlicerSceneBundleReader::load(const IOProperties&)’:
/path/to/Slicer/Base/QTCore/qSlicerSceneBundleReader.cxx:80:65: error: no matching function for call to ‘vtksys::SystemTools::FileIsDirectory(QByteArray)’
if (vtksys::SystemTools::FileIsDirectory(unpackPath.toLatin1()))
^
/path/to/Slicer/Base/QTCore/qSlicerSceneBundleReader.cxx:80:65: note: candidate is:
In file included from /path/to/Slicer/Base/QTCore/qSlicerSceneBundleReader.cxx:39:0:
/path/to/Slicer-SuperBuild-Debug/VTKv6-build/Utilities/KWSys/vtksys/SystemTools.hxx:633:15: note: static bool vtksys::SystemTools::FileIsDirectory(const string&)
static bool FileIsDirectory(const kwsys_stl::string& name);
^
/path/to/Slicer-SuperBuild-Debug/VTKv6-build/Utilities/KWSys/vtksys/SystemTools.hxx:633:15: note: no known conversion for argument 1 from ‘QByteArray’ to ‘const string& {aka const std::basic_string<char>&}’
/path/to/Slicer/Base/QTCore/qSlicerSceneBundleReader.cxx:82:70: error: no matching function for call to ‘vtksys::SystemTools::RemoveADirectory(QByteArray)’
if ( !vtksys::SystemTools::RemoveADirectory(unpackPath.toLatin1()) )
git-svn-id: http://svn.slicer.org/Slicer4/trunk@23886 3bd1e089-480b-0410-8dfb-8563597acbee |