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 not keep:
|
||||
self.removeTempNote(oldNote)
|
||||
for n in range(len(note.fields)):
|
||||
try:
|
||||
if not keep or flds[n]["sticky"]:
|
||||
note.fields[n] = oldNote.fields[n]
|
||||
else:
|
||||
note.fields[n] = ""
|
||||
except IndexError:
|
||||
break
|
||||
for n in range(min(len(note.fields), len(oldNote.fields))):
|
||||
if not keep or flds[n]["sticky"]:
|
||||
note.fields[n] = oldNote.fields[n]
|
||||
self.setAndFocusNote(note)
|
||||
|
||||
def removeTempNote(self, note: Note) -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user