aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPContentFilterManager.m
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2014-12-13 19:48:41 +0100
committerMax <post@wickenrode.com>2014-12-13 19:48:41 +0100
commit3b251b8e3d4dc9a694ef76562b388ab07da54785 (patch)
tree8ce5a4c4c637bab883ed7e6667bff7b5b74adbc3 /Source/SPContentFilterManager.m
parent876dde21d97897ad4ee98aa0d6b11898282982ce (diff)
downloadsequelpro-3b251b8e3d4dc9a694ef76562b388ab07da54785.tar.gz
sequelpro-3b251b8e3d4dc9a694ef76562b388ab07da54785.tar.bz2
sequelpro-3b251b8e3d4dc9a694ef76562b388ab07da54785.zip
Replace some NSDictionaries with literals
* [NSDictionary dictionary] → @{} * [NSDictionary dictionaryWithObject:forKey:] can safely be replaced. object==nil would have already thrown a NPE in the past. * Also replaced some (hopefully safe) NSArray initializers (ie. their objects should always exist).
Diffstat (limited to 'Source/SPContentFilterManager.m')
-rw-r--r--Source/SPContentFilterManager.m16
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m
index d6fed676..e35fd672 100644
--- a/Source/SPContentFilterManager.m
+++ b/Source/SPContentFilterManager.m
@@ -89,12 +89,12 @@ static NSString *SPExportFilterAction = @"SPExportFilter";
[contentFilterSplitView setMaxSize:245.f ofSubviewAtIndex:0];
// Add global group row to contentFilters
- [contentFilters addObject:[NSDictionary dictionaryWithObjectsAndKeys:
- NSLocalizedString(@"Global",@"Content Filter Manager : Filter Entry List: 'Global' Header"), @"MenuLabel",
- @"", @"headerOfFileURL",
- @"", @"Clause",
- @"", @"ConjunctionLabel",
- nil]];
+ [contentFilters addObject:@{
+ @"MenuLabel" : NSLocalizedString(@"Global", @"Content Filter Manager : Filter Entry List: 'Global' Header"),
+ @"headerOfFileURL" : @"",
+ @"Clause" : @"",
+ @"ConjunctionLabel" : @""
+ }];
#ifndef SP_CODA /* prefs access */
// Build data source for global content filter (as mutable copy! otherwise each
@@ -240,10 +240,10 @@ static NSString *SPExportFilterAction = @"SPExportFilter";
// Duplicate a selected filter if sender == self
if(sender == self)
- filter = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSString stringWithFormat:NSLocalizedString(@"%@ Copy",@"Content Filter Manager : Initial name of copied filter"),[contentFilterNameTextField stringValue]], [contentFilterTextView string], nil] forKeys:[NSArray arrayWithObjects:@"MenuLabel", @"Clause", nil]];
+ filter = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSString stringWithFormat:NSLocalizedString(@"%@ Copy",@"Content Filter Manager : Initial name of copied filter"),[contentFilterNameTextField stringValue]], [contentFilterTextView string], nil] forKeys:@[@"MenuLabel", @"Clause"]];
// Add a new filter
else
- filter = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:NSLocalizedString(@"New Filter",@"Content Filter Manager : Initial name for new filter"), @"", @"", nil] forKeys:[NSArray arrayWithObjects:@"MenuLabel", @"Clause", @"ConjunctionLabel", nil]];
+ filter = [NSMutableDictionary dictionaryWithObjects:@[NSLocalizedString(@"New Filter",@"Content Filter Manager : Initial name for new filter"), @"", @""] forKeys:@[@"MenuLabel", @"Clause", @"ConjunctionLabel"]];
// If a favourite is currently selected, add the new favourite next to it
if([contentFilterTableView numberOfSelectedRows] > 0) {