Skip to content

Commit

Permalink
Merge branch 'paracycle-feature/accept-non-file-uris'
Browse files Browse the repository at this point in the history
  • Loading branch information
julienXX committed May 27, 2014
2 parents d3fe4a3 + 21065dc commit 7bd8ac5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Terminal Notifier/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,12 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification;

- (NSImage*)getImageFromURL:(NSString *) url;
{
if(!contains(url, @"file://")){ // Prefix file:// if not present
NSURL *imageURL = [NSURL URLWithString:url];
if([[imageURL scheme] length] == 0){
// Prefix 'file://' if no scheme
url = [NSString stringWithFormat:@"%@%@", @"file://", url];
imageURL = [NSURL URLWithString:url];
}
NSURL *imageURL = [NSURL URLWithString:url];
return [[NSImage alloc] initWithContentsOfURL:imageURL];
}

Expand Down

0 comments on commit 7bd8ac5

Please sign in to comment.