Changeset 3942
- Timestamp:
- 03/21/06 20:22:52 (3 years ago)
- Files:
-
- WiredClient/trunk/WCFile.h (modified) (1 diff)
- WiredClient/trunk/WCFile.m (modified) (1 diff)
- WiredClient/trunk/WCFiles.m (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
WiredClient/trunk/WCFile.h
r3902 r3942 78 78 - (NSString *)kind; 79 79 - (BOOL)isFolder; 80 - (BOOL)isUploadsFolder; 80 81 - (NSImage *)iconWithWidth:(double)width; 81 82 WiredClient/trunk/WCFile.m
r3902 r3942 471 471 472 472 473 - (BOOL)isUploadsFolder { 474 return ([self type] == WCFileUploads || [self type] == WCFileDropBox); 475 } 476 477 478 473 479 - (NSImage *)iconWithWidth:(double)width { 474 480 NSImage *icon; WiredClient/trunk/WCFiles.m
r3902 r3942 787 787 788 788 [[[self connection] cache] removeFilesForPath:[[self _currentPath] path]]; 789 790 NSLog(@"before %@", [self _currentPath]); 789 791 790 792 [self _changeDirectory:[self _currentPath]]; 791 793 [self _validate]; 794 795 NSLog(@"after %@", [self _currentPath]); 792 796 793 797 [[self connection] removeObserver:self name:WCFilesShouldReload]; … … 1232 1236 NSPasteboard *pasteboard; 1233 1237 NSArray *types; 1234 WCFile * destination;1238 WCFile *file, *path, *destination; 1235 1239 1236 1240 pasteboard = [info draggingPasteboard]; 1237 1241 types = [pasteboard types]; 1238 1242 1239 destination = proposedRow >= 01240 ? [self _fileAtIndex:proposedRow]1241 : [self _currentPath];1242 1243 file = (proposedRow >= 0) ? [self _fileAtIndex:proposedRow] : NULL; 1244 path = [self _currentPath]; 1245 destination = file ? file : path; 1246 1243 1247 if([types containsObject:NSFilenamesPboardType]) { 1244 1248 if(![[[self connection] account] upload]) 1245 1249 return NSDragOperationNone; 1246 1250 1247 if( [destination type] != WCFileUploads && [destination type] != WCFileDropBox) {1251 if((file && ![file isUploadsFolder]) || (!file && ![path isUploadsFolder])) { 1248 1252 if(![[[self connection] account] uploadAnywhere]) 1249 1253 return NSDragOperationNone; 1250 1254 } 1251 } 1252 1253 if(operation == NSTableViewDropAbove) { 1254 if(!destination || destination == [self _currentPath]) 1255 [_filesTableView setDropRow:-1 dropOperation:NSTableViewDropOn]; 1256 else 1255 1256 if(file && [file isUploadsFolder] && operation == NSTableViewDropAbove) { 1257 if(![path isUploadsFolder]) { 1258 if(![[[self connection] account] uploadAnywhere]) 1259 return NSDragOperationNone; 1260 } 1261 } 1262 } 1263 else if([types containsObject:WCFilePboardType]) { 1264 if(![[[self connection] account] alterFiles]) 1257 1265 return NSDragOperationNone; 1258 1266 } 1259 1267 1260 if([destination type] == WCFileFile )1268 if([destination type] == WCFileFile || operation == NSTableViewDropAbove) 1261 1269 [_filesTableView setDropRow:-1 dropOperation:NSTableViewDropOn]; 1262 1270
