From 5f48cf964f69e8ad9f31c74734d52d897b5daab5 Mon Sep 17 00:00:00 2001 From: Nate Weaver Date: Thu, 5 Jul 2012 17:41:10 -0500 Subject: [PATCH] More warning cleanup! --- Cocoa/Classes/PasteboardDocument.m | 2 +- Cocoa/English.lproj/InfoWindow.xib | 9 +- Cocoa/English.lproj/PrefsWindow.xib | 4 +- Cocoa/Plug-Ins/Hex Editor/HexTextView.m | 8 +- .../Plug-Ins/Hex Editor/HexWindowController.h | 4 + .../Hex Editor/HexWindowController.mm | 4 +- Cocoa/Plug-Ins/Template Editor/ElementDATE.m | 9 +- .../TemplateWindow.nib/designable.nib | 462 +++++++++--------- 8 files changed, 257 insertions(+), 245 deletions(-) diff --git a/Cocoa/Classes/PasteboardDocument.m b/Cocoa/Classes/PasteboardDocument.m index 9de5a9b..e9c1139 100644 --- a/Cocoa/Classes/PasteboardDocument.m +++ b/Cocoa/Classes/PasteboardDocument.m @@ -23,7 +23,7 @@ extern NSString *RKResourcePboardType; NSString *pbType; // clear current pasteboard representation - [self selectAll:nil]; + //[self selectAll:nil]; [self clear:nil]; // set the window's title to represent the pasteboard being shown (at some point I anticipate having several of these) diff --git a/Cocoa/English.lproj/InfoWindow.xib b/Cocoa/English.lproj/InfoWindow.xib index e0d4e3d..e47696f 100644 --- a/Cocoa/English.lproj/InfoWindow.xib +++ b/Cocoa/English.lproj/InfoWindow.xib @@ -1,7 +1,7 @@ - 1060 + 1070 11E53 2182 1138.47 @@ -392,7 +392,6 @@ 274 {{12, 28}, {209, 100}} - YES 4 @@ -489,7 +488,6 @@ 290 {{14, 8}, {210, 14}} - YES 67239424 @@ -511,13 +509,11 @@ {{2, 2}, {238, 139}} - {{20, 20}, {242, 159}} - {0, 0} @@ -540,7 +536,6 @@ {279, 186} - {{0, 0}, {1920, 1178}} @@ -1139,7 +1134,7 @@ IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx - + YES 3 diff --git a/Cocoa/English.lproj/PrefsWindow.xib b/Cocoa/English.lproj/PrefsWindow.xib index ba8eee7..43fe8d5 100644 --- a/Cocoa/English.lproj/PrefsWindow.xib +++ b/Cocoa/English.lproj/PrefsWindow.xib @@ -273,7 +273,7 @@ 67239424 4194304 - bWludXRlcwo + minutes @@ -470,7 +470,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA - {{0, 0}, {1280, 1002}} + {{0, 0}, {1920, 1178}} {213, 129} {10000000000000, 10000000000000} 256 diff --git a/Cocoa/Plug-Ins/Hex Editor/HexTextView.m b/Cocoa/Plug-Ins/Hex Editor/HexTextView.m index 2e6f95a..654cd06 100644 --- a/Cocoa/Plug-Ins/Hex Editor/HexTextView.m +++ b/Cocoa/Plug-Ins/Hex Editor/HexTextView.m @@ -7,9 +7,15 @@ @end +@interface _NSUndoObject : NSObject + +- (id)popUndoObject; + +@end + @interface NSUndoManager (Private) -- (id)_undoStack; +- (_NSUndoObject *)_undoStack; @end diff --git a/Cocoa/Plug-Ins/Hex Editor/HexWindowController.h b/Cocoa/Plug-Ins/Hex Editor/HexWindowController.h index 215bea9..504813f 100644 --- a/Cocoa/Plug-Ins/Hex Editor/HexWindowController.h +++ b/Cocoa/Plug-Ins/Hex Editor/HexWindowController.h @@ -17,6 +17,8 @@ /* Based on HexEdit by Bill Bumgardner, Lane Roath & myself: http://hexedit.sourceforge.net/ */ /* Some ideas, method names, and occasionally code stolen from HexEditor by Raphael Sebbe: http://raphaelsebbe.multimania.com/ */ +@class FindSheetController; + @interface HexWindowController : NSWindowController { IBOutlet HexEditorDelegate *hexDelegate; @@ -27,6 +29,8 @@ IBOutlet NSMenu *copySubmenu; IBOutlet NSMenu *pasteSubmenu; + FindSheetController *sheetController; + id resource; id backup; diff --git a/Cocoa/Plug-Ins/Hex Editor/HexWindowController.mm b/Cocoa/Plug-Ins/Hex Editor/HexWindowController.mm index 4aa62e7..a729554 100644 --- a/Cocoa/Plug-Ins/Hex Editor/HexWindowController.mm +++ b/Cocoa/Plug-Ins/Hex Editor/HexWindowController.mm @@ -51,6 +51,7 @@ OSStatus Plug_InitInstance(Plug_PlugInRef plug, Plug_ResourceRef resource) [[NSNotificationCenter defaultCenter] removeObserver:self]; [undoManager release]; [(id)resource release]; + [sheetController release]; [super dealloc]; } @@ -180,7 +181,8 @@ OSStatus Plug_InitInstance(Plug_PlugInRef plug, Plug_ResourceRef resource) - (void)showFind:(id)sender { // bug: HexWindowController allocs a sheet controller, but it's never disposed of - FindSheetController *sheetController = [[FindSheetController alloc] initWithWindowNibName:@"FindSheet"]; + if (!sheetController) + sheetController = [[FindSheetController alloc] initWithWindowNibName:@"FindSheet"]; [sheetController showFindSheet:self]; } diff --git a/Cocoa/Plug-Ins/Template Editor/ElementDATE.m b/Cocoa/Plug-Ins/Template Editor/ElementDATE.m index 42d8281..8438102 100644 --- a/Cocoa/Plug-Ins/Template Editor/ElementDATE.m +++ b/Cocoa/Plug-Ins/Template Editor/ElementDATE.m @@ -40,7 +40,8 @@ OSStatus error = UCConvertSecondsToCFAbsoluteTime(value, &cfTime); if(error) return nil; // return [[NSCalendarDate dateWithTimeIntervalSinceReferenceDate:(NSTimeInterval)cfTime] descriptionWithLocale:[NSLocale currentLocale]]; - return [[NSCalendarDate dateWithTimeIntervalSinceReferenceDate:(NSTimeInterval)cfTime] descriptionWithLocale:[NSDictionary dictionaryWithObject:[[NSUserDefaults standardUserDefaults] objectForKey:NSShortTimeDateFormatString] forKey:@"NSTimeDateFormatString"]]; + return [NSDateFormatter localizedStringFromDate:[NSDate dateWithTimeIntervalSinceReferenceDate:(NSTimeInterval)cfTime] dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterShortStyle]; + //return [[NSCalendarDate dateWithTimeIntervalSinceReferenceDate:(NSTimeInterval)cfTime] descriptionWithLocale:[NSDictionary dictionaryWithObject:[[NSUserDefaults standardUserDefaults] objectForKey:NSShortTimeDateFormatString] forKey:@"NSTimeDateFormatString"]]; // return [[NSCalendarDate dateWithTimeIntervalSinceReferenceDate:(NSTimeInterval)cfTime] descriptionWithLocale:[NSDictionary dictionaryWithObjectsAndKeys: // [[NSUserDefaults standardUserDefaults] objectForKey:NSShortTimeDateFormatString], @"NSTimeDateFormatString", // [[NSUserDefaults standardUserDefaults] objectForKey:NSAMPMDesignation], @"NSAMPMDesignation", @@ -57,7 +58,11 @@ - (void)setStringValue:(NSString *)str { // UCConvertCFAbsoluteTimeToSeconds((CFAbsoluteTime)[[NSCalendarDate dateWithString:str] timeIntervalSinceReferenceDate], &value); - UCConvertCFAbsoluteTimeToSeconds((CFAbsoluteTime)[[NSCalendarDate dateWithNaturalLanguageString:str] timeIntervalSinceReferenceDate], &value); + NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease]; + [formatter setDateStyle:NSDateFormatterShortStyle]; + [formatter setTimeStyle:NSDateFormatterShortStyle]; + NSDate *date = [formatter dateFromString:str]; + UCConvertCFAbsoluteTimeToSeconds((CFAbsoluteTime)[date timeIntervalSinceReferenceDate], &value); // UCConvertCFAbsoluteTimeToSeconds((CFAbsoluteTime)[[NSCalendarDate dateWithNaturalLanguageString:str locale:[NSDictionary dictionaryWithObject:[NSLocale currentLocale] forKey:@"NSLocale"]] timeIntervalSinceReferenceDate], &value); } diff --git a/Cocoa/Plug-Ins/Template Editor/English.lproj/TemplateWindow.nib/designable.nib b/Cocoa/Plug-Ins/Template Editor/English.lproj/TemplateWindow.nib/designable.nib index 67053bd..e0619a8 100644 --- a/Cocoa/Plug-Ins/Template Editor/English.lproj/TemplateWindow.nib/designable.nib +++ b/Cocoa/Plug-Ins/Template Editor/English.lproj/TemplateWindow.nib/designable.nib @@ -1,7 +1,7 @@ - 1030 + 1070 11E53 2182 1138.47 @@ -30,17 +30,17 @@ PluginDependencyRecalculationVersion - - + + TemplateWindowController - + FirstResponder - + NSApplication - + {200, 200} {50, 50} @@ -51,7 +51,7 @@ - + 15 2 {{406, 385}, {365, 300}} @@ -63,32 +63,32 @@ {213, 107} - + 256 - - + + 274 - - + + 2304 - - + + 4352 {365, 284} - + YES - - + + 256 {365, 17} - + - + @@ -96,7 +96,7 @@ {{350, 0}, {16, 17}} - + label 80 48 @@ -110,45 +110,45 @@ 11 3100 - + 3 MC4zMzMzMzI5OQA - + 6 System headerTextColor - + 3 MAA - + 338820672 1024 - + LucidaGrande 13 1044 - - + + 3 MQA - + 6 System controlTextColor - + 3 YES - + - + stringValue 279 48 @@ -158,27 +158,27 @@ 2048 Data - - + + - + 338820672 1024 - - - - + + + + 3 YES YES - + 3 2 - - + + 6 System gridColor @@ -200,11 +200,11 @@ {{0, 17}, {365, 284}} - + - - - + + + 6 System controlBackgroundColor @@ -215,51 +215,51 @@ 4 - - + + 256 {{350, 17}, {15, 284}} - + - + _doScroller: 0.96616542339324951 - - + + -2147483392 {{-100, -100}, {304, 15}} - + 1 - + _doScroller: 0.96355354785919189 - - + + 2304 - + {365, 17} - + - - - + + + 4 {365, 301} - + - + 133136 - - - - + + + + QSAAAEEgAABBmAAAQZgAAA @@ -274,39 +274,39 @@ 256 YES - + 274 - - + + 274 - - + + 2304 - - + + 256 {226, 244} - + YES - - + + 256 {226, 17} - - + + - - + + 256 {{180, 0}, {12, 17}} - + - + type 61 16 @@ -316,26 +316,26 @@ 134219776 Type - + 3 MC4zMzMzMzI5OQA - + - + 338820672 1024 - - - - + + + + 3 YES YES - + - + label 123.17124938964844 36.171249389648438 @@ -345,22 +345,22 @@ 2048 Label - - + + - + 338820672 1024 - - - - + + + + 3 YES - + - + stringValue 33.4013671875 10 @@ -374,28 +374,28 @@ 6 System headerColor - + - + - + 337772096 2048 - - - - + + + + 3 YES YES - + 3 2 - - + + 17 1390411776 @@ -409,57 +409,57 @@ {{1, 17}, {179, 244}} - - - - + + + + 4 - - + + 256 {{180, 17}, {11, 244}} - + YES 256 - + _doScroller: 0.95901638269424438 - - + + 256 {{-100, -100}, {175, 15}} - + YES 257 - + _doScroller: 0.92344498634338379 - - + + 2304 - + {{1, 0}, {179, 17}} - - - - + + + + 4 - + {{-1, -1}, {192, 262}} - - + + 133842 - - - - + + + + QSAAAEEgAABBmAAAQZgAAA @@ -475,96 +475,96 @@ window - - + + 33 displayList - - + + 43 dataList - - + + 44 tmplDrawer - - + + 50 contentView - - + + 24 parentWindow - - + + 25 delegate - - + + 45 initialFirstResponder - - + + 46 dataSource - - + + 30 delegate - - + + 31 dataSource - - + + 41 delegate - - + + 42 @@ -574,192 +574,192 @@ 0 - + -2 - + File's Owner -1 - + First Responder 20 - + TMPL Drawer 21 - + - + Template Editor 22 - + - + - + 35 - + - - - - + + + + - + 36 - + - - + + - + 34 - + - + - + 37 - + - + - + 23 - + - + TMPL Content 27 - + - - - - + + + + - + 28 - + - - - + + + - + 26 - + - + - + 29 - + - + - + 51 - + - + - + 53 - - + + 54 - - + + 55 - - + + 56 - - + + 57 - - + + 58 - - + + 59 - - + + 60 - - + + 61 - - + + 62 - - + + 63 - - + + -3 - + Application @@ -883,7 +883,7 @@ IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx - + YES 3