chore: initialize client repository

This commit is contained in:
2026-07-09 09:17:30 +00:00
commit b06e003502
44 changed files with 7225 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
#include "FileHelper.h"
#include <QDebug>
bool FileHelper::createDir(const QString &path)
{
QDir dir(path);
if (!dir.exists())
return dir.mkpath(".");
return true;
}
bool FileHelper::copyFileOverwrite(const QString &src, const QString &dst)
{
if (QFile::exists(dst))
{
if (!QFile::remove(dst))
{
qDebug() << "无法删除旧文件:" << dst;
return false;
}
}
return QFile::copy(src, dst);
}
bool FileHelper::isProcessRunning(const QString &exeName)
{
QProcess process;
process.start("tasklist");
process.waitForFinished();
QString output = process.readAllStandardOutput();
return output.contains(exeName, Qt::CaseInsensitive);
}
bool FileHelper::killProcess(const QString &exeName)
{
if (!isProcessRunning(exeName))
return true;
QProcess process;
process.start("taskkill /f /im " + exeName);
process.waitForFinished(1000);
return !isProcessRunning(exeName);
}