aboutsummaryrefslogtreecommitdiffstats
path: root/Drop Serve
diff options
context:
space:
mode:
authorTeddy Wing2020-10-10 19:45:58 +0200
committerTeddy Wing2020-10-10 19:45:58 +0200
commit5e5f6a8e195218d63c2c302265c5c4ece995d77c (patch)
tree3be0c649c4922efeea52c6fa0829a20a61e838db /Drop Serve
parent660a772195dfc13168cf9c797802462eb98938c0 (diff)
downloadDrop-Serve-5e5f6a8e195218d63c2c302265c5c4ece995d77c.tar.bz2
DropZone.m: Require a directory to be dragged
Diffstat (limited to 'Drop Serve')
-rw-r--r--Drop Serve/DropZone.m13
1 files changed, 12 insertions, 1 deletions
diff --git a/Drop Serve/DropZone.m b/Drop Serve/DropZone.m
index 185ac28..8eb156a 100644
--- a/Drop Serve/DropZone.m
+++ b/Drop Serve/DropZone.m
@@ -44,7 +44,18 @@
if ([[pboard types] containsObject:NSFilenamesPboardType]) {
NSArray *files = [pboard propertyListForType:NSFilenamesPboardType];
- NSLog(@"%@", files);
+ for (int i = 0; i < [files count]; i++) {
+ NSString *file = [files objectAtIndex:i];
+ BOOL isDirectory = false;
+
+ if ([[NSFileManager defaultManager]
+ fileExistsAtPath:file
+ isDirectory:&isDirectory]
+ && isDirectory) {
+ NSLog(@"%@", file);
+ break;
+ }
+ }
}
return YES;