move unused media to trash too

This commit is contained in:
Damien Elmes 2013-05-23 13:42:31 +09:00
parent 97a342ae23
commit 2655dcf649

View file

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import os, sys, re, traceback, signal import os, sys, re, traceback, signal, send2trash
import zipfile import zipfile
from aqt.qt import * from aqt.qt import *
@ -923,7 +923,7 @@ will be lost. Continue?"""))
mdir = self.col.media.dir() mdir = self.col.media.dir()
for f in unused: for f in unused:
path = os.path.join(mdir, f) path = os.path.join(mdir, f)
os.unlink(path) send2trash.send2trash(path)
tooltip(_("Deleted.")) tooltip(_("Deleted."))
diag.close() diag.close()