# HG changeset patch # User Jacob Dawid # Date 1311109617 -7200 # Node ID 17bb8974577bf2574d628fd1db2e1fa60b2d1d43 # Parent 35ecb6063c7b389e9f904b786593656367f7cccf Repaired history list. diff --git a/gui/src/OctaveLink.cpp b/gui/src/OctaveLink.cpp --- a/gui/src/OctaveLink.cpp +++ b/gui/src/OctaveLink.cpp @@ -23,10 +23,9 @@ // Born July 13, 2007. #include "OctaveLink.h" +#include -OctaveLink - OctaveLink::m_singleton; - +OctaveLink OctaveLink::m_singleton; OctaveLink::OctaveLink ():QObject () { @@ -136,7 +135,7 @@ OctaveLink::updateHistoryModel () { // Determine the client's (our) history length and the one of the server. - int clientHistoryLength = m_history.length (); + int clientHistoryLength = m_historyModel->rowCount (); int serverHistoryLength = command_history::length (); // If were behind the server, iterate through all new entries and add them to our history. @@ -144,12 +143,10 @@ { for (int i = clientHistoryLength; i < serverHistoryLength; i++) { - m_history.insert (0, QString (command_history::get_entry (i).c_str ())); + m_historyModel->insertRow (0); + m_historyModel->setData (m_historyModel->index (0), QString (command_history::get_entry (i).c_str ())); } } - - // Update the model by setting the new history. - m_historyModel->setStringList (m_history); } QStringListModel * diff --git a/gui/src/OctaveLink.h b/gui/src/OctaveLink.h --- a/gui/src/OctaveLink.h +++ b/gui/src/OctaveLink.h @@ -138,7 +138,6 @@ /** History related member variables. */ QStringListModel *m_historyModel; - QStringList m_history; static OctaveLink m_singleton; };