Mercurial > hg > octave-lyh
changeset 14701:06abf71d9083 gui
Fixed bug with current directory.
* MainWindow: Removed if condition to check whether a path is already in the QComboBox's model.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Tue, 29 May 2012 23:11:26 +0200 |
parents | 7623bece76df |
children | f86884be20fc |
files | gui/src/MainWindow.cpp |
diffstat | 1 files changed, 5 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/src/MainWindow.cpp +++ b/gui/src/MainWindow.cpp @@ -151,16 +151,13 @@ void MainWindow::updateCurrentWorkingDirectory (QString directory) { - if(m_currentDirectoryComboBox->findText (directory) < 0) + if (m_currentDirectoryComboBox->count () > 31) { - if (m_currentDirectoryComboBox->count () > 31) - { - m_currentDirectoryComboBox->removeItem (0); - } - m_currentDirectoryComboBox->addItem (directory); - int index = m_currentDirectoryComboBox->findText (directory); - m_currentDirectoryComboBox->setCurrentIndex (index); + m_currentDirectoryComboBox->removeItem (0); } + m_currentDirectoryComboBox->addItem (directory); + int index = m_currentDirectoryComboBox->findText (directory); + m_currentDirectoryComboBox->setCurrentIndex (index); } void