mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #104556 from Ivorforce/string-extend-instead-of-parse
Use `append_` instead of `parse_` for `String` methods.
This commit is contained in:
commit
780cf03051
62 changed files with 245 additions and 274 deletions
|
|
@ -111,7 +111,7 @@ Vector<String> OS_MacOS::get_granted_permissions() const {
|
|||
NSURL *url = [NSURL URLByResolvingBookmarkData:bookmark options:NSURLBookmarkResolutionWithSecurityScope relativeToURL:nil bookmarkDataIsStale:&isStale error:&error];
|
||||
if (!error && !isStale) {
|
||||
String url_string;
|
||||
url_string.parse_utf8([[url path] UTF8String]);
|
||||
url_string.append_utf8([[url path] UTF8String]);
|
||||
ret.push_back(url_string);
|
||||
}
|
||||
}
|
||||
|
|
@ -333,7 +333,7 @@ String OS_MacOS::get_bundle_resource_dir() const {
|
|||
NSBundle *main = [NSBundle mainBundle];
|
||||
if (main) {
|
||||
NSString *resource_path = [main resourcePath];
|
||||
ret.parse_utf8([resource_path UTF8String]);
|
||||
ret.append_utf8([resource_path UTF8String]);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -345,7 +345,7 @@ String OS_MacOS::get_bundle_icon_path() const {
|
|||
if (main) {
|
||||
NSString *icon_path = [[main infoDictionary] objectForKey:@"CFBundleIconFile"];
|
||||
if (icon_path) {
|
||||
ret.parse_utf8([icon_path UTF8String]);
|
||||
ret.append_utf8([icon_path UTF8String]);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
|
@ -388,7 +388,7 @@ String OS_MacOS::get_system_dir(SystemDir p_dir, bool p_shared_storage) const {
|
|||
if (found) {
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(id, NSUserDomainMask, YES);
|
||||
if (paths && [paths count] >= 1) {
|
||||
ret.parse_utf8([[paths firstObject] UTF8String]);
|
||||
ret.append_utf8([[paths firstObject] UTF8String]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -652,7 +652,7 @@ String OS_MacOS::get_executable_path() const {
|
|||
return OS::get_executable_path();
|
||||
} else {
|
||||
String path;
|
||||
path.parse_utf8(pathbuf);
|
||||
path.append_utf8(pathbuf);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
|
@ -725,7 +725,7 @@ Error OS_MacOS::create_instance(const List<String> &p_arguments, ProcessID *r_ch
|
|||
NSString *nsappname = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
|
||||
if (nsappname != nil) {
|
||||
String path;
|
||||
path.parse_utf8([[[NSBundle mainBundle] bundlePath] UTF8String]);
|
||||
path.append_utf8([[[NSBundle mainBundle] bundlePath] UTF8String]);
|
||||
return create_process(path, p_arguments, r_child_id, false);
|
||||
} else {
|
||||
return create_process(get_executable_path(), p_arguments, r_child_id, false);
|
||||
|
|
@ -759,7 +759,7 @@ String OS_MacOS::get_unique_id() const {
|
|||
}
|
||||
|
||||
if (serial_number_ns_string) {
|
||||
serial_number.parse_utf8([serial_number_ns_string UTF8String]);
|
||||
serial_number.append_utf8([serial_number_ns_string UTF8String]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue