don't attempt to delete if no notes selected

This commit is contained in:
Damien Elmes 2012-08-23 19:54:55 +09:00
parent 3c9f854983
commit 6a32d870cf

View file

@ -901,10 +901,13 @@ where id in %s""" % ids2str(sf))
######################################################################
def deleteNotes(self):
nids = self.selectedNotes()
if not nids:
return
self.mw.checkpoint(_("Delete Notes"))
self.model.beginReset()
oldRow = self.form.tableView.selectionModel().currentIndex().row()
self.col.remNotes(self.selectedNotes())
self.col.remNotes(nids)
self.onSearch(reset=False)
if len(self.model.cards):
new = min(oldRow, len(self.model.cards) - 1)