Mercurial > octave-nkf
diff libgui/src/m-editor/file-editor-tab.cc @ 17790:86c6ae5f969e
Use GNU style coding conventions for code in libgui/
* libgui/qterminal/libqterminal/QTerminal.h, libgui/src/color-picker.cc,
libgui/src/color-picker.h, libgui/src/dialog.cc, libgui/src/dialog.h,
libgui/src/documentation-dock-widget.cc, libgui/src/files-dock-widget.cc,
libgui/src/files-dock-widget.h, libgui/src/find-files-dialog.cc,
libgui/src/find-files-dialog.h, libgui/src/find-files-model.cc,
libgui/src/find-files-model.h, libgui/src/history-dock-widget.cc,
libgui/src/history-dock-widget.h, libgui/src/m-editor/file-editor-interface.h,
libgui/src/m-editor/file-editor-tab.cc, libgui/src/m-editor/file-editor-tab.h,
libgui/src/m-editor/file-editor.cc, libgui/src/m-editor/find-dialog.cc,
libgui/src/m-editor/find-dialog.h, libgui/src/m-editor/octave-qscintilla.cc,
libgui/src/main-window.cc, libgui/src/main-window.h,
libgui/src/news-dock-widget.h, libgui/src/octave-dock-widget.cc,
libgui/src/octave-dock-widget.h, libgui/src/octave-gui.cc,
libgui/src/octave-qt-link.cc, libgui/src/octave-qt-link.h,
libgui/src/qtinfo/parser.cc, libgui/src/qtinfo/parser.h,
libgui/src/qtinfo/webinfo.cc, libgui/src/qtinfo/webinfo.h,
libgui/src/resource-manager.cc, libgui/src/settings-dialog.cc,
libgui/src/settings-dialog.h, libgui/src/terminal-dock-widget.cc,
libgui/src/welcome-wizard.cc, libgui/src/workspace-model.cc,
libgui/src/workspace-model.h, libgui/src/workspace-view.cc,
libgui/src/workspace-view.h:
Use GNU style coding conventions for code in libgui/
author | Rik <rik@octave.org> |
---|---|
date | Tue, 29 Oct 2013 09:54:40 -0700 |
parents | d63878346099 |
children | 4a53bcc1a4ae |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc Mon Oct 28 20:49:13 2013 -0700 +++ b/libgui/src/m-editor/file-editor-tab.cc Tue Oct 29 09:54:40 2013 -0700 @@ -198,7 +198,7 @@ void file_editor_tab::handle_margin_clicked (int margin, int line, - Qt::KeyboardModifiers state) + Qt::KeyboardModifiers state) { if (margin == 1) { @@ -268,8 +268,9 @@ lexer = new QsciLexerDiff (); } else if (_file_name.isEmpty () - || _file_name.at (_file_name.count () - 1) == '/') - { // new, no yet named file: let us assume it is octave + || _file_name.at (_file_name.count () - 1) == '/') + { + // new, no yet named file: let us assume it is octave #if defined (HAVE_LEXER_OCTAVE) lexer = new QsciLexerOctave (); #elif defined (HAVE_LEXER_MATLAB) @@ -279,7 +280,8 @@ #endif } else - { // other or no extension + { + // other or no extension lexer = new QsciLexerBash (); } } @@ -290,12 +292,13 @@ // get path to prepared api info QDesktopServices desktopServices; QString prep_apis_path - = desktopServices.storageLocation (QDesktopServices::HomeLocation) - + "/.config/octave/" + QString(OCTAVE_VERSION) + "/qsci/"; + = desktopServices.storageLocation (QDesktopServices::HomeLocation) + + "/.config/octave/" + QString(OCTAVE_VERSION) + "/qsci/"; _prep_apis_file = prep_apis_path + lexer->lexer () + ".pap"; if (!_lexer_apis->loadPrepared (_prep_apis_file)) - { // no prepared info loaded, prepare and save if possible + { + // no prepared info loaded, prepare and save if possible // create raw apis info QString keyword; @@ -313,7 +316,8 @@ disconnect (_lexer_apis, SIGNAL (apiPreparationFinished ()), 0, 0); // check whether path for prepared info exists or can be created if (QDir("/").mkpath (prep_apis_path)) - { // path exists, apis info can be saved there + { + // path exists, apis info can be saved there connect (_lexer_apis, SIGNAL (apiPreparationFinished ()), this, SLOT (save_apis_info ())); } @@ -721,7 +725,7 @@ if (!_find_dialog) { - _find_dialog = new find_dialog (_edit_area, + _find_dialog = new find_dialog (_edit_area, qobject_cast<QWidget *> (sender ())); connect (_find_dialog, SIGNAL (finished (int)), this, SLOT (handle_find_dialog_finished (int))); @@ -795,7 +799,8 @@ } } //set selection on (un)commented section - _edit_area->setSelection (lineFrom, 0, lineTo, _edit_area->text (lineTo).length ()); + _edit_area->setSelection (lineFrom, 0, lineTo, + _edit_area->text (lineTo).length ()); } else { @@ -863,7 +868,7 @@ QString available_actions; if (_app_closing) - available_actions = tr ("Do you want to save or discard the changes?"); + available_actions = tr ("Do you want to save or discard the changes?"); else { buttons = buttons | QMessageBox::Cancel; // cancel is allowed @@ -900,7 +905,7 @@ // Nothing was modified, just remove from editor. emit tab_remove_request (); } - + return decision; } @@ -972,7 +977,7 @@ // should be performed. if (saveFileName.isEmpty () || saveFileName.at (saveFileName.count () - 1) == '/') - { + { save_file_as (remove_on_success); return; } @@ -1240,9 +1245,9 @@ if (settings->value ("editor/codeCompletion", true).toBool ()) // auto compl. { bool match_keywords = settings->value - ("editor/codeCompletion_keywords",true).toBool (); + ("editor/codeCompletion_keywords",true).toBool (); bool match_document = settings->value - ("editor/codeCompletion_document",true).toBool (); + ("editor/codeCompletion_document",true).toBool (); QsciScintilla::AutoCompletionSource source = QsciScintilla::AcsNone; if (match_keywords) @@ -1250,9 +1255,8 @@ source = QsciScintilla::AcsAll; else source = QsciScintilla::AcsAPIs; - else - if (match_document) - source = QsciScintilla::AcsDocument; + else if (match_document) + source = QsciScintilla::AcsDocument; _edit_area->setAutoCompletionSource (source); _edit_area->setAutoCompletionReplaceWord