diff libgui/src/main-window.cc @ 22411:c69805d1fa64

maint: Style check C++ code in libgui/ * Backend.cc, Backend.h, BaseControl.cc, BaseControl.h, ButtonControl.cc, ButtonControl.h, ButtonGroup.cc, ButtonGroup.h, Canvas.cc, Canvas.h, CheckBoxControl.cc, CheckBoxControl.h, Container.cc, Container.h, ContextMenu.cc, ContextMenu.h, EditControl.cc, EditControl.h, Figure.cc, Figure.h, FigureWindow.cc, FigureWindow.h, GLCanvas.cc, GLCanvas.h, GenericEventNotify.h, KeyMap.cc, KeyMap.h, ListBoxControl.cc, ListBoxControl.h, Logger.cc, Logger.h, Menu.cc, Menu.h, MenuContainer.h, MouseModeActionGroup.cc, MouseModeActionGroup.h, Object.cc, Object.h, ObjectFactory.cc, ObjectFactory.h, ObjectProxy.cc, ObjectProxy.h, Panel.cc, Panel.h, PopupMenuControl.cc, PopupMenuControl.h, PushButtonControl.cc, PushButtonControl.h, PushTool.cc, PushTool.h, QtHandlesUtils.cc, QtHandlesUtils.h, RadioButtonControl.cc, RadioButtonControl.h, SliderControl.cc, SliderControl.h, TextControl.cc, TextControl.h, TextEdit.cc, TextEdit.h, ToggleButtonControl.cc, ToggleButtonControl.h, ToggleTool.cc, ToggleTool.h, ToolBar.cc, ToolBar.h, ToolBarButton.cc, ToolBarButton.h, __init_qt__.cc, __init_qt__.h, annotation-dialog.cc, annotation-dialog.h, gl-select.cc, gl-select.h, color-picker.cc, color-picker.h, dialog.h, documentation-dock-widget.cc, documentation-dock-widget.h, files-dock-widget.cc, files-dock-widget.h, find-files-dialog.h, find-files-model.cc, find-files-model.h, history-dock-widget.cc, history-dock-widget.h, liboctgui-build-info.h, liboctgui-build-info.in.cc, file-editor-interface.h, file-editor-tab.cc, file-editor-tab.h, file-editor.cc, file-editor.h, find-dialog.cc, find-dialog.h, marker.cc, marker.h, octave-qscintilla.cc, octave-qscintilla.h, octave-txt-lexer.cc, octave-txt-lexer.h, main-window.cc, main-window.h, octave-cmd.cc, octave-cmd.h, octave-dock-widget.cc, octave-dock-widget.h, octave-gui.cc, octave-gui.h, octave-interpreter.cc, octave-interpreter.h, octave-qt-link.cc, octave-qt-link.h, parser.cc, parser.h, webinfo.cc, webinfo.h, resource-manager.cc, resource-manager.h, settings-dialog.cc, settings-dialog.h, shortcut-manager.cc, shortcut-manager.h, terminal-dock-widget.h, thread-manager.cc, thread-manager.h, welcome-wizard.cc, welcome-wizard.h, workspace-model.cc, workspace-model.h, workspace-view.cc, workspace-view.h: Style check C++ code in libgui/
author Rik <rik@octave.org>
date Wed, 31 Aug 2016 12:20:46 -0700
parents bac0d6f07a3e
children 752661b4725e
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Wed Aug 31 14:37:33 2016 -0400
+++ b/libgui/src/main-window.cc	Wed Aug 31 12:20:46 2016 -0700
@@ -196,8 +196,8 @@
     }
 
   // editor needs extra handling
-  octave_dock_widget *edit_dock_widget =
-                        static_cast<octave_dock_widget *> (editor_window);
+  octave_dock_widget *edit_dock_widget
+    = static_cast<octave_dock_widget *> (editor_window);
   // if new dock has focus, emit signal and store active focus
   // except editor changes to a dialog (dock=0)
   if ((dock || _active_dock != edit_dock_widget) && (dock != _active_dock))
@@ -257,9 +257,9 @@
 void
 main_window::handle_save_workspace_request (void)
 {
-  QString file =
-    QFileDialog::getSaveFileName (this, tr ("Save Workspace As"), ".", 0, 0,
-                                  QFileDialog::DontUseNativeDialog);
+  QString file
+    = QFileDialog::getSaveFileName (this, tr ("Save Workspace As"), ".", 0, 0,
+                                    QFileDialog::DontUseNativeDialog);
 
   if (! file.isEmpty ())
     octave_link::post_event (this, &main_window::save_workspace_callback,
@@ -651,7 +651,8 @@
 main_window::process_settings_dialog_request (const QString& desired_tab)
 {
   if (_settings_dlg)  // _settings_dlg is a guarded pointer!
-    {                 // here the dialog is still open and called once again
+    {
+      // here the dialog is still open and called once again
       if (! desired_tab.isEmpty ())
         _settings_dlg->show_tab (desired_tab);
       return;
@@ -741,7 +742,7 @@
       QString name = widget->objectName ();
       if (! name.isEmpty ())
         { // if children has a name
-          icon = widget_icon_data[icon_set_found].path; // prefix or octave-logo
+          icon = widget_icon_data[icon_set_found].path; // prefix | octave-logo
           if (widget_icon_data[icon_set_found].name != "NONE")
             icon += name + ".png"; // add widget name and ext.
           widget->setWindowIcon (QIcon (icon));
@@ -769,11 +770,11 @@
   else
     status_bar->hide ();
 
-  _prevent_readline_conflicts =
-    settings->value ("shortcuts/prevent_readline_conflicts", true).toBool ();
-
-  _suppress_dbg_location =
-        ! settings->value ("terminal/print_debug_location", false).toBool ();
+  _prevent_readline_conflicts
+    = settings->value ("shortcuts/prevent_readline_conflicts", true).toBool ();
+
+  _suppress_dbg_location
+    = ! settings->value ("terminal/print_debug_location", false).toBool ();
 
   resource_manager::update_network_settings ();
 
@@ -797,7 +798,9 @@
         {
           int ans = QMessageBox::question (this, tr ("Octave"),
                                            tr ("Are you sure you want to exit Octave?"),
-                                           QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok);
+                                           (QMessageBox::Ok
+                                           | QMessageBox::Cancel),
+                                           QMessageBox::Ok);
 
           if (ans != QMessageBox::Ok)
             closenow = false;
@@ -954,7 +957,8 @@
 void
 main_window::debug_continue (void)
 {
-  octave_cmd_debug *cmd = new octave_cmd_debug ("cont", _suppress_dbg_location);
+  octave_cmd_debug *cmd
+    = new octave_cmd_debug ("cont", _suppress_dbg_location);
   _cmd_queue.add_cmd (cmd);
 }
 
@@ -968,7 +972,8 @@
 void
 main_window::debug_step_over (void)
 {
-  octave_cmd_debug *cmd = new octave_cmd_debug ("step", _suppress_dbg_location);
+  octave_cmd_debug *cmd
+    = new octave_cmd_debug ("step", _suppress_dbg_location);
   _cmd_queue.add_cmd (cmd);
 }
 
@@ -982,7 +987,8 @@
 void
 main_window::debug_quit (void)
 {
-  octave_cmd_debug *cmd = new octave_cmd_debug ("quit", _suppress_dbg_location);
+  octave_cmd_debug *cmd
+    = new octave_cmd_debug ("quit", _suppress_dbg_location);
   _cmd_queue.add_cmd (cmd);
 }
 
@@ -1104,7 +1110,8 @@
           // make widget visible if desired
           if (floating && visible)              // floating and visible
             {
-              if (settings->value ("DockWidgets/" + widget->objectName () + "_minimized").toBool ())
+              if (settings->value ("DockWidgets/" + widget->objectName ()
+                                   + "_minimized").toBool ())
                 widget->showMinimized ();
               else
                 widget->setVisible (true);
@@ -1112,7 +1119,7 @@
           else
             {
               widget->make_widget ();
-              widget->setVisible (visible);       // not floating -> show
+              widget->setVisible (visible);     // not floating -> show
             }
         }
     }
@@ -1434,12 +1441,14 @@
       connect (this,
                SIGNAL (insert_debugger_pointer_signal (const QString&, int)),
                editor_window,
-               SLOT (handle_insert_debugger_pointer_request (const QString&, int)));
+               SLOT (handle_insert_debugger_pointer_request (const QString&,
+                                                             int)));
 
       connect (this,
                SIGNAL (delete_debugger_pointer_signal (const QString&, int)),
                editor_window,
-               SLOT (handle_delete_debugger_pointer_request (const QString&, int)));
+               SLOT (handle_delete_debugger_pointer_request (const QString&,
+                                                             int)));
 
       connect (this,
                SIGNAL (update_breakpoint_marker_signal (bool, const QString&,
@@ -1448,10 +1457,11 @@
                SLOT (handle_update_breakpoint_marker_request (bool,
                                                               const QString&,
                                                               int,
-							      const QString&)));
+							                                                const QString&)));
 #endif
 
-      octave_link::post_event (this, &main_window::resize_command_window_callback);
+      octave_link::post_event (this,
+                               &main_window::resize_command_window_callback);
 
       configure_shortcuts ();
     }
@@ -1472,12 +1482,14 @@
           // restore last dir from previous session
           QStringList curr_dirs
             = settings->value ("MainWindow/current_directory_list").toStringList ();
-          startup_dir = QDir (curr_dirs.at (0));  // last dir in previous session
+          startup_dir
+            = QDir (curr_dirs.at (0));  // last dir in previous session
         }
       else if (! settings->value ("octave_startup_dir").toString ().isEmpty ())
         {
           // do not restore but there is a startup dir configured
-          startup_dir = QDir (settings->value ("octave_startup_dir").toString ());
+          startup_dir
+            = QDir (settings->value ("octave_startup_dir").toString ());
         }
     }
 
@@ -1578,21 +1590,23 @@
       connect (_octave_qt_link,
                SIGNAL (insert_debugger_pointer_signal (const QString&, int)),
                this,
-               SLOT (handle_insert_debugger_pointer_request (const QString&, int)));
+               SLOT (handle_insert_debugger_pointer_request (const QString&,
+                                                             int)));
 
       connect (_octave_qt_link,
                SIGNAL (delete_debugger_pointer_signal (const QString&, int)),
                this,
-               SLOT (handle_delete_debugger_pointer_request (const QString&, int)));
+               SLOT (handle_delete_debugger_pointer_request (const QString&,
+                                                             int)));
 
       connect (_octave_qt_link,
                SIGNAL (update_breakpoint_marker_signal (bool, const QString&,
-	                                                int, const QString&)),
+	                                                      int, const QString&)),
                this,
                SLOT (handle_update_breakpoint_marker_request (bool,
-	                                                      const QString&,
+	                                                            const QString&,
                                                               int,
-							      const QString&)));
+							                                                const QString&)));
 
       connect (_octave_qt_link,
                SIGNAL (show_doc_signal (const QString &)),
@@ -1810,7 +1824,7 @@
 
   _find_files_action
     = edit_menu->addAction (resource_manager::icon ("edit-find"),
-                             tr ("Find Files..."));
+                            tr ("Find Files..."));
 
   edit_menu->addSeparator ();
 
@@ -1854,7 +1868,7 @@
                                         const char *member)
 {
   QAction *action = add_action (_debug_menu,
-                                  resource_manager::icon (QString (icon)),
+                                resource_manager::icon (QString (icon)),
                                 item, member);
 
   action->setEnabled (false);
@@ -1873,20 +1887,20 @@
   _debug_menu = m_add_menu (p, tr ("De&bug"));
 
   _debug_step_over = construct_debug_menu_item (
-                      "db-step", tr ("Step"),
+                       "db-step", tr ("Step"),
                        SLOT (debug_step_over ()));
 
   _debug_step_into = construct_debug_menu_item (
-                      "db-step-in", tr ("Step In"),
+                       "db-step-in", tr ("Step In"),
                        SLOT (debug_step_into ()));
 
   _debug_step_out = construct_debug_menu_item (
                       "db-step-out", tr ("Step Out"),
-                       SLOT (debug_step_out ()));
+                      SLOT (debug_step_out ()));
 
   _debug_continue = construct_debug_menu_item (
                       "db-cont", tr ("Continue"),
-                       SLOT (debug_continue ()));
+                      SLOT (debug_continue ()));
 
   _debug_menu->addSeparator ();
 #if defined (HAVE_QSCINTILLA)
@@ -1894,8 +1908,8 @@
 #endif
 
   _debug_quit = construct_debug_menu_item (
-                      "db-stop", tr ("Quit Debug Mode"),
-                       SLOT (debug_quit ()));
+                  "db-stop", tr ("Quit Debug Mode"),
+                  SLOT (debug_quit ()));
 }
 
 QAction *