Use OakIsEmptyString where appropriate

This commit is contained in:
Allan Odgaard
2014-08-08 16:59:57 +02:00
parent 8fa83238c1
commit bc65a57957
3 changed files with 6 additions and 3 deletions

View File

@@ -5,6 +5,7 @@
#import "NSMenuItem Additions.h"
#import "NSView Additions.h"
#import "OakFileIconImage.h"
#import <OakFoundation/OakFoundation.h>
#import <OakFoundation/NSString Additions.h>
#import <OakFoundation/NSArray Additions.h>
#import <oak/oak.h>
@@ -793,7 +794,7 @@ layout_metrics_t::raw_layer_t layout_metrics_t::parse_layer (NSDictionary* item)
// We use the path as an identifer since this is more unique than the title
// Ideally we should introduce a real (unique) identifier, like the documents UUID
NSString* tabIdentifier = tabPaths[previousShowAsLastTab];
if([tabIdentifier isEqualToString:@""])
if(OakIsEmptyString(tabIdentifier))
previousShowAsLastTab = [paths indexOfObject:tabTitles[previousShowAsLastTab]];
else previousShowAsLastTab = [paths indexOfObject:tabIdentifier];

View File

@@ -12,6 +12,7 @@
#import <OakAppKit/OakPopOutAnimation.h>
#import <OakAppKit/OakToolTip.h>
#import <OakFoundation/NSString Additions.h>
#import <OakFoundation/OakFoundation.h>
#import <OakFoundation/OakFindProtocol.h>
#import <OakFoundation/OakTimer.h>
#import <OakSystem/application.h>
@@ -1718,7 +1719,7 @@ static void update_menu_key_equivalents (NSMenu* menu, action_to_key_t const& ac
{
SEL action = [item action];
action_to_key_t::const_iterator it = actionToKey.find(sel_getName(action));
if(it != actionToKey.end() && [[item keyEquivalent] isEqualToString:@""])
if(it != actionToKey.end() && OakIsEmptyString([item keyEquivalent]))
[item setKeyEquivalentCxxString:it->second];
update_menu_key_equivalents([item submenu], actionToKey);

View File

@@ -1,5 +1,6 @@
#import "BundlesPreferences.h"
#import <BundlesManager/BundlesManager.h>
#import <OakFoundation/OakFoundation.h>
#import <OakFoundation/NSDate Additions.h>
#import <OakFoundation/NSString Additions.h>
#import <MGScopeBar/MGScopeBar.h>
@@ -50,7 +51,7 @@ static std::string textify (std::string str)
bundles_db::bundle_ptr bundle = [_bundlesManager bundleAtIndex:i];
if(enabledCategories.empty() || enabledCategories.find(bundle->category()) != enabledCategories.end())
{
if(!filterString || [filterString isEqualToString:@""])
if(OakIsEmptyString(filterString))
{
bundles.push_back(bundle);
}