/[gnustep]/gnustep/usr-apps/gworkspace/GWLib/BMatrix.m
ViewVC logotype

Diff of /gnustep/usr-apps/gworkspace/GWLib/BMatrix.m

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

revision 1.2 by esersale, Mon Aug 25 17:19:13 2003 UTC revision 1.3 by esersale, Mon Sep 29 13:20:28 2003 UTC
# Line 38  Line 38 
38    
39  - (void)dealloc  - (void)dealloc
40  {  {
   TEST_RELEASE (remoteHostName);  
41    [super dealloc];    [super dealloc];
42  }  }
43    
# Line 49  Line 48 
48        numberOfRows:(int)numRows        numberOfRows:(int)numRows
49     numberOfColumns:(int)numColumns     numberOfColumns:(int)numColumns
50           acceptDnd:(BOOL)dnd           acceptDnd:(BOOL)dnd
         remoteHost:(NSString *)rhost          
51  {  {
52    self = [super initWithFrame: frameRect mode: aMode prototype: aCell    self = [super initWithFrame: frameRect mode: aMode prototype: aCell
53                          numberOfRows: numRows numberOfColumns: numColumns];                          numberOfRows: numRows numberOfColumns: numColumns];
# Line 62  Line 60 
60      #endif      #endif
61    
62                  gworkspace = (id<GWProtocol>)[gwclass gworkspace];                  gworkspace = (id<GWProtocol>)[gwclass gworkspace];
   
     if (rhost) {  
       isRemote = YES;  
       ASSIGN (remoteHostName, rhost);  
     } else {  
       isRemote = NO;  
       remoteHostName = nil;  
     }  
63        
64      column = col;      column = col;
65      browser = [column browser];      browser = [column browser];
# Line 77  Line 67 
67      acceptDnd = dnd;      acceptDnd = dnd;
68            
69      if (acceptDnd) {      if (acceptDnd) {
70        if (isRemote == NO) {        [self registerForDraggedTypes: [NSArray arrayWithObject: NSFilenamesPboardType]];    
                     [self registerForDraggedTypes: [NSArray arrayWithObject: NSFilenamesPboardType]];      
       } else {  
                     [self registerForDraggedTypes: [NSArray arrayWithObject: GWRemoteFilenamesPboardType]];      
       }  
71      }      }
72    }    }
73        
# Line 317  Line 303 
303        dragIcon = [NSImage imageNamed: @"MultipleSelection.tiff"];        dragIcon = [NSImage imageNamed: @"MultipleSelection.tiff"];
304      } else {      } else {
305        NSString *path = [paths objectAtIndex: 0];        NSString *path = [paths objectAtIndex: 0];
306        NSString *type = [gworkspace server: remoteHostName typeOfFileAt: path];        NSString *type = [gworkspace typeOfFileAt: path];
307    
308        dragIcon = [gworkspace iconForFile: path ofType: type];        dragIcon = [gworkspace iconForFile: path ofType: type];
309      }      }
# Line 343  Line 329 
329    NSArray *selectedCells = [self selectedCells];    NSArray *selectedCells = [self selectedCells];
330    NSMutableArray *selection = [NSMutableArray arrayWithCapacity: 1];    NSMutableArray *selection = [NSMutableArray arrayWithCapacity: 1];
331    NSArray *dndtypes;    NSArray *dndtypes;
   NSData *pbData;  
332    int i;    int i;
333    
334    for (i = 0; i < [selectedCells count]; i++) {    for (i = 0; i < [selectedCells count]; i++) {
# Line 351  Line 336 
336      [selection addObjectsFromArray: paths];      [selection addObjectsFromArray: paths];
337    }    }
338                    
339    if (isRemote == NO) {    dndtypes = [NSArray arrayWithObject: NSFilenamesPboardType];
340      dndtypes = [NSArray arrayWithObject: NSFilenamesPboardType];    [pb declareTypes: dndtypes owner: nil];
341      [pb declareTypes: dndtypes owner: nil];  
342          if ([pb setPropertyList: selection forType: NSFilenamesPboardType] == NO) {
343      if ([pb setPropertyList: selection forType: NSFilenamesPboardType] == NO) {      return;
       return;  
     }  
   } else {  
     NSMutableDictionary *pbDict = [NSMutableDictionary dictionary];        
     dndtypes = [NSArray arrayWithObject: GWRemoteFilenamesPboardType];  
     [pb declareTypes: dndtypes owner: nil];      
     [pbDict setObject: remoteHostName forKey: @"host"];  
     [pbDict setObject: selection forKey: @"paths"];          
     pbData = [NSArchiver archivedDataWithRootObject: pbDict];  
     [pb setData: pbData forType: GWRemoteFilenamesPboardType];  
344    }    }
345  }  }
346    

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