Merge pull request #607 from Arthur-Milchior/remove_a_try
Simplify the copying of field contents when resetting
This commit is contained in:
commit
08f894735a
@ -121,14 +121,9 @@ class AddCards(QDialog):
|
|||||||
if oldNote:
|
if oldNote:
|
||||||
if not keep:
|
if not keep:
|
||||||
self.removeTempNote(oldNote)
|
self.removeTempNote(oldNote)
|
||||||
for n in range(len(note.fields)):
|
for n in range(min(len(note.fields), len(oldNote.fields))):
|
||||||
try:
|
if not keep or flds[n]["sticky"]:
|
||||||
if not keep or flds[n]["sticky"]:
|
note.fields[n] = oldNote.fields[n]
|
||||||
note.fields[n] = oldNote.fields[n]
|
|
||||||
else:
|
|
||||||
note.fields[n] = ""
|
|
||||||
except IndexError:
|
|
||||||
break
|
|
||||||
self.setAndFocusNote(note)
|
self.setAndFocusNote(note)
|
||||||
|
|
||||||
def removeTempNote(self, note: Note) -> None:
|
def removeTempNote(self, note: Note) -> None:
|
||||||
|
Loading…
Reference in New Issue
Block a user