From 2d23c1f1777b38d4b704872598ae6bf1ecd88db9 Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Tue, 7 Jan 2014 22:52:42 +0400 Subject: Xcode: Fix storyboard view Since commit 56831461 (Xcode: Use explicitFileType to mark source types, 2013-04-16) the Xcode generator prefers to use explicitFileType to tell Xcode about each source file type. This works better than lastKnownFileType for some file types, but not for "file.storyboard". If storyboard file has attribute 'explicitFileType' it is displayed incorrectly (as raw xml). Switch it back to 'lastKnownFileType'. --- Source/cmGlobalXCodeGenerator.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 381c1f5..eef49db 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -876,7 +876,10 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath( else { std::string sourcecode = GetSourcecodeValueFromFileExtension(ext, lang); - fileRef->AddAttribute("explicitFileType", + const char* attribute = (sourcecode == "file.storyboard") ? + "lastKnownFileType" : + "explicitFileType"; + fileRef->AddAttribute(attribute, this->CreateString(sourcecode.c_str())); } -- cgit v0.12 From 93fc5a53a6252e1ef14894b7e6eb8e69c20858b6 Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Tue, 7 Jan 2014 22:52:42 +0400 Subject: Xcode: Fix storyboard view Since commit 56831461 (Xcode: Use explicitFileType to mark source types, 2013-04-16) the Xcode generator prefers to use explicitFileType to tell Xcode about each source file type. This works better than lastKnownFileType for some file types, but not for "file.storyboard". If storyboard file has attribute 'explicitFileType' it is displayed incorrectly (as raw xml). Switch it back to 'lastKnownFileType'. --- Source/cmGlobalXCodeGenerator.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 0a2b32b..c181c59 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -877,8 +877,10 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath( } std::string sourcecode = GetSourcecodeValueFromFileExtension(ext, lang); - - fileRef->AddAttribute("explicitFileType", + const char* attribute = (sourcecode == "file.storyboard") ? + "lastKnownFileType" : + "explicitFileType"; + fileRef->AddAttribute(attribute, this->CreateString(sourcecode.c_str())); // Store the file path relative to the top of the source tree. -- cgit v0.12