equal
deleted
inserted
replaced
25 #include <QStringList> |
25 #include <QStringList> |
26 |
26 |
27 #include "HistoryLineEdit.h" |
27 #include "HistoryLineEdit.h" |
28 |
28 |
29 HistoryLineEdit::HistoryLineEdit(QWidget * parent, int maxHistorySize) |
29 HistoryLineEdit::HistoryLineEdit(QWidget * parent, int maxHistorySize) |
30 : QLineEdit(parent) |
30 : QLineEdit(parent) |
31 { |
31 { |
32 m_curHistEntryIdx = 0; |
32 m_curHistEntryIdx = 0; |
33 m_maxHistorySize = maxHistorySize; |
33 m_maxHistorySize = maxHistorySize; |
34 m_history = new QStringList(); |
34 m_history = new QStringList(); |
35 } |
35 } |
78 |
78 |
79 void HistoryLineEdit::navigateHistory(bool isGoingUp) |
79 void HistoryLineEdit::navigateHistory(bool isGoingUp) |
80 { |
80 { |
81 // save possible changes to new entry |
81 // save possible changes to new entry |
82 if ((m_curHistEntryIdx >= m_history->size() || |
82 if ((m_curHistEntryIdx >= m_history->size() || |
83 (text() != m_history->at(m_curHistEntryIdx)))) |
83 (text() != m_history->at(m_curHistEntryIdx)))) |
84 { |
84 { |
85 rememberCurrentText(); |
85 rememberCurrentText(); |
86 } |
86 } |
87 |
87 |
88 if (isGoingUp) |
88 if (isGoingUp) |
89 m_curHistEntryIdx--; |
89 m_curHistEntryIdx--; |
90 else |
90 else |
91 m_curHistEntryIdx++; |
91 m_curHistEntryIdx++; |