send to trash when deleting profile
This commit is contained in:
parent
2655dcf649
commit
aa0cac1ed3
@ -14,6 +14,7 @@ from anki.lang import langs
|
||||
from aqt.utils import showWarning
|
||||
from aqt import appHelpSite
|
||||
import aqt.forms
|
||||
from send2trash import send2trash
|
||||
|
||||
metaConf = dict(
|
||||
ver=0,
|
||||
@ -120,7 +121,9 @@ documentation for information on using a flash drive.""")
|
||||
self.db.commit()
|
||||
|
||||
def remove(self, name):
|
||||
shutil.rmtree(self.profileFolder())
|
||||
p = self.profileFolder()
|
||||
if os.path.exists(p):
|
||||
send2trash(p)
|
||||
self.db.execute("delete from profiles where name = ?",
|
||||
name.encode("utf8"))
|
||||
self.db.commit()
|
||||
|
Loading…
Reference in New Issue
Block a user