aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/SPChooseMenuItemDialog.m31
-rw-r--r--Source/SPSplitView.h2
-rw-r--r--Source/SPSplitView.m2
-rw-r--r--Source/SPTableContentDelegate.m4
-rw-r--r--Source/SPTablesList.h5
-rw-r--r--Source/SPTextView.m5
6 files changed, 21 insertions, 28 deletions
diff --git a/Source/SPChooseMenuItemDialog.m b/Source/SPChooseMenuItemDialog.m
index dc9ba92a..a4bb12bb 100644
--- a/Source/SPChooseMenuItemDialog.m
+++ b/Source/SPChooseMenuItemDialog.m
@@ -39,16 +39,10 @@
@end
@implementation SPChooseMenuItemDialogTextView
-{
-}
- (id)init;
{
- if ((self = [super initWithFrame:NSMakeRect(1, 1, 2, 2)]))
- {
- }
-
- return self;
+ return [super initWithFrame:NSMakeRect(1, 1, 2, 2)];
}
- (IBAction)menuItemHandler:(id)sender
@@ -72,21 +66,18 @@
- (id)init;
{
- if((self = [super initWithContentRect:NSMakeRect(1,1,2,2)
- styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]))
+ if ((self = [super initWithContentRect:NSMakeRect(1,1,2,2)
+ styleMask:NSBorderlessWindowMask
+ backing:NSBackingStoreBuffered
+ defer:NO]))
{
waitForChoice = YES;
selectedItemIndex = -1;
}
+
return self;
}
-- (void)dealloc
-{
- [dummyTextView release];
- [super dealloc];
-}
-
- (void)initDialog
{
[self setReleasedWhenClosed:YES];
@@ -100,7 +91,6 @@
[dummyTextView setDelegate:self];
[self setContentView:dummyTextView];
-
}
+ (NSInteger)withItems:(NSArray*)theList atPosition:(NSPoint)location
@@ -170,4 +160,13 @@
return [dialog selectedItemIndex];
}
+#pragma mark -
+
+- (void)dealloc
+{
+ [dummyTextView release];
+
+ [super dealloc];
+}
+
@end
diff --git a/Source/SPSplitView.h b/Source/SPSplitView.h
index f1edef8d..b181d1ce 100644
--- a/Source/SPSplitView.h
+++ b/Source/SPSplitView.h
@@ -34,7 +34,7 @@
@interface SPSplitView : NSSplitView <NSSplitViewDelegate>
{
- NSObject *delegate;
+ id<NSSplitViewDelegate> delegate;
IBOutlet NSButton *collapseToggleButton;
IBOutlet NSView *additionalDragHandleView;
diff --git a/Source/SPSplitView.m b/Source/SPSplitView.m
index 362b24aa..4930e171 100644
--- a/Source/SPSplitView.m
+++ b/Source/SPSplitView.m
@@ -120,7 +120,7 @@
#pragma mark -
#pragma mark Delegate management
-- (void)setDelegate:(NSObject *)aDelegate
+- (void)setDelegate:(id<NSSplitViewDelegate>)aDelegate
{
delegate = aDelegate;
}
diff --git a/Source/SPTableContentDelegate.m b/Source/SPTableContentDelegate.m
index e0064337..e1976762 100644
--- a/Source/SPTableContentDelegate.m
+++ b/Source/SPTableContentDelegate.m
@@ -756,13 +756,13 @@
* Trap the enter, escape, tab and arrow keys, overriding default behaviour and continuing/ending editing,
* only within the current row.
*/
-- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command
+- (BOOL)control:(NSControl<NSControlTextEditingDelegate> *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command
{
#ifndef SP_REFACTOR
// Check firstly if SPCopyTable can handle command
if ([control control:control textView:textView doCommandBySelector:(SEL)command])
#else
- if ([(id<NSControlTextEditingDelegate>)control control:control textView:textView doCommandBySelector:(SEL)command])
+ if ([control control:control textView:textView doCommandBySelector:(SEL)command])
#endif
return YES;
diff --git a/Source/SPTablesList.h b/Source/SPTablesList.h
index 8d267c71..1d4fd6ca 100644
--- a/Source/SPTablesList.h
+++ b/Source/SPTablesList.h
@@ -44,10 +44,7 @@
@class SQLSidebarViewController;
#endif
-@interface SPTablesList : NSObject
-#ifdef SP_REFACTOR
-<NSTextFieldDelegate>
-#endif
+@interface SPTablesList : NSObject <NSTextFieldDelegate, NSTableViewDelegate>
{
IBOutlet SPDatabaseDocument *tableDocumentInstance;
IBOutlet SPTableStructure *tableSourceInstance;
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index 5e324d28..aeef2276 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -3460,11 +3460,8 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS
}
// Check size and NSFileType
-#ifndef SP_REFACTOR
- NSDictionary *attr = [[NSFileManager defaultManager] fileAttributesAtPath:filepath traverseLink:YES];
-#else
NSDictionary *attr = [[NSFileManager defaultManager] attributesOfItemAtPath:filepath error:nil];
-#endif
+
if(attr)
{
NSNumber *filesize = [attr objectForKey:NSFileSize];