mirror of
https://github.com/TomHarte/CLK.git
synced 2026-03-11 04:42:20 +00:00
Add file/directory discriminator.
This commit is contained in:
@@ -551,10 +551,13 @@ class MachinePicker: NSObject, NSTableViewDataSource, NSTableViewDelegate, NSPat
|
||||
}
|
||||
|
||||
func pathControl(_ pathControl: NSPathControl, validateDrop info: any NSDraggingInfo) -> NSDragOperation {
|
||||
// TODO: accept if the pasteboard contains NSURLPboardType or NSFilenamesPboardType,
|
||||
// and if the referenced file is a directory.
|
||||
|
||||
return NSDragOperation.link
|
||||
// Accept only directories.
|
||||
if let url = NSURL(from: info.draggingPasteboard) {
|
||||
if url.hasDirectoryPath {
|
||||
return NSDragOperation.link
|
||||
}
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
func establishPathControl(_ pathControl: NSPathControl, userDefaultsKey: String) {
|
||||
|
||||
Reference in New Issue
Block a user