up:基本验证逻辑完成。

This commit is contained in:
2025-11-06 23:12:13 +08:00
parent d92ab6c029
commit 648fca13c5
12 changed files with 62 additions and 19 deletions

View File

@@ -6,6 +6,7 @@
#include <QFileInfo>
#include <QMutex>
#include <QStandardPaths>
#include <QUuid>
#include <fversion.h>
#include <iostream>
#include <spdlog/fmt/bundled/color.h>
@@ -130,9 +131,27 @@ bool Util::FileExist(const QString& path)
return QFile::exists(path);
}
bool Util::DirExist(const QString& path)
bool Util::DirExist(const QString& path, bool isFilePath)
{
return QDir(path).exists();
if (path.isEmpty()) {
return false;
}
QString dirPath = path;
if (isFilePath) {
QFileInfo fileInfo(path);
dirPath = fileInfo.absolutePath();
} else {
QFileInfo dirInfo(path);
dirPath = dirInfo.absoluteFilePath();
}
QDir dir(dirPath);
return dir.exists();
}
QString Util::UUID()
{
return QUuid::createUuid().toString().remove("{").remove("}");
}
QString DirFileHelper::GetErr() const