Fix a bug and remove some unneeded vars.

This commit is contained in:
Damiano Galassi committed 2019-01-28 10:59:46 +01:00
1 parent a37bcff723
commit 98c37614e2
2 files changed
+5 -7

No files matched your search

-2
View File
@@ -12,8 +12,6 @@ class OptionsViewController: NSViewController, NSMenuItemValidation {
@IBOutlet var destButton: NSPopUpButton!
private static var observerContext = 0
@objc private dynamic let options: QueuePreferences
@objc private dynamic var sets: [MetadataPreset]
+5 -5
View File
@@ -178,7 +178,9 @@ class QueueController : NSWindowController, NSWindowDelegate, NSPopoverDelegate,
do {
try item.prepare()
} catch {
self.presentError(error)
DispatchQueue.main.async {
self.presentError(error)
}
}
}
@@ -258,7 +260,7 @@ class QueueController : NSWindowController, NSWindowDelegate, NSPopoverDelegate,
if let destination = prefs.destination {
item.destURL = destination.appendingPathComponent(url.lastPathComponent).deletingPathExtension().appendingPathExtension(prefs.fileType)
} else if let type = value?.typeIdentifier, UTTypeConformsTo(type as CFString, "public.mpeg-4" as CFString) {
} else if let type = value?.typeIdentifier, UTTypeConformsTo(type as CFString, "public.mpeg-4" as CFString) {
item.destURL = url
} else {
item.destURL = url.deletingPathExtension().appendingPathExtension(prefs.fileType)
@@ -747,9 +749,7 @@ class QueueController : NSWindowController, NSWindowDelegate, NSPopoverDelegate,
func tableView(_ tableView: NSTableView, acceptDrop info: NSDraggingInfo, row: Int, dropOperation: NSTableView.DropOperation) -> Bool {
let pboard = info.draggingPasteboard
if let source = info.draggingSource as? NSTableView, source == tableView,
let rowData = pboard.data(forType: tablePasteboardType),
let rowIndexes = NSKeyedUnarchiver.unarchiveObject(with: rowData) as? IndexSet {
if let source = info.draggingSource as? NSTableView, source == tableView, let rowData = pboard.data(forType: tablePasteboardType), let rowIndexes = NSKeyedUnarchiver.unarchiveObject(with: rowData) as? IndexSet {
let items = queue.items(at: rowIndexes)
move(items: items, at: row)