Mercurial > hg > octave-nkf
changeset 15894:9cd14e53e906
eliminate some compiler warnings for GUI code
* QTerminalInterface.h (QTerminalInterface::QTerminalInterface):
Eliminate shadow variable warning.
* QTerminal.h (QTerminal::Qterminal): Likewise.
* history-dockwidget.cc (history_dock_widget::ctxMenu): Likewise.
(history_dock_widget::handle_contextmenu_copy,
history_dock_widget::handle_contextmenu_evaluate): Eliminate unused
variable warning.
* file-editor-tab.cc (file_editor_tab::check_file_modified): Eliminate
unsed variable warning.
(file_editor_tab::nmotice_settings) Eliminate shadow variable
warnings.
* file-editor.cc (file_editor::construct): Comment out unsed variable.
* main-window.cc (main_window::notice_settings): Move definition of
WIDGET_ICON_SET_PREFIX here.
* resource-manager.h: From here.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 03 Jan 2013 17:40:43 -0500 |
parents | 1f076c40c133 |
children | a7d89366d7ed |
files | libgui/qterminal/libqterminal/QTerminal.h libgui/qterminal/libqterminal/QTerminalInterface.h libgui/src/history-dockwidget.cc libgui/src/m-editor/file-editor-tab.cc libgui/src/m-editor/file-editor.cc libgui/src/main-window.cc libgui/src/resource-manager.h |
diffstat | 7 files changed, 28 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/qterminal/libqterminal/QTerminal.h +++ b/libgui/qterminal/libqterminal/QTerminal.h @@ -31,8 +31,8 @@ { Q_OBJECT public: - QTerminal(QWidget *parent = 0) - : QWinTerminalImpl(parent) { } + QTerminal(QWidget *xparent = 0) + : QWinTerminalImpl(xparent) { } ~QTerminal() { } }; #else @@ -41,8 +41,8 @@ { Q_OBJECT public: - QTerminal(QWidget *parent = 0) - : QUnixTerminalImpl(parent) { } + QTerminal(QWidget *xparent = 0) + : QUnixTerminalImpl(xparent) { } ~QTerminal() { } }; #endif
--- a/libgui/qterminal/libqterminal/QTerminalInterface.h +++ b/libgui/qterminal/libqterminal/QTerminalInterface.h @@ -30,7 +30,7 @@ { Q_OBJECT public: - QTerminalInterface(QWidget *parent = 0) : QWidget(parent) { + QTerminalInterface(QWidget *xparent = 0) : QWidget(xparent) { connect (this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(handleCustomContextMenuRequested(QPoint)));
--- a/libgui/src/history-dockwidget.cc +++ b/libgui/src/history-dockwidget.cc @@ -102,14 +102,14 @@ setFocusProxy (_filter_line_edit); } -void history_dock_widget::ctxMenu(const QPoint &pos) { +void history_dock_widget::ctxMenu(const QPoint &xpos) { QMenu *menu = new QMenu; menu->addAction(tr("Copy"), this, SLOT(handle_contextmenu_copy(bool))); menu->addAction(tr("Evaluate"), this, SLOT(handle_contextmenu_evaluate(bool))); - menu->exec(_history_list_view->mapToGlobal(pos)); + menu->exec(_history_list_view->mapToGlobal(xpos)); } -void history_dock_widget::handle_contextmenu_copy(bool flag) +void history_dock_widget::handle_contextmenu_copy(bool) { QString text; QItemSelectionModel *selectionModel = _history_list_view->selectionModel(); @@ -123,7 +123,7 @@ QApplication::clipboard()->setText(text); } -void history_dock_widget::handle_contextmenu_evaluate(bool flag) +void history_dock_widget::handle_contextmenu_evaluate(bool) { QItemSelectionModel *selectionModel = _history_list_view->selectionModel(); QModelIndexList rows = selectionModel->selectedRows();
--- a/libgui/src/m-editor/file-editor-tab.cc +++ b/libgui/src/m-editor/file-editor-tab.cc @@ -675,7 +675,7 @@ } int -file_editor_tab::check_file_modified (const QString& msg, int cancelButton) +file_editor_tab::check_file_modified (const QString&, int) { int decision = QMessageBox::Yes; if (_edit_area->isModified ()) @@ -987,13 +987,14 @@ else _edit_area->setAutoCompletionThreshold (-1); - QFont font( settings->value ("editor/fontName","Courier").toString () , - settings->value ("editor/fontSize",10).toInt () ); + QFont xfont (settings->value ("editor/fontName","Courier").toString (), + settings->value ("editor/fontSize",10).toInt ()); + if (settings->value ("editor/showLineNumbers",true).toBool ()) { _edit_area->setMarginLineNumbers (2, true); - _edit_area->setMarginsFont( font ); - QFontMetrics metrics( font ); + _edit_area->setMarginsFont (xfont); + QFontMetrics metrics (xfont); _edit_area->setMarginWidth(2, metrics.width("9999")); } else
--- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -511,7 +511,9 @@ file_editor::construct () { QWidget *editor_widget = new QWidget (this); - QStyle *editor_style = QApplication::style (); + + // FIXME -- what was the intended purpose of this unused variable? + // QStyle *editor_style = QApplication::style (); _menu_bar = new QMenuBar (editor_widget); _tool_bar = new QToolBar (editor_widget);
--- a/libgui/src/main-window.cc +++ b/libgui/src/main-window.cc @@ -203,6 +203,16 @@ void main_window::notice_settings () { + // FIXME -- was this supposed to be configurable in some way? If so, + // maybe it should be moved back to resource-manager.{h,cc}, but not + // as a static variable. + static const char *WIDGET_ICON_SET_PREFIX[] = + { + ":/actions/icons/logo.png", + ":/actions/icons/graphic_logo_", + ":/actions/icons/letter_logo_" + }; + // Set terminal font: QSettings *settings = resource_manager::get_settings ();
--- a/libgui/src/resource-manager.h +++ b/libgui/src/resource-manager.h @@ -35,11 +35,6 @@ GRAPHIC_ICON_SET, LETTER_ICON_SET }; -static const char* WIDGET_ICON_SET_PREFIX[] = - {":/actions/icons/logo.png", - ":/actions/icons/graphic_logo_", - ":/actions/icons/letter_logo_"}; - class resource_manager {