99 |
self = [super initWithFrame: NSZeroRect]; |
self = [super initWithFrame: NSZeroRect]; |
100 |
|
|
101 |
if (self) { |
if (self) { |
|
#ifdef GNUSTEP |
|
|
Class gwclass = [[NSBundle mainBundle] principalClass]; |
|
|
#else |
|
|
Class gwclass = [[NSBundle mainBundle] classNamed: @"GWorkspace"]; |
|
|
#endif |
|
|
|
|
|
gworkspace = (id<GWProtocol>)[gwclass gworkspace]; |
|
|
|
|
102 |
fm = [NSFileManager defaultManager]; |
fm = [NSFileManager defaultManager]; |
103 |
|
|
104 |
ASSIGN (currentPath, path); |
ASSIGN (currentPath, path); |
128 |
charBuffer = nil; |
charBuffer = nil; |
129 |
selectInProgress = NO; |
selectInProgress = NO; |
130 |
|
|
131 |
contestualMenu = [gworkspace usesContestualMenu]; |
contestualMenu = [[GWLib workspaceApp] usesContestualMenu]; |
132 |
|
|
133 |
[self registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, nil]]; |
[self registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, nil]]; |
134 |
|
|
232 |
} else { |
} else { |
233 |
hiddenFiles = nil; |
hiddenFiles = nil; |
234 |
} |
} |
235 |
hideSysFiles = [gworkspace hideSysFiles]; |
hideSysFiles = [GWLib hideSysFiles]; |
236 |
|
|
237 |
if (hiddenFiles != nil || hideSysFiles) { |
if (hiddenFiles != nil || hideSysFiles) { |
238 |
NSMutableArray *mutableFiles = AUTORELEASE ([files mutableCopy]); |
NSMutableArray *mutableFiles = AUTORELEASE ([files mutableCopy]); |
278 |
[icons removeAllObjects]; |
[icons removeAllObjects]; |
279 |
edIcon = nil; |
edIcon = nil; |
280 |
|
|
281 |
files = [gworkspace sortedDirectoryContentsAtPath: currentPath]; |
files = [GWLib sortedDirectoryContentsAtPath: currentPath]; |
282 |
files = [gworkspace checkHiddenFiles: files atPath: currentPath]; |
files = [GWLib checkHiddenFiles: files atPath: currentPath]; |
283 |
|
|
284 |
count = [files count]; |
count = [files count]; |
285 |
if (count == 0) { |
if (count == 0) { |
297 |
NSString *ipath = [paths objectAtIndex: i]; |
NSString *ipath = [paths objectAtIndex: i]; |
298 |
IconsViewerIcon *icon = [[IconsViewerIcon alloc] initForPath: ipath |
IconsViewerIcon *icon = [[IconsViewerIcon alloc] initForPath: ipath |
299 |
delegate: self]; |
delegate: self]; |
300 |
[icon setLocked: [gworkspace isLockedPath: ipath]]; |
[icon setLocked: [GWLib isLockedPath: ipath]]; |
301 |
[icons addObject: icon]; |
[icons addObject: icon]; |
302 |
RELEASE (icon); |
RELEASE (icon); |
303 |
} |
} |
315 |
- (void)sortIcons |
- (void)sortIcons |
316 |
{ |
{ |
317 |
NSMutableDictionary *sortDict = [NSMutableDictionary dictionaryWithCapacity: 1]; |
NSMutableDictionary *sortDict = [NSMutableDictionary dictionaryWithCapacity: 1]; |
318 |
int stype = [gworkspace sortTypeForDirectoryAtPath: currentPath]; |
int stype = [GWLib sortTypeForDirectoryAtPath: currentPath]; |
319 |
|
|
320 |
[sortDict setObject: currentPath forKey: @"path"]; |
[sortDict setObject: currentPath forKey: @"path"]; |
321 |
[sortDict setObject: [NSString stringWithFormat: @"%i", stype] forKey: @"type"]; |
[sortDict setObject: [NSString stringWithFormat: @"%i", stype] forKey: @"type"]; |
757 |
|
|
758 |
- (void)openSelectionWith:(id)sender |
- (void)openSelectionWith:(id)sender |
759 |
{ |
{ |
760 |
[gworkspace openSelectedPathsWith]; |
[[GWLib workspaceApp] openSelectedPathsWith]; |
761 |
} |
} |
762 |
|
|
763 |
- (void)addIconWithPath:(NSString *)iconpath dimmed:(BOOL)isdimmed |
- (void)addIconWithPath:(NSString *)iconpath dimmed:(BOOL)isdimmed |
1647 |
sourcePaths = [pb propertyListForType: NSFilenamesPboardType]; |
sourcePaths = [pb propertyListForType: NSFilenamesPboardType]; |
1648 |
source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent]; |
source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent]; |
1649 |
|
|
1650 |
trashPath = [gworkspace trashPath]; |
trashPath = [[GWLib workspaceApp] trashPath]; |
1651 |
if ([source isEqualToString: trashPath]) { |
if ([source isEqualToString: trashPath]) { |
1652 |
operation = GWorkspaceRecycleOutOperation; |
operation = GWorkspaceRecycleOutOperation; |
1653 |
} else { |
} else { |
1671 |
[opDict setObject: currentPath forKey: @"destination"]; |
[opDict setObject: currentPath forKey: @"destination"]; |
1672 |
[opDict setObject: files forKey: @"files"]; |
[opDict setObject: files forKey: @"files"]; |
1673 |
|
|
1674 |
[gworkspace performFileOperationWithDictionary: opDict]; |
[[GWLib workspaceApp] performFileOperationWithDictionary: opDict]; |
1675 |
} |
} |
1676 |
|
|
1677 |
@end |
@end |