diff libgui/src/qtinfo/parser.h @ 15300:fd27e10b9b05

pass QString by const reference instead of value * files-dockwidget.cc, files-dockwidget.h, history-dockwidget.h, file-editor-interface.h, file-editor-tab.cc, file-editor-tab.h, file-editor.cc, file-editor.h, main-window.cc, main-window.h, octave-qt-event-listener.h, parser.cc, parser.h, webinfo.cc, webinfo.h, resource-manager.cc, resource-manager.h: For all functions that take QString arguments, use "const Qstring&" instead of passing QString by value.
author John W. Eaton <jwe@octave.org>
date Wed, 05 Sep 2012 11:41:21 -0400
parents 017f0b2e6933
children 6437fa7263dd
line wrap: on
line diff
--- a/libgui/src/qtinfo/parser.h	Wed Sep 05 08:14:37 2012 -0700
+++ b/libgui/src/qtinfo/parser.h	Wed Sep 05 11:41:21 2012 -0400
@@ -45,20 +45,21 @@
 
 public:
   parser (QObject *parent = 0);
-  void set_info_path (QString _info_path);
+  void set_info_path (const QString& _info_path);
   QString get_info_path ();
-  QString search_node (QString node);
-  QString global_search (QString text, int maxFounds);
+  QString search_node (const QString& node);
+  QString global_search (const QString& text, int maxFounds);
 
   /** Checks if this node is reference. If node is reference, it will be returned its position
     * in text, else  it will be returned -1.
     */
-  int is_ref (QString node);
+  int is_ref (const QString& node);
 
   /**Translates text of node to Html. If anchorPos is not -1, then anchor is inserted in that
     * position.
     */
-  QString node_text_to_html (QString text, int anchorPos=-1, QString anchor=QString());
+  QString node_text_to_html (const QString& text, int anchorPos = -1,
+                             const QString& anchor = QString ());
 
 private:
   struct node_position
@@ -78,12 +79,12 @@
     int real_size;
   };
 
-  QString search_node (QString node, QIODevice * io);
+  QString search_node (const QString& node, QIODevice * io);
   QString get_next_node (QIODevice * io);
-  QString get_node_name (QString text);
-  QString get_node_up (QString text);
-  QString get_node_next (QString text);
-  QString get_node_prev (QString text);
+  QString get_node_name (const QString& text);
+  QString get_node_up (const QString& text);
+  QString get_node_next (const QString& text);
+  QString get_node_prev (const QString& text);
 
   /** Parses info files and gets map of node positions.*/
   void parse_info_map();