diff options
author | Damiano Galassi <[email protected]> | 2020-04-06 13:56:00 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2020-04-06 13:56:00 +0200 |
commit | 0dcc7cf1a5c986b17bc36c7309bfad46658d05de (patch) | |
tree | d167ad668fd8f0262f580049486e2e646e71d6fc /macosx | |
parent | 05ec6902e77d9ce7d4dc957440464ac96c026802 (diff) |
MacGui: don't recreate all the queue items urls from bookmarks at launch.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/HBJob.m | 22 | ||||
-rw-r--r-- | macosx/HBQueueController.m | 2 | ||||
-rw-r--r-- | macosx/HBQueueTableViewController.m | 17 | ||||
-rw-r--r-- | macosx/HBTitle.m | 7 |
4 files changed, 17 insertions, 31 deletions
diff --git a/macosx/HBJob.m b/macosx/HBJob.m index 669d059b5..b317088f4 100644 --- a/macosx/HBJob.m +++ b/macosx/HBJob.m @@ -453,28 +453,10 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification"; #ifdef __SANDBOX_ENABLED__ decodeObject(_fileURLBookmark, NSData) - - if (_fileURLBookmark) - { - _fileURL = [HBUtilities URLFromBookmark:_fileURLBookmark]; - } - - if (!_fileURL) - { - decodeObjectOrFail(_fileURL, NSURL); - } + decodeObjectOrFail(_fileURL, NSURL); decodeObject(_outputURLFolderBookmark, NSData) - - if (_outputURLFolderBookmark) - { - _outputURL = [HBUtilities URLFromBookmark:_outputURLFolderBookmark]; - } - - if (!_outputURL) - { - decodeObject(_outputURL, NSURL); - } + decodeObject(_outputURL, NSURL); #else decodeObjectOrFail(_fileURL, NSURL); decodeObject(_outputURL, NSURL); diff --git a/macosx/HBQueueController.m b/macosx/HBQueueController.m index f39a5883c..86654e19b 100644 --- a/macosx/HBQueueController.m +++ b/macosx/HBQueueController.m @@ -462,7 +462,7 @@ NSString * const HBQueueItemNotificationPathKey = @"HBQueueItemNotificationPathK if ([path isKindOfClass:[NSString class]] && path.length) { NSURL *fileURL = [NSURL fileURLWithPath:path]; - [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[fileURL]]; + [NSWorkspace.sharedWorkspace activateFileViewerSelectingURLs:@[fileURL]]; } } diff --git a/macosx/HBQueueTableViewController.m b/macosx/HBQueueTableViewController.m index f414ba625..e42a78aa3 100644 --- a/macosx/HBQueueTableViewController.m +++ b/macosx/HBQueueTableViewController.m @@ -126,7 +126,10 @@ currentIndex = [targetedRows indexGreaterThanIndex:currentIndex]; } - [NSWorkspace.sharedWorkspace activateFileViewerSelectingURLs:urls]; + if (urls.count) + { + [NSWorkspace.sharedWorkspace activateFileViewerSelectingURLs:urls]; + } } - (IBAction)revealSelectedQueueItemsSources:(id)sender @@ -141,7 +144,10 @@ currentIndex = [targetedRows indexGreaterThanIndex:currentIndex]; } - [NSWorkspace.sharedWorkspace activateFileViewerSelectingURLs:urls]; + if (urls.count) + { + [NSWorkspace.sharedWorkspace activateFileViewerSelectingURLs:urls]; + } } - (IBAction)revealSelectedQueueItemsActivityLogs:(id)sender @@ -159,7 +165,10 @@ currentIndex = [targetedRows indexGreaterThanIndex:currentIndex]; } - [NSWorkspace.sharedWorkspace activateFileViewerSelectingURLs:urls]; + if (urls.count) + { + [NSWorkspace.sharedWorkspace activateFileViewerSelectingURLs:urls]; + } } /** @@ -273,7 +282,7 @@ - (void)revealQueueItem:(nonnull HBQueueItem *)item { - [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[item.completeOutputURL]]; + [NSWorkspace.sharedWorkspace activateFileViewerSelectingURLs:@[item.completeOutputURL]]; } #pragma mark NSTableView delegate diff --git a/macosx/HBTitle.m b/macosx/HBTitle.m index 3a728a4ef..3591a4df8 100644 --- a/macosx/HBTitle.m +++ b/macosx/HBTitle.m @@ -229,12 +229,7 @@ fail: if (_bookmark) { - _fileURL = [HBUtilities URLFromBookmark:_bookmark]; - - if (!_fileURL) - { - decodeObjectOrFail(_fileURL, NSURL); - } + decodeObjectOrFail(_fileURL, NSURL); } #else decodeObject(_fileURL, NSURL); |