Add second binding to same word
This commit is contained in:
@@ -368,6 +368,9 @@ class EditDialog(QDialog, Ui_Dialog):
|
|||||||
#
|
#
|
||||||
textBlock = self.paraEdit.document().findBlock(cursor.position())
|
textBlock = self.paraEdit.document().findBlock(cursor.position())
|
||||||
blockNum = textBlock.blockNumber()
|
blockNum = textBlock.blockNumber()
|
||||||
|
start = start - textBlock.position()
|
||||||
|
end = end - textBlock.position()
|
||||||
|
|
||||||
query = QSqlQuery()
|
query = QSqlQuery()
|
||||||
query.prepare("SELECT * FROM words WHERE word = :word")
|
query.prepare("SELECT * FROM words WHERE word = :word")
|
||||||
query.bindValue(":word", word)
|
query.bindValue(":word", word)
|
||||||
@@ -395,8 +398,6 @@ class EditDialog(QDialog, Ui_Dialog):
|
|||||||
query.bindValue(":definition", json.dumps(definition))
|
query.bindValue(":definition", json.dumps(definition))
|
||||||
if not query.exec():
|
if not query.exec():
|
||||||
query_error(query)
|
query_error(query)
|
||||||
start = start - textBlock.position()
|
|
||||||
end = end - textBlock.position()
|
|
||||||
self.defined(query.lastInsertId(), blockNum, start, end)
|
self.defined(query.lastInsertId(), blockNum, start, end)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user