New: better logging of image bundle info in nib2cib.

If an image comes from a framework, the framework's bundle identifier is logged if it is available.
This commit is contained in:
Aparajita Fishman
2013-04-23 23:36:28 -04:00
parent 9cb2c758c7
commit 0b7e92aa53
+13 -7
View File
@@ -42,7 +42,8 @@ var FILE = require("file"),
_resourceName = [aCoder decodeObjectForKey:@"NSResourceName"];
var size = CGSizeMakeZero(),
framework = @"";
framework = @"",
bundleIdentifier = @"";
if (_resourceName == "NSSwitch")
return nil;
@@ -53,9 +54,7 @@ var FILE = require("file"),
}
else
{
var match = /^(.+)@(.+)$/.exec(_resourceName),
framework = @"",
bundleIdentifier = @"";
var match = /^(.+)@(.+)$/.exec(_resourceName);
if (match)
{
@@ -80,8 +79,6 @@ var FILE = require("file"),
{
_resourceName += FILE.extension(resourceInfo.path);
}
CPLog.debug(" Resource: %s\n Framework: %s\n Path: %s\n Size: %d x %d", _resourceName, framework, resourceInfo ? FILE.canonical(resourceInfo.path) : "", size.width, size.height);
}
if (resourceInfo && resourceInfo.path && resourceInfo.framework)
@@ -94,7 +91,16 @@ var FILE = require("file"),
}
_properties = @{ @"size":size, @"bundleIdentifier":bundleIdentifier, @"framework":framework };
}
CPLog.debug(" Resource: %s\n Framework: %s%s\n Path: %s\n Size: %d x %d",
_resourceName,
framework ? framework : "<none>",
bundleIdentifier ? " (" + bundleIdentifier + ")" :
framework ? " (<no bundle identifier>)" : "",
resourceInfo ? FILE.canonical(resourceInfo.path) : "",
size.width,
size.height);
}
return self;
}