changeset 27582:a1907c3fdef4

Change disable_app_nap to file local function rather than private member function. * octave-qobject.cc (disable_app_nap): Remove class hierarchy base_qobject:: from function disable_app_nap. Use static_cast to eliminate compiler warnings about old-style casting. * octave-qobject.h: Delete declaration of private member function disable_app_nap
author Rik <rik@octave.org>
date Tue, 29 Oct 2019 08:10:02 -0700
parents 08394c4cf180
children 315c35e6037c
files libgui/src/octave-qobject.cc libgui/src/octave-qobject.h
diffstat 2 files changed, 3 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/octave-qobject.cc	Mon Oct 28 17:14:51 2019 -0700
+++ b/libgui/src/octave-qobject.cc	Tue Oct 29 08:10:02 2019 -0700
@@ -181,7 +181,7 @@
 #if defined (Q_OS_MAC)
   // FIXME: Does this need to be a private member function of base_qobject?
   //        Or should it be a file local static function?
-  void base_qobject::disable_app_nap (void)
+  void disable_app_nap (void)
   {
     Class process_info_class;
     SEL process_info_selector;
@@ -194,7 +194,7 @@
     unsigned long long NSActivityLatencyCritical = 0xFF00000000ULL;
 
     // Avoid errors on older versions of OS X
-    process_info_class = (Class) objc_getClass ("NSProcessInfo");
+    process_info_class = static_cast<Class> (objc_getClass ("NSProcessInfo"));
     if (process_info_class == nil)
       return;
 
@@ -207,7 +207,7 @@
                                  begin_activity_with_options_selector) == NULL)
       return;
 
-    if ((process_info = objc_msgSend ((id)process_info_class, process_info_selector)) == nil)
+    if ((process_info = objc_msgSend (static_cast<id> (process_info_class), process_info_selector)) == nil)
       return;
 
     reason_string = objc_msgSend (objc_getClass ("NSString"),
--- a/libgui/src/octave-qobject.h	Mon Oct 28 17:14:51 2019 -0700
+++ b/libgui/src/octave-qobject.h	Tue Oct 29 08:10:02 2019 -0700
@@ -98,13 +98,6 @@
 
     QThread *main_thread (void) { return m_main_thread; }
 
-  private:
-
-#if defined (Q_OS_MAC)
-    // FIXME: Does this need to be a private member function of base_qobject?
-    void disable_app_nap (void);
-#endif
-
   public slots:
 
     void handle_octave_finished (int);