Skip to content
Snippets Groups Projects
Commit 5330455e authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Fix more deprecation

parent ffdc82db
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,5 @@ ...@@ -32,6 +32,5 @@
//Why? Because BOOL //Why? Because BOOL
void setCrashUserMetadataWrapper(const std::string& userid, const std::string& username); void setCrashUserMetadataWrapper(const std::string& userid, const std::string& username);
void launchApplication(const std::string* app_name, const std::vector<std::string>* args);
#endif // LL_LLAPPVIEWERMACOSX_OBJC_H #endif // LL_LLAPPVIEWERMACOSX_OBJC_H
...@@ -46,44 +46,3 @@ void setCrashUserMetadataWrapper(const std::string& userid, const std::string& u ...@@ -46,44 +46,3 @@ void setCrashUserMetadataWrapper(const std::string& userid, const std::string& u
[SentrySDK setUser:user]; [SentrySDK setUser:user];
#endif #endif
} }
void launchApplication(const std::string* app_name, const std::vector<std::string>* args)
{
@autoreleasepool
{
if (app_name->empty()) return;
NSMutableString* app_name_ns = [NSMutableString stringWithString:[[NSBundle mainBundle] resourcePath]]; //Path to resource dir
[app_name_ns appendFormat:@"/%@", [NSString stringWithCString:app_name->c_str()
encoding:[NSString defaultCStringEncoding]]];
NSMutableArray *args_ns = [[NSMutableArray alloc] init];
for (int i=0; i < args->size(); ++i)
{
NSLog(@"Adding string %s", (*args)[i].c_str());
[args_ns addObject:
[NSString stringWithCString:(*args)[i].c_str()
encoding:[NSString defaultCStringEncoding]]];
}
NSTask *task = [[NSTask alloc] init];
NSBundle *bundle = [NSBundle bundleWithPath:[[NSWorkspace sharedWorkspace] fullPathForApplication:app_name_ns]];
@try {
[task setLaunchPath:[bundle executablePath]];
}
@catch (NSException *theException) {
NSLog(@"Caught a %@ exception, bailing.", theException);
return;
}
[task setArguments:args_ns];
[task launch];
// NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
// NSURL *url = [NSURL fileURLWithPath:[workspace fullPathForApplication:app_name_ns]];
//
// NSError *error = nil;
// [workspace launchApplicationAtURL:url options:0 configuration:[NSDictionary dictionaryWithObject:args_ns forKey:NSWorkspaceLaunchConfigurationArguments] error:&error];
//TODO Handle error
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment