@@ -137,15 +137,15 @@ - (void)useViewer:(id<Viewer>)aViewer
137
137
// to decrease retain count on FileViwer.
138
138
// Example: [self windowWillClose:]
139
139
[[viewer view ] removeFromSuperview ];
140
- [viewer autorelease ];
140
+ [viewer release ];
141
141
}
142
142
}
143
143
@end
144
144
145
145
@implementation FileViewer
146
146
147
147
// =============================================================================
148
- // Create and destroy
148
+ # pragma mark - Create and destroy
149
149
// =============================================================================
150
150
151
151
- initRootedAtPath : (NSString *)aRootPath viewer : (NSString *)viewerType isRoot : (BOOL )isRoot
@@ -462,7 +462,7 @@ - (void)dealloc
462
462
}
463
463
464
464
// =============================================================================
465
- // Accessories
465
+ # pragma mark - Accessories
466
466
// =============================================================================
467
467
468
468
- (BOOL )isRootViewer
@@ -499,7 +499,7 @@ - (PathView *)pathView
499
499
}
500
500
501
501
// =============================================================================
502
- // Path manipulations
502
+ # pragma mark - Path manipulations
503
503
// =============================================================================
504
504
// displayedPath - relative path which displayed in PathView and Viewer
505
505
// relativePath == displayedPath == path
@@ -540,7 +540,7 @@ - (void)setPathFromAbsolutePath:(NSString *)absolutePath
540
540
if ([pathType isEqualToString: NSDirectoryFileType ] ||
541
541
[pathType isEqualToString: NSFilesystemFileType ]) {
542
542
ASSIGN (displayedPath, [self pathFromAbsolutePath: absolutePath]);
543
- ASSIGN (selection, nil );
543
+ ASSIGN (selection, ( id ) nil );
544
544
} else {
545
545
// Set file selection ivar
546
546
filename = [absolutePath lastPathComponent ];
@@ -629,7 +629,7 @@ - (NSArray *)directoryContentsAtPath:(NSString *)relPath forPath:(NSString *)tar
629
629
}
630
630
631
631
// =============================================================================
632
- // Actions
632
+ # pragma mark - Actions
633
633
// =============================================================================
634
634
635
635
- (NSArray *)checkSelection : (NSArray *)filenames atPath : (NSString *)relativePath
@@ -992,7 +992,7 @@ - (void)slideToPathFromShelfIcon:(PathIcon *)shelfIcon
992
992
}
993
993
994
994
// =============================================================================
995
- // Shelf
995
+ # pragma mark - Shelf
996
996
// =============================================================================
997
997
998
998
- (void )restoreShelf
@@ -1032,7 +1032,7 @@ - (void)restoreShelf
1032
1032
}
1033
1033
1034
1034
// =============================================================================
1035
- // Viewer delegate (BrowserViewer, IconViewer, ListViewer, etc.)
1035
+ # pragma mark - Viewer delegate (BrowserViewer, IconViewer, ListViewer, etc.)
1036
1036
// =============================================================================
1037
1037
1038
1038
// Called when viewer contains NXTIcons with editable label (IconViewer)
@@ -1047,7 +1047,7 @@ - (void)viewerDidSetPathTo:(NSString *)path selection:(NSArray *)files
1047
1047
}
1048
1048
1049
1049
// =============================================================================
1050
- // Splitview delegate
1050
+ # pragma mark - Splitview delegate
1051
1051
// =============================================================================
1052
1052
- (void )splitView : (NSSplitView *)sender resizeSubviewsWithOldSize : (NSSize )oldSize
1053
1053
{
@@ -1112,7 +1112,7 @@ - (void)splitViewDidResizeSubviews:(NSNotification *)notification
1112
1112
}
1113
1113
1114
1114
// =============================================================================
1115
- // NXTIconLabel delegate
1115
+ # pragma mark - NXTIconLabel delegate
1116
1116
// =============================================================================
1117
1117
1118
1118
// Called by icon in PathView or IconViewer
@@ -1143,7 +1143,7 @@ - (void)iconLabel:(NXTIconLabel *)anIconLabel
1143
1143
}
1144
1144
1145
1145
// =============================================================================
1146
- // Window
1146
+ # pragma mark - Window
1147
1147
// =============================================================================
1148
1148
- (void )_updateFocusInWindow
1149
1149
{
@@ -1206,6 +1206,8 @@ - (void)windowWillClose:(NSNotification *)notif
1206
1206
1207
1207
// unset viewer to decrease retain count on FileViewer
1208
1208
[self useViewer: nil ];
1209
+ // AppKit will try to send notifications DidBecomeKey, DidBecomeMain to deallocated window (BUG?)
1210
+ [window setDelegate: nil ];
1209
1211
1210
1212
[[NSApp delegate ] closeViewer: self ];
1211
1213
}
@@ -1252,7 +1254,7 @@ - (void)handleWindowKeyUp:(NSEvent *)theEvent
1252
1254
}
1253
1255
1254
1256
// =============================================================================
1255
- // Notifications
1257
+ # pragma mark - Notifications
1256
1258
// =============================================================================
1257
1259
- (void )shelfResizableStateChanged : (NSNotification *)notif
1258
1260
{
@@ -1537,7 +1539,7 @@ - (void)fileOperationProcessingFile:(NSNotification *)notif
1537
1539
}
1538
1540
1539
1541
// =============================================================================
1540
- // Dragging
1542
+ # pragma mark - Dragging
1541
1543
// FileViewer is delegate for PathView (with PathIcon),
1542
1544
// ShelfView (with PathIcon).
1543
1545
//
@@ -1556,6 +1558,7 @@ - (NSDragOperation)draggingSourceOperationMaskForPaths:(NSArray *)paths
1556
1558
NSString *parentPath;
1557
1559
NSDragOperation mask;
1558
1560
1561
+ NSLog (@" draggingSourceOperationMaskForPaths: %@ " , paths);
1559
1562
if ([paths count ] == 0 ) {
1560
1563
return NSDragOperationNone;
1561
1564
}
@@ -1582,11 +1585,12 @@ - (NSDragOperation)draggingSourceOperationMaskForPaths:(NSArray *)paths
1582
1585
}
1583
1586
}
1584
1587
1588
+ NSLog (@" draggingSourceOperationMaskForPaths: %@ - %lu " , paths, mask);
1585
1589
return mask;
1586
1590
}
1587
1591
1588
1592
// =============================================================================
1589
- // Workspace menu
1593
+ # pragma mark - Workspace menu
1590
1594
// =============================================================================
1591
1595
1592
1596
// --- Menu actions
0 commit comments