skurfer/com.apple.Safari-qsplugin — comment on commit 119bb71d335b410bf4bd019b34f73ec414392389
File:  line 0
By pjrobertson:

Looks like it'd work, but I still think it's be simpler to do everything in a single getter method

so instead of doing

[self createSafariAndLaunch:NO]
[Safari isRunning]

or

[self createSafariAndLaunch:YES]
[Safari ...whatever]

you'd do:

[[self getSafariAndLaunch:NO] isRunning]

or

[[self getSafariAndLaunch:YES ..whatever]

The `(SafariApplication *)getSafariAndLaunch:(BOOL)launchSafari` method would look something like:

-(SafariApplication *)getSafariAndLaunch:(BOOL)launchSafari {
if(launchSafari || QSAppIsRunning(@"com.apple.Safari")) {
if(!Safari) {
Safari = [SBApplication do the stuff]
}
}
return Safari;
}

If not and you want to stick with this, I think the name of the `create...` method is a bit confusing. It's only going to *create* Safari once.