]> granicus.if.org Git - handbrake/commitdiff
MacGui: added some error logs to the queue.
authorDamiano Galassi <damiog@gmail.com>
Sat, 9 Jan 2016 09:03:12 +0000 (10:03 +0100)
committerDamiano Galassi <damiog@gmail.com>
Sat, 9 Jan 2016 09:03:12 +0000 (10:03 +0100)
macosx/HBAppDelegate.m
macosx/HBDistributedArray.m

index 6c21b1937c809f2d6e0f35fdc62d0b024d4bbfc9..0dc8030b926e0645f553823ec7b8a38d759256a5 100644 (file)
 
     __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;
              // 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;
index 97b8378c3a950f7d93ee27fd06ff6462dac3d0d0..d5cb389763f124d898698439e5b9456f53ce3ae3 100644 (file)
@@ -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.