octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #53032] Variable Editor: Leftover debugging co


From: Rik
Subject: [Octave-bug-tracker] [bug #53032] Variable Editor: Leftover debugging code in delete operation
Date: Wed, 31 Jan 2018 21:00:01 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #1, bug #53032 (project octave):

FWIW, the code is in libgui/src/variable-editor.cc at line 1007.


void
variable_editor::delete_selected (void)
{
  QTableView *view = get_table_data (m_tab_widget).m_table;
  QString selection = selected_to_octave ();
  QList<int> coords = octave_to_coords (selection);

  if (coords.isEmpty ())
    return;

  bool whole_columns_selected
    = coords[0] == 1 && coords[1] == view->model ()->rowCount ();

  bool whole_rows_selected
    = coords[2] == 1 && coords[3] == view->model ()->columnCount ();

  emit command_requested (QString ("disp ('")
                          + QString::number (coords[0]) + ","
                          + QString::number (coords[1]) + ","
                          + QString::number (coords[2]) + ","
                          + QString::number (coords[3]) + "');");

  // Must be deleting whole columns or whole rows, and not the whole thing.

  if (whole_columns_selected == whole_rows_selected)
    return;

  if (whole_rows_selected)
    view->model ()->removeRows (coords[0], coords[1] - coords[0]);

  if (whole_columns_selected)
    view->model ()->removeColumns (coords[2], coords[3] - coords[2]);

  emit updated ();
}


I think deleting the "emit command_requested" should fix this.

Also, if you search through this file for 'disp (' you find a number of FIXME
notes like this one


void
variable_editor::columnmenu_requested (const QPoint& pt)
{
  QTableView *view = get_table_data (m_tab_widget).m_table;

  int index = view->horizontalHeader ()->logicalIndexAt (pt);

  // FIXME: What was the intent here?
  // emit command_requested (QString ("disp ('")
  //                         + QString::number (index) + "');");



I think the intent was just to have some debug information.  If the interface
is working these FIXME notes could be deleted.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53032>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]