# HG changeset patch
# User Andrew Janke <andrew@apjanke.net>
# Date 1572835140 18000
#      Sun Nov 03 21:39:00 2019 -0500
# Branch fix-indentation-in-app-nap-code
# Node ID 4fd2375a2a74b9b0b5629ecd6834d0ee8f2dea70
# Parent  698c8b08fe8cd81a221e078428e1a7de0ea9ba3e
libgui: fix indentation in static function to disable App Nap

This is just source code formatting cleanup after fixing bug #55940. No functional change.

diff --git a/libgui/src/octave-qobject.cc b/libgui/src/octave-qobject.cc
--- a/libgui/src/octave-qobject.cc
+++ b/libgui/src/octave-qobject.cc
@@ -50,65 +50,65 @@ along with Octave; see the file COPYING.
 #include "oct-env.h"
 #include "version.h"
 
 #include "ovl.h"
 
 
 // Bug #55940 (Disable App Nap on Mac)
 #if defined (Q_OS_MAC)
-  static void disable_app_nap (void)
-  {
-    Class process_info_class;
-    SEL process_info_selector;
-    SEL begin_activity_with_options_selector;
-    id process_info;
-    id reason_string;
-    id osx_latencycritical_activity;
+static void disable_app_nap (void)
+{
+  Class process_info_class;
+  SEL process_info_selector;
+  SEL begin_activity_with_options_selector;
+  id process_info;
+  id reason_string;
+  id osx_latencycritical_activity;
 
-    // Option codes found at https://stackoverflow.com/questions/22784886/what-can-make-nanosleep-drift-with-exactly-10-sec-on-mac-os-x-10-9/32729281#32729281
-    unsigned long long NSActivityUserInitiatedAllowingIdleSystemSleep = 0x00FFFFFFULL;
-    unsigned long long NSActivityLatencyCritical = 0xFF00000000ULL;
+  // Option codes found at https://stackoverflow.com/questions/22784886/what-can-make-nanosleep-drift-with-exactly-10-sec-on-mac-os-x-10-9/32729281#32729281
+  unsigned long long NSActivityUserInitiatedAllowingIdleSystemSleep = 0x00FFFFFFULL;
+  unsigned long long NSActivityLatencyCritical = 0xFF00000000ULL;
 
-    // Avoid errors on older versions of OS X
-    process_info_class = static_cast<Class> (objc_getClass ("NSProcessInfo"));
-    if (process_info_class == nil)
-      return;
+  // Avoid errors on older versions of OS X
+  process_info_class = static_cast<Class> (objc_getClass ("NSProcessInfo"));
+  if (process_info_class == nil)
+    return;
 
-    process_info_selector = sel_getUid ("processInfo");
-    if (class_getClassMethod (process_info_class, process_info_selector)
-        == nullptr)
-      return;
+  process_info_selector = sel_getUid ("processInfo");
+  if (class_getClassMethod (process_info_class, process_info_selector)
+      == nullptr)
+    return;
 
-    begin_activity_with_options_selector = sel_getUid ("beginActivityWithOptions:reason:");
-    if (class_getInstanceMethod (process_info_class,
-                                 begin_activity_with_options_selector)
-        == nullptr)
-      return;
+  begin_activity_with_options_selector = sel_getUid ("beginActivityWithOptions:reason:");
+  if (class_getInstanceMethod (process_info_class,
+                                begin_activity_with_options_selector)
+      == nullptr)
+    return;
 
-    process_info = objc_msgSend (reinterpret_cast<id> (process_info_class),
-                                 process_info_selector);
-    if (process_info == nil)
-      return;
+  process_info = objc_msgSend (reinterpret_cast<id> (process_info_class),
+                                process_info_selector);
+  if (process_info == nil)
+    return;
 
-    reason_string = objc_msgSend (reinterpret_cast<id> (objc_getClass ("NSString")),
-                                  sel_getUid ("alloc"));
-    reason_string = objc_msgSend (reason_string,
-                                  sel_getUid ("initWithUTF8String:"),
-                                  "App Nap causes pause() malfunction");
+  reason_string = objc_msgSend (reinterpret_cast<id> (objc_getClass ("NSString")),
+                                sel_getUid ("alloc"));
+  reason_string = objc_msgSend (reason_string,
+                                sel_getUid ("initWithUTF8String:"),
+                                "App Nap causes pause() malfunction");
 
-    // Start an Activity that suppresses App Nap.  This Activity will run for
-    // the entire duration of the Octave process.  This is intentional,
-    // not a leak.
-    osx_latencycritical_activity = objc_msgSend (process_info,
-        begin_activity_with_options_selector,
-        NSActivityUserInitiatedAllowingIdleSystemSleep
-        | NSActivityLatencyCritical,
-        reason_string);
-  }
+  // Start an Activity that suppresses App Nap.  This Activity will run for
+  // the entire duration of the Octave process.  This is intentional,
+  // not a leak.
+  osx_latencycritical_activity = objc_msgSend (process_info,
+      begin_activity_with_options_selector,
+      NSActivityUserInitiatedAllowingIdleSystemSleep
+      | NSActivityLatencyCritical,
+      reason_string);
+}
 #endif
 
 namespace octave
 {
   // Disable all Qt messages by default.
 
   static void
 #if defined (QTMESSAGEHANDLER_ACCEPTS_QMESSAGELOGCONTEXT)
