提交 92be51a5 编写于 作者: M manjaro-xfce

添加强制删除选项

上级 e565d8a7
......@@ -19,11 +19,19 @@ cpp_threadpool
find0xff
论坛:二维数组中找最大特征数组
https://goldenhawking.blog.csdn.net/article/details/116240710
fileLoadControl
机械盘阵高并发——使用ImDisk 与 junction显著提高整体吞吐性能
https://goldenhawking.blog.csdn.net/article/details/122093588
floodfill_mdf
作业讲评-二值矩阵避障最短路径算法
https://goldenhawking.blog.csdn.net/article/details/109411787
findfoo
大道至简-基于C的库封装发布技术
https://goldenhawking.blog.csdn.net/article/details/119845838
huarongdao
广度优先求解算法演示(华容道C++代码,速度2644组/秒)
https://goldenhawking.blog.csdn.net/article/details/112414933
......
......@@ -5,6 +5,7 @@
#include <QFile>
#include <thread>
#include <QThread>
#include <QProcess>
#include <atomic>
DialogFileLoadCtrl::DialogFileLoadCtrl(QWidget *parent)
: QDialog(parent)
......@@ -60,15 +61,34 @@ void DialogFileLoadCtrl::cleanFile()
assert(m_total_size >= ifi.size());
if (false==QFile::remove(fm))
{
QString msg = tr("Fail Deleting %1.").arg(fm);
QString msg = tr("Force Deleting %1.").arg(fm);
//Force Delete Using https://github.com/michaelknigge/forcedel
for (int ntr = 0; ntr < 10 && QFileInfo::exists(fm); ++ntr)
{
QThread::msleep(200);
QStringList args;
#ifdef __gnu_linux__
args<<"-f";
args<<fm;
QProcess::execute("rm",args);
#else
args<<fm;
QProcess::execute("ForceDel.exe",args);
#endif
}
slot_msg(msg);
}
else
if (!QFileInfo::exists(fm))
{
m_total_size -= ifi.size();
QString msg = tr("Succ Deleting %1.").arg(fm);
slot_msg(msg);
}
else
{
QString msg = tr("Fail Deleting %1.").arg(fm);
slot_msg(msg);
}
mp.remove(fm);
if (!mp.size())
m_cache_files.erase(tmf);
......
......@@ -9,108 +9,113 @@
<translation>文件拷贝与配额控制</translation>
</message>
<message>
<location filename="dialogfileloadctrl.ui" line="22"/>
<location filename="dialogfileloadctrl.ui" line="41"/>
<source>Watching Folder</source>
<translation>配额文件夹</translation>
</message>
<message>
<location filename="dialogfileloadctrl.ui" line="32"/>
<location filename="dialogfileloadctrl.ui" line="53"/>
<location filename="dialogfileloadctrl.ui" line="51"/>
<location filename="dialogfileloadctrl.ui" line="72"/>
<source>...</source>
<translation>...</translation>
</message>
<message>
<location filename="dialogfileloadctrl.ui" line="43"/>
<location filename="dialogfileloadctrl.ui" line="62"/>
<source>Destin Folder</source>
<translation>目的文件夹</translation>
</message>
<message>
<location filename="dialogfileloadctrl.ui" line="64"/>
<location filename="dialogfileloadctrl.ui" line="83"/>
<source>Backup files with Size From</source>
<translation>备份大小介于</translation>
</message>
<message>
<location filename="dialogfileloadctrl.ui" line="90"/>
<location filename="dialogfileloadctrl.ui" line="109"/>
<source>MB To</source>
<translation>MB </translation>
</message>
<message>
<location filename="dialogfileloadctrl.ui" line="116"/>
<location filename="dialogfileloadctrl.ui" line="135"/>
<source>MB</source>
<translation>MB的文件</translation>
</message>
<message>
<location filename="dialogfileloadctrl.ui" line="136"/>
<location filename="dialogfileloadctrl.ui" line="155"/>
<source>Total Keep Load</source>
<translation>配额空间</translation>
</message>
<message>
<location filename="dialogfileloadctrl.ui" line="162"/>
<location filename="dialogfileloadctrl.ui" line="181"/>
<source>GB</source>
<translation>GB</translation>
</message>
<message>
<location filename="dialogfileloadctrl.ui" line="173"/>
<location filename="dialogfileloadctrl.ui" line="192"/>
<source>File Typs(| splitted, : mean empty)</source>
<translation>备份文件类型(|分割,:表示空扩展名)</translation>
</message>
<message>
<location filename="dialogfileloadctrl.ui" line="183"/>
<location filename="dialogfileloadctrl.ui" line="202"/>
<source>Running</source>
<translation>运行开关</translation>
</message>
<message>
<location filename="dialogfileloadctrl.ui" line="190"/>
<location filename="dialogfileloadctrl.ui" line="213"/>
<source>.</source>
<translation>.</translation>
</message>
<message>
<location filename="dialogfileloadctrl.cpp" line="18"/>
<location filename="dialogfileloadctrl.cpp" line="19"/>
<source>Program Started</source>
<translation>程序启动</translation>
</message>
<message>
<location filename="dialogfileloadctrl.cpp" line="34"/>
<location filename="dialogfileloadctrl.cpp" line="35"/>
<source>Start maintaining.</source>
<translation>开始维护.</translation>
</message>
<message>
<location filename="dialogfileloadctrl.cpp" line="40"/>
<location filename="dialogfileloadctrl.cpp" line="41"/>
<source>Completed.</source>
<translation>完成.</translation>
</message>
<message>
<location filename="dialogfileloadctrl.cpp" line="63"/>
<location filename="dialogfileloadctrl.cpp" line="89"/>
<source>Fail Deleting %1.</source>
<translation>删除文件失败:%1.</translation>
</message>
<message>
<location filename="dialogfileloadctrl.cpp" line="69"/>
<location filename="dialogfileloadctrl.cpp" line="64"/>
<source>Force Deleting %1.</source>
<translation>强制删除文件:%1.</translation>
</message>
<message>
<location filename="dialogfileloadctrl.cpp" line="84"/>
<source>Succ Deleting %1.</source>
<translation>删除文件成功:%1.</translation>
</message>
<message>
<location filename="dialogfileloadctrl.cpp" line="125"/>
<location filename="dialogfileloadctrl.cpp" line="146"/>
<source>Enuming %1 Files %2 Bytes.</source>
<translation>当前枚举到 %1 个文件占用 %2 字节.</translation>
</message>
<message>
<location filename="dialogfileloadctrl.cpp" line="158"/>
<location filename="dialogfileloadctrl.cpp" line="179"/>
<source>Succ Copy %1 to %2.</source>
<translation>备份文件成功:%1 %2.</translation>
</message>
<message>
<location filename="dialogfileloadctrl.cpp" line="160"/>
<location filename="dialogfileloadctrl.cpp" line="181"/>
<source>Fail Copy %1 to %2.</source>
<translation>备份文件失败:%1 %2.</translation>
</message>
<message>
<location filename="dialogfileloadctrl.cpp" line="215"/>
<location filename="dialogfileloadctrl.cpp" line="239"/>
<source>Watching root</source>
<translation>配额监视根文件夹</translation>
</message>
<message>
<location filename="dialogfileloadctrl.cpp" line="225"/>
<location filename="dialogfileloadctrl.cpp" line="249"/>
<source>backup root</source>
<translation>备份目的根文件夹</translation>
</message>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册