diff libgui/src/m-editor/file-editor-tab.cc @ 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 ae9079bbc627
children 67ef63ead023
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc	Wed Sep 05 08:14:37 2012 -0700
+++ b/libgui/src/m-editor/file-editor-tab.cc	Wed Sep 05 11:41:21 2012 -0400
@@ -198,7 +198,7 @@
 }
 
 void
-file_editor_tab::set_file_name (QString fileName)
+file_editor_tab::set_file_name (const QString& fileName)
 {
   _file_name = fileName;
   update_lexer ();
@@ -436,7 +436,7 @@
 }
 
 int
-file_editor_tab::check_file_modified (QString msg, int cancelButton)
+file_editor_tab::check_file_modified (const QString& msg, int cancelButton)
 {
   int decision = QMessageBox::Yes;
   if (_edit_area->isModified ())
@@ -626,7 +626,7 @@
 }
 
 void
-file_editor_tab::load_file (QString fileName)
+file_editor_tab::load_file (const QString& fileName)
 {
   if (!_file_editor->isVisible ())
     {
@@ -675,7 +675,7 @@
 }
 
 bool
-file_editor_tab::save_file (QString saveFileName)
+file_editor_tab::save_file (const QString& saveFileName)
 {
   // it is a new file with the name "<unnamed>" -> call saveFielAs
   if (saveFileName == UNNAMED_FILE || saveFileName.isEmpty ())
@@ -777,7 +777,7 @@
 }
 
 void
-file_editor_tab::file_has_changed (QString fileName)
+file_editor_tab::file_has_changed (const QString& fileName)
 {
   Q_UNUSED (fileName);
   if (QFile::exists (_file_name))