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

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

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

revision 1.2 by esersale, Wed Aug 27 10:13:53 2003 UTC revision 1.3 by esersale, Tue Sep 30 15:38:06 2003 UTC
# Line 59  Line 59 
59  {  {
60    self = [super init];    self = [super init];
61    if (self) {    if (self) {
     #ifdef GNUSTEP  
                   Class gwclass = [[NSBundle mainBundle] principalClass];  
     #else  
                   Class gwclass = [[NSBundle mainBundle] classNamed: @"GWorkspace"];  
     #endif  
62      NSString *defApp = nil, *t = nil;      NSString *defApp = nil, *t = nil;
63                  NSFont *font;                  NSFont *font;
64    
                 gworkspace = (id<GWProtocol>)[gwclass gworkspace];  
65      fm = [NSFileManager defaultManager];      fm = [NSFileManager defaultManager];
66                                    
67      ASSIGN (path, apath);      ASSIGN (path, apath);
# Line 85  Line 79 
79                                        application: &defApp                                        application: &defApp
80                                               type: &t];                                                     type: &t];      
81      ASSIGN (type, t);      ASSIGN (type, t);
82                  isPakage = [gworkspace isPakageAtPath: path];                                    isPakage = [GWLib isPakageAtPath: path];                        
83      ASSIGN (icon, [gworkspace iconForFile: path ofType: type]);        ASSIGN (icon, [GWLib iconForFile: path ofType: type]);  
84      ASSIGN (highlight, [NSImage imageNamed: @"CellHighlight.tiff"]);      ASSIGN (highlight, [NSImage imageNamed: @"CellHighlight.tiff"]);
85    
86      namelabel = [NSTextField new];          namelabel = [NSTextField new];    
# Line 115  Line 109 
109    
110          ASSIGN (path, apath);          ASSIGN (path, apath);
111    ASSIGN (name, [path lastPathComponent]);          ASSIGN (name, [path lastPathComponent]);      
112    ASSIGN (icon, [gworkspace iconForFile: path ofType: type]);        ASSIGN (icon, [GWLib iconForFile: path ofType: type]);    
113    
114    [[NSWorkspace sharedWorkspace] getInfoForFile: path    [[NSWorkspace sharedWorkspace] getInfoForFile: path
115                                      application: &defApp                                      application: &defApp
# Line 156  Line 150 
150    
151  - (void)renewIcon  - (void)renewIcon
152  {  {
153    ASSIGN (icon, [gworkspace iconForFile: path ofType: type]);        ASSIGN (icon, [GWLib iconForFile: path ofType: type]);    
154    [self setNeedsDisplay: YES];    [self setNeedsDisplay: YES];
155  }  }
156    
# Line 352  Line 346 
346    if ([selection count] > 1) {    if ([selection count] > 1) {
347      dragIcon = [NSImage imageNamed: @"MultipleSelection.tiff"];      dragIcon = [NSImage imageNamed: @"MultipleSelection.tiff"];
348    } else {    } else {
349      dragIcon = [gworkspace iconForFile: path ofType: type];      dragIcon = [GWLib iconForFile: path ofType: type];
350    }      }  
351    
352    [self dragImage: dragIcon    [self dragImage: dragIcon
# Line 361  Line 355 
355              event: event              event: event
356         pasteboard: pb         pasteboard: pb
357             source: self             source: self
358          slideBack: [gworkspace animateSlideBack]];          slideBack: [[GWLib workspaceApp] animateSlideBack]];
359  }  }
360    
361  - (void)draggedImage:(NSImage *)anImage  - (void)draggedImage:(NSImage *)anImage
# Line 520  Line 514 
514    if(isDragTarget == YES) {    if(isDragTarget == YES) {
515      isDragTarget = NO;      isDragTarget = NO;
516      if (onSelf == NO) {            if (onSelf == NO) {      
517        ASSIGN (icon, [gworkspace iconForFile: path ofType: type]);        ASSIGN (icon, [GWLib iconForFile: path ofType: type]);
518        [self setNeedsDisplay: YES];        [self setNeedsDisplay: YES];
519      }      }
520      onSelf = NO;      onSelf = NO;
# Line 559  Line 553 
553      return;      return;
554    }    }
555        
556    ASSIGN (icon, [gworkspace iconForFile: path ofType: type]);    ASSIGN (icon, [GWLib iconForFile: path ofType: type]);
557    [self setNeedsDisplay: YES];    [self setNeedsDisplay: YES];
558    
559          sourceDragMask = [sender draggingSourceOperationMask];            sourceDragMask = [sender draggingSourceOperationMask];  
# Line 567  Line 561 
561    sourcePaths = [pb propertyListForType: NSFilenamesPboardType];      sourcePaths = [pb propertyListForType: NSFilenamesPboardType];  
562    source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent];    source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent];
563    
564          trashPath = [gworkspace trashPath];          trashPath = [[GWLib workspaceApp] trashPath];
565    
566          if ([source isEqualToString: trashPath]) {          if ([source isEqualToString: trashPath]) {
567                  operation = GWorkspaceRecycleOutOperation;                  operation = GWorkspaceRecycleOutOperation;
# Line 592  Line 586 
586          [opDict setObject: path forKey: @"destination"];          [opDict setObject: path forKey: @"destination"];
587          [opDict setObject: files forKey: @"files"];          [opDict setObject: files forKey: @"files"];
588                    
589          [gworkspace performFileOperationWithDictionary: opDict];                  [[GWLib workspaceApp] performFileOperationWithDictionary: opDict];      
590  }  }
591    
592  @end  @end

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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