/[gnustep]/gnustep/usr-apps/gworkspace/Viewers/IconsViewer/IconsPanel.m
ViewVC logotype

Diff of /gnustep/usr-apps/gworkspace/Viewers/IconsViewer/IconsPanel.m

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by esersale, Mon Sep 29 13:20:29 2003 UTC revision 1.6 by esersale, Tue Sep 30 15:38:06 2003 UTC
# Line 99  if (rct.size.height < 0) rct.size.height Line 99  if (rct.size.height < 0) rct.size.height
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);
# Line 136  if (rct.size.height < 0) rct.size.height Line 128  if (rct.size.height < 0) rct.size.height
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    
# Line 240  if (rct.size.height < 0) rct.size.height Line 232  if (rct.size.height < 0) rct.size.height
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]);
# Line 286  if (rct.size.height < 0) rct.size.height Line 278  if (rct.size.height < 0) rct.size.height
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) {
# Line 305  if (rct.size.height < 0) rct.size.height Line 297  if (rct.size.height < 0) rct.size.height
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    }      }  
# Line 323  if (rct.size.height < 0) rct.size.height Line 315  if (rct.size.height < 0) rct.size.height
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"];
# Line 765  if (s.height > maxr.size.height) s.heigh Line 757  if (s.height > maxr.size.height) s.heigh
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
# Line 1655  pp.x = NSMaxX([self bounds]) - 1 Line 1647  pp.x = NSMaxX([self bounds]) - 1
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 {
# Line 1679  pp.x = NSMaxX([self bounds]) - 1 Line 1671  pp.x = NSMaxX([self bounds]) - 1
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

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26