1 #include "deleteworker.h"
\r
6 DeleteWorker::DeleteWorker(QObject *parent) :
\r
7 AbstractWorker(parent),
\r
13 void DeleteWorker::operate()
\r
15 m_progressText->setText(tr("削除準備中..."));
\r
17 foreach (const QFileInfo &info, *m_DeleteList) {
\r
18 if (isStopRequested()) {
\r
22 Listup(info.absoluteFilePath());
\r
26 int successCount = 0;
\r
29 foreach (const QString &path, m_Targets) {
\r
30 if (isStopRequested()) {
\r
35 emit operation(tr("削除:") + path);
\r
37 QFileInfo info(path);
\r
40 ret = dir.rmdir(path);
\r
43 ret = QFile::remove(path);
\r
48 emit success(tr("成功"));
\r
52 emit error(tr("失敗"));
\r
55 msg = tr("%1アイテム成功。").arg(successCount);
\r
56 if (errorCount > 0) {
\r
57 msg += tr("%1アイテム失敗。").arg(errorCount);
\r
59 m_progressText->setText(msg);
\r
65 void DeleteWorker::Listup(const QString &path)
\r
67 if (isStopRequested()) {
\r
71 if (QFileInfo(path).isDir()) {
\r
73 QFileInfoList list = dir.entryInfoList(QDir::NoDotAndDotDot |
\r
79 foreach (const QFileInfo &info, list) {
\r
80 Listup(info.absoluteFilePath());
\r