# HG changeset patch # User John W. Eaton # Date 1357252843 18000 # Node ID 9cd14e53e906860fff663edaec7d922f553f6f02 # Parent 1f076c40c133fcf2e2d39274663c425750211b6f 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. diff -r 1f076c40c133 -r 9cd14e53e906 libgui/qterminal/libqterminal/QTerminal.h --- a/libgui/qterminal/libqterminal/QTerminal.h Thu Jan 03 12:35:10 2013 -0700 +++ b/libgui/qterminal/libqterminal/QTerminal.h Thu Jan 03 17:40:43 2013 -0500 @@ -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 diff -r 1f076c40c133 -r 9cd14e53e906 libgui/qterminal/libqterminal/QTerminalInterface.h --- a/libgui/qterminal/libqterminal/QTerminalInterface.h Thu Jan 03 12:35:10 2013 -0700 +++ b/libgui/qterminal/libqterminal/QTerminalInterface.h Thu Jan 03 17:40:43 2013 -0500 @@ -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))); diff -r 1f076c40c133 -r 9cd14e53e906 libgui/src/history-dockwidget.cc --- a/libgui/src/history-dockwidget.cc Thu Jan 03 12:35:10 2013 -0700 +++ b/libgui/src/history-dockwidget.cc Thu Jan 03 17:40:43 2013 -0500 @@ -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(); diff -r 1f076c40c133 -r 9cd14e53e906 libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Thu Jan 03 12:35:10 2013 -0700 +++ b/libgui/src/m-editor/file-editor-tab.cc Thu Jan 03 17:40:43 2013 -0500 @@ -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 diff -r 1f076c40c133 -r 9cd14e53e906 libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Thu Jan 03 12:35:10 2013 -0700 +++ b/libgui/src/m-editor/file-editor.cc Thu Jan 03 17:40:43 2013 -0500 @@ -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); diff -r 1f076c40c133 -r 9cd14e53e906 libgui/src/main-window.cc --- a/libgui/src/main-window.cc Thu Jan 03 12:35:10 2013 -0700 +++ b/libgui/src/main-window.cc Thu Jan 03 17:40:43 2013 -0500 @@ -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 (); diff -r 1f076c40c133 -r 9cd14e53e906 libgui/src/resource-manager.h --- a/libgui/src/resource-manager.h Thu Jan 03 12:35:10 2013 -0700 +++ b/libgui/src/resource-manager.h Thu Jan 03 17:40:43 2013 -0500 @@ -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 {