Mark some classes as final.
This commit is contained in:
40 files changed
+51
-55
No files matched your search
@@ -8,7 +8,7 @@
|
||||
import Cocoa
|
||||
import MP42Foundation
|
||||
|
||||
class ActivityWindowController : NSWindowController, MP42Logging {
|
||||
final class ActivityWindowController : NSWindowController, MP42Logging {
|
||||
|
||||
@IBOutlet var logView: NSTextView!
|
||||
let logger: Logger
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Cocoa
|
||||
import MP42Foundation
|
||||
|
||||
class DocumentController : NSDocumentController {
|
||||
final class DocumentController : NSDocumentController {
|
||||
|
||||
override func openDocument(withContentsOf url: URL, display displayDocument: Bool, completionHandler: @escaping (NSDocument?, Bool, Error?) -> Void) {
|
||||
let ext = url.pathExtension.lowercased()
|
||||
@@ -36,7 +36,7 @@ class DocumentController : NSDocumentController {
|
||||
}
|
||||
|
||||
@NSApplicationMain
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
final class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
|
||||
private static func appSupportURL() -> URL {
|
||||
let fileManager = FileManager.default
|
||||
|
||||
@@ -284,7 +284,7 @@ class CollectionView : NSCollectionView {
|
||||
}
|
||||
|
||||
|
||||
class ArtworkSelectorController: NSWindowController, NSCollectionViewDataSource, NSCollectionViewDelegate, ArtworkImageObjectDelegate {
|
||||
final class ArtworkSelectorController: NSWindowController, NSCollectionViewDataSource, NSCollectionViewDelegate, ArtworkImageObjectDelegate {
|
||||
|
||||
@IBOutlet var imageBrowser: NSCollectionView!
|
||||
@IBOutlet var slider: NSSlider!
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Cocoa
|
||||
import AVFoundation
|
||||
|
||||
class ArtworkSelectorViewItemLabel : NSTextField {
|
||||
final class ArtworkSelectorViewItemLabel : NSTextField {
|
||||
|
||||
@IBInspectable var highlightColor: NSColor = .alternateSelectedControlColor
|
||||
@IBInspectable var highlightTextColor: NSColor = .alternateSelectedControlTextColor
|
||||
@@ -113,7 +113,7 @@ class ArtworkSelectorViewItemLabel : NSTextField {
|
||||
}
|
||||
}
|
||||
|
||||
class ArtworkSelectorViewItemView: NSView {
|
||||
final class ArtworkSelectorViewItemView: NSView {
|
||||
|
||||
let imageLayer: CALayer = CALayer()
|
||||
let backgroundLayer: CALayer = CALayer()
|
||||
@@ -221,7 +221,7 @@ class ArtworkSelectorViewItemView: NSView {
|
||||
|
||||
}
|
||||
|
||||
class ArtworkSelectorViewItem: NSCollectionViewItem {
|
||||
final class ArtworkSelectorViewItem: NSCollectionViewItem {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14087.3" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.68" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14087.3"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.68"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@@ -282,11 +282,11 @@
|
||||
</tableView>
|
||||
</subviews>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="567-mm-ioo">
|
||||
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="567-mm-ioo">
|
||||
<rect key="frame" x="1" y="145" width="690" height="16"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="ykl-Gd-tEc">
|
||||
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="ykl-Gd-tEc">
|
||||
<rect key="frame" x="606" y="17" width="15" height="99"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class ButtonToolbarItem : NSToolbarItem {
|
||||
final class ButtonToolbarItem : NSToolbarItem {
|
||||
|
||||
override func validate() {
|
||||
if let target = target {
|
||||
|
||||
@@ -12,7 +12,7 @@ protocol ChapterSearchControllerDelegate : AnyObject {
|
||||
func didSelect(chapters: [MP42TextSample])
|
||||
}
|
||||
|
||||
class ChapterSearchController: NSWindowController, NSTableViewDataSource, NSTableViewDelegate, NSTextFieldDelegate {
|
||||
final class ChapterSearchController: NSWindowController, NSTableViewDataSource, NSTableViewDelegate, NSTextFieldDelegate {
|
||||
|
||||
@IBOutlet var searchTitle: NSTextField!
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class CheckBoxCellView : NSTableCellView {
|
||||
final class CheckBoxCellView : NSTableCellView {
|
||||
@IBOutlet var checkboxButton: NSButton!
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class ComboBoxCellView : NSTableCellView {
|
||||
final class ComboBoxCellView : NSTableCellView {
|
||||
@IBOutlet var comboBox: NSComboBox!
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class DetailsViewController: NSViewController {
|
||||
final class DetailsViewController: NSViewController {
|
||||
|
||||
override var nibName: NSNib.Name? {
|
||||
return "DetailsViewController"
|
||||
|
||||
@@ -9,7 +9,7 @@ import Cocoa
|
||||
import IOKit.pwr_mgt
|
||||
import MP42Foundation
|
||||
|
||||
@objc(SBDocument) class Document: NSDocument {
|
||||
@objc(SBDocument) final class Document: NSDocument {
|
||||
|
||||
private(set) var mp4: MP42File
|
||||
private var unsupportedMp4Brand: Bool
|
||||
@@ -51,7 +51,7 @@ import MP42Foundation
|
||||
|
||||
override class func canConcurrentlyReadDocuments(ofType typeName: String) -> Bool { return true }
|
||||
|
||||
override open var isEntireFileLoaded: Bool { get { return false } }
|
||||
override public var isEntireFileLoaded: Bool { get { return false } }
|
||||
|
||||
override func read(from url: URL, ofType typeName: String) throws {
|
||||
do {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Cocoa
|
||||
import MP42Foundation
|
||||
|
||||
class DocumentWindowController: NSWindowController, TracksViewControllerDelegate, ChapterSearchControllerDelegate, MetadataSearchControllerDelegate, FileImportControllerDelegate, ProgressViewControllerDelegate, NSDraggingDestination, NSMenuItemValidation, NSToolbarItemValidation {
|
||||
final class DocumentWindowController: NSWindowController, TracksViewControllerDelegate, ChapterSearchControllerDelegate, MetadataSearchControllerDelegate, FileImportControllerDelegate, ProgressViewControllerDelegate, NSDraggingDestination, NSMenuItemValidation, NSToolbarItemValidation {
|
||||
|
||||
private var doc: Document {
|
||||
return document as! Document
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class ExceptionAlertController: NSWindowController {
|
||||
final class ExceptionAlertController: NSWindowController {
|
||||
|
||||
@IBOutlet var exceptionMessageTextField: NSTextField!
|
||||
@IBOutlet var exceptionBacktraceTextView: NSTextView!
|
||||
|
||||
@@ -12,7 +12,7 @@ protocol FileImportControllerDelegate : AnyObject {
|
||||
func didSelect(tracks: [MP42Track], metadata: MP42Metadata?)
|
||||
}
|
||||
|
||||
class FileImportController: NSWindowController, NSTableViewDataSource, NSTableViewDelegate, NSMenuItemValidation {
|
||||
final class FileImportController: NSWindowController, NSTableViewDataSource, NSTableViewDelegate, NSMenuItemValidation {
|
||||
|
||||
private enum ItemType {
|
||||
case file(MP42FileImporter)
|
||||
|
||||
@@ -12,7 +12,7 @@ import Quartz
|
||||
@objc(pasteToImageBrowserView:) optional func paste(to imagebrowserview: ImageBrowserView)
|
||||
}
|
||||
|
||||
@objc(SBImageBrowserView) class ImageBrowserView : IKImageBrowserView, NSMenuItemValidation {
|
||||
@objc(SBImageBrowserView) final class ImageBrowserView : IKImageBrowserView, NSMenuItemValidation {
|
||||
|
||||
@objc var pasteboardTypes: [NSPasteboard.PasteboardType]
|
||||
var pasteboardHasSupportedType: Bool {
|
||||
|
||||
@@ -11,7 +11,7 @@ protocol ItemViewDelegate: AnyObject {
|
||||
func edit(item: QueueItem)
|
||||
}
|
||||
|
||||
class ItemViewController : NSViewController {
|
||||
final class ItemViewController : NSViewController {
|
||||
|
||||
@objc let item: QueueItem
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
import MP42Foundation
|
||||
|
||||
class Logger : NSObject, MP42Logging {
|
||||
final class Logger : NSObject, MP42Logging {
|
||||
|
||||
var delegate: MP42Logging?
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
import MP42Foundation
|
||||
|
||||
@objc(SBMetadataPreset) class MetadataPreset: NSObject, Preset {
|
||||
@objc(SBMetadataPreset) final class MetadataPreset: NSObject, Preset {
|
||||
|
||||
var pathExtension: String {
|
||||
return "sbpreset2"
|
||||
|
||||
@@ -12,7 +12,7 @@ protocol MetadataSearchControllerDelegate : AnyObject {
|
||||
func didSelect(metadata: MetadataResult)
|
||||
}
|
||||
|
||||
class MetadataSearchController: NSWindowController, NSTableViewDataSource, NSTableViewDelegate, NSComboBoxDelegate, NSComboBoxDataSource, NSTextFieldDelegate, ArtworkSelectorControllerDelegate {
|
||||
final class MetadataSearchController: NSWindowController, NSTableViewDataSource, NSTableViewDelegate, NSComboBoxDelegate, NSComboBoxDataSource, NSTextFieldDelegate, ArtworkSelectorControllerDelegate {
|
||||
|
||||
@IBOutlet var searchMode: NSTabView!
|
||||
@IBOutlet var movieTab: NSTabViewItem!
|
||||
@@ -414,9 +414,7 @@ class MetadataSearchController: NSWindowController, NSTableViewDataSource, NSTab
|
||||
}
|
||||
|
||||
private func toggleUI(items: [NSControl], state: Bool) {
|
||||
for item in items {
|
||||
item.isEnabled = state
|
||||
}
|
||||
items.forEach { $0.isEnabled = true }
|
||||
}
|
||||
|
||||
private func disableUI() {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Cocoa
|
||||
import MP42Foundation
|
||||
|
||||
class OffsetViewController: NSViewController {
|
||||
final class OffsetViewController: NSViewController {
|
||||
|
||||
private let doc: Document
|
||||
private let track: MP42Track
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Cocoa
|
||||
import MP42Foundation
|
||||
|
||||
class OptionsViewController: NSViewController, NSMenuItemValidation {
|
||||
final class OptionsViewController: NSViewController, NSMenuItemValidation {
|
||||
|
||||
@IBOutlet var destButton: NSPopUpButton!
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
class PopUpCellView : NSTableCellView {
|
||||
final class PopUpCellView : NSTableCellView {
|
||||
@IBOutlet var popUpButton: NSPopUpButton!
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class PresetEditorViewController: SBMovieViewController {
|
||||
final class PresetEditorViewController: SBMovieViewController {
|
||||
|
||||
let preset: MetadataPreset
|
||||
@IBOutlet weak var presetTitle: NSTextField!
|
||||
|
||||
@@ -11,7 +11,7 @@ protocol ProgressViewControllerDelegate : AnyObject {
|
||||
func cancel()
|
||||
}
|
||||
|
||||
class ProgressViewController: NSViewController {
|
||||
final class ProgressViewController: NSViewController {
|
||||
|
||||
@IBOutlet var cancelButton: NSButton!
|
||||
@IBOutlet var progressString: NSTextField!
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.68" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/>
|
||||
<plugIn identifier="com.apple.imagekit.ibplugin" version="14460.31"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.68"/>
|
||||
<plugIn identifier="com.apple.imagekit.ibplugin" version="14490.68"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Cocoa
|
||||
import MP42Foundation
|
||||
|
||||
class ChapterViewController : NSViewController, NSTableViewDataSource, NSTableViewDelegate {
|
||||
final class ChapterViewController : NSViewController, NSTableViewDataSource, NSTableViewDelegate {
|
||||
|
||||
var track: MP42ChapterTrack {
|
||||
didSet {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class EmptyViewController: NSViewController {
|
||||
final class EmptyViewController: NSViewController {
|
||||
|
||||
override var nibName: NSNib.Name? {
|
||||
return "EmptyView"
|
||||
|
||||
@@ -88,7 +88,7 @@ class CheckBoxTableCellView: NSTableCellView {
|
||||
/// after the user press the OK button.
|
||||
///
|
||||
/// Custom media tags are preserved.
|
||||
class MediaTagsController: NSViewController, NSTableViewDataSource, NSTableViewDelegate {
|
||||
final class MediaTagsController: NSViewController, NSTableViewDataSource, NSTableViewDelegate {
|
||||
|
||||
@IBOutlet var tableView: NSTableView!
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class MultiSelectViewController : NSViewController {
|
||||
final class MultiSelectViewController : NSViewController {
|
||||
|
||||
var numberOfTracks: UInt = 0 {
|
||||
didSet {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Cocoa
|
||||
import MP42Foundation
|
||||
|
||||
class SoundViewController : NSViewController {
|
||||
final class SoundViewController : NSViewController {
|
||||
|
||||
let file: MP42File
|
||||
var track: MP42AudioTrack {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Cocoa
|
||||
import MP42Foundation
|
||||
|
||||
class VideoViewController: NSViewController {
|
||||
final class VideoViewController: NSViewController {
|
||||
|
||||
private let file: MP42File
|
||||
var track: MP42VideoTrack {
|
||||
|
||||
+2
-4
@@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
import IOKit
|
||||
|
||||
class Queue {
|
||||
final class Queue {
|
||||
|
||||
static let Working = NSNotification.Name(rawValue: "QueueWorkingNotification")
|
||||
static let Completed = NSNotification.Name(rawValue: "QueueCompletedNotification")
|
||||
@@ -56,9 +56,7 @@ class Queue {
|
||||
items = Array()
|
||||
}
|
||||
|
||||
for item in items where item.status == .working {
|
||||
item.status = .failed
|
||||
}
|
||||
items.filter { $0.status == .working } .forEach { $0.status = .failed }
|
||||
}
|
||||
|
||||
func saveToDisk() throws {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Cocoa
|
||||
import MP42Foundation
|
||||
|
||||
class QueueController : NSWindowController, NSWindowDelegate, NSPopoverDelegate, ItemViewDelegate, NSTableViewDataSource, NSTableViewDelegate, ExpandedTableViewDelegate, NSToolbarItemValidation, NSMenuItemValidation {
|
||||
final class QueueController : NSWindowController, NSWindowDelegate, NSPopoverDelegate, ItemViewDelegate, NSTableViewDataSource, NSTableViewDelegate, ExpandedTableViewDelegate, NSToolbarItemValidation, NSMenuItemValidation {
|
||||
|
||||
static let shared = QueueController()
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
import MP42Foundation
|
||||
|
||||
class QueueItem: NSObject, NSSecureCoding {
|
||||
final class QueueItem: NSObject, NSSecureCoding {
|
||||
|
||||
@objc enum Status: Int {
|
||||
case ready
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
class QueuePreferences: NSObject {
|
||||
final class QueuePreferences: NSObject {
|
||||
|
||||
static private let SBQueueFileType: String = "SBQueueFileType"
|
||||
static private let SBQueueOrganize: String = "SBQueueOrganize"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
class QueuePreset: Preset {
|
||||
final class QueuePreset: Preset {
|
||||
|
||||
var title: String
|
||||
let options: [String : Any]
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Cocoa
|
||||
import MP42Foundation
|
||||
|
||||
class SaveOptions: NSViewController {
|
||||
final class SaveOptions: NSViewController {
|
||||
|
||||
@IBOutlet var fileFormat: NSPopUpButton!
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class TokenCellView : NSTableCellView {
|
||||
final class TokenCellView : NSTableCellView {
|
||||
@IBOutlet var tokenView: NSTokenField!
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class TokenFieldCell : NSTokenFieldCell {
|
||||
final class TokenFieldCell : NSTokenFieldCell {
|
||||
|
||||
private var originalBackgroundStyle: NSView.BackgroundStyle = NSView.BackgroundStyle.light
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ protocol TracksViewControllerDelegate: AnyObject {
|
||||
func didSelect(tracks: [MP42Track])
|
||||
}
|
||||
|
||||
class TracksViewController: NSViewController, NSTableViewDataSource, NSTableViewDelegate {
|
||||
final class TracksViewController: NSViewController, NSTableViewDataSource, NSTableViewDelegate {
|
||||
|
||||
weak var delegate: TracksViewControllerDelegate?
|
||||
|
||||
|
||||
Reference in new issue
Block a user