summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamiano Galassi <damiog@gmail.com>2016-01-09 10:03:12 +0100
committerDamiano Galassi <damiog@gmail.com>2016-01-09 10:03:12 +0100
commite7da0b5d45127c6db240bb6cfe5920e6ea6808d4 (patch)
tree2c169eeb2306fe686d4cca0cfe17fc9da17ada12
parent6cedf950197617427ad264aad16a12a8989e119b (diff)
MacGui: added some error logs to the queue.
-rw-r--r--macosx/HBAppDelegate.m10
-rw-r--r--macosx/HBDistributedArray.m6
2 files changed, 8 insertions, 8 deletions
diff --git a/macosx/HBAppDelegate.m b/macosx/HBAppDelegate.m
index 6c21b1937..0dc8030b9 100644
--- a/macosx/HBAppDelegate.m
+++ b/macosx/HBAppDelegate.m
@@ -302,17 +302,17 @@
__block NSUInteger i = 0;
__block BOOL builtInEnded = NO;
- [self.presetsManager.root enumerateObjectsUsingBlock:^(id obj, NSIndexPath *idx, BOOL *stop)
+ [self.presetsManager.root enumerateObjectsUsingBlock:^(HBPreset *obj, NSIndexPath *idx, BOOL *stop)
{
if (idx.length)
{
NSMenuItem *item = [[NSMenuItem alloc] init];
- item.title = [obj name];
+ item.title = obj.name;
item.tag = i++;
// Set an action only to the actual presets,
// not on the folders.
- if ([obj isLeaf])
+ if (obj.isLeaf)
{
item.action = @selector(selectPresetFromMenu:);
item.representedObject = obj;
@@ -320,12 +320,12 @@
// Make the default preset font bold.
if ([obj isEqualTo:self.presetsManager.defaultPreset])
{
- NSAttributedString *newTitle = [[NSAttributedString alloc] initWithString:[obj name]
+ NSAttributedString *newTitle = [[NSAttributedString alloc] initWithString:obj.name
attributes:@{NSFontAttributeName: [NSFont boldSystemFontOfSize:14]}];
[item setAttributedTitle:newTitle];
}
// Add a separator line after the last builtIn preset
- if ([obj isBuiltIn] == NO && builtInEnded == NO)
+ if (obj.isBuiltIn == NO && builtInEnded == NO)
{
[self.presetsMenu addItem:[NSMenuItem separatorItem]];
builtInEnded = YES;
diff --git a/macosx/HBDistributedArray.m b/macosx/HBDistributedArray.m
index 97b8378c3..d5cb38976 100644
--- a/macosx/HBDistributedArray.m
+++ b/macosx/HBDistributedArray.m
@@ -5,6 +5,7 @@
It may be used under the terms of the GNU General Public License. */
#import "HBDistributedArray.h"
+#import "HBUtilities.h"
#include <semaphore.h>
@@ -90,7 +91,7 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
_mutex = sem_open(name, O_CREAT, 0777, 1);
if (_mutex == SEM_FAILED)
{
- NSLog(@"%s: %d\n", "Error in creating semaphore: ", errno);
+ [HBUtilities writeToActivityLog:"%s: %d\n", "Error in creating semaphore: ", errno];
}
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:HBDistributedArraWrittenToDisk object:nil];
@@ -152,7 +153,6 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
// File was modified while we waited on the lock
// reload it
[self reload];
- NSLog(@"WTF");
return HBDistributedArrayContentReload;
}
@@ -253,7 +253,7 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
if (![NSKeyedArchiver archiveRootObject:temp toFile:self.fileURL.path])
{
- NSLog(@"failed to write the queue to disk");
+ [HBUtilities writeToActivityLog:"Failed to write the queue to disk"];
}
// Send a distributed notification.