Do not add query to history if it was the last
Maybe people just press enter twice. This is the behaviour of bash.
This commit is contained in:
parent
1dd1298ee0
commit
5563e1cafd
@ -190,7 +190,11 @@ class relForm(QtWidgets.QMainWindow):
|
|||||||
self.showRelation(self.selectedRelation)
|
self.showRelation(self.selectedRelation)
|
||||||
|
|
||||||
if not self.multiline:
|
if not self.multiline:
|
||||||
# Adds to history
|
# Last in history
|
||||||
|
item = self.ui.lstHistory.item(self.ui.lstHistory.count() - 1)
|
||||||
|
|
||||||
|
if item is None or item.text() != query:
|
||||||
|
# Adds to history if it is not already the last
|
||||||
hitem = QtWidgets.QListWidgetItem(None, 0)
|
hitem = QtWidgets.QListWidgetItem(None, 0)
|
||||||
hitem.setText(query)
|
hitem.setText(query)
|
||||||
self.ui.lstHistory.addItem(hitem)
|
self.ui.lstHistory.addItem(hitem)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user