Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dconfig-center/dde-dconfig-daemon/dconfig_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ inline ConfigureId getMetaConfigureId(const QString &path)
{
ConfigureId info;
// /usr/share/dsg/configs/[$appid]/[$subpath]/$resource.json
static QRegularExpression usrReg(R"(/configs/(?<appid>([a-z0-9\s\-_\@\-\^!#$%&.]+\/)?)(?<subpath>([a-z0-9\s\-_\@\-\^!#$%&.]+\/)*)(?<resource>[a-z0-9\s\-_\@\-\^!#$%&.]+).json$)");
// Use negative lookahead (?!overrides/) to exclude override paths which should be handled by getOverrideConfigureId
static QRegularExpression usrReg(R"(/configs/(?!overrides/)(?<appid>([a-z0-9\s\-_\@\-\^!#$%&.]+\/)?)(?<subpath>([a-z0-9\s\-_\@\-\^!#$%&.]+\/)*)(?<resource>[a-z0-9\s\-_\@\-\^!#$%&.]+).json$)");

QRegularExpressionMatch match;
match = usrReg.match(path);
Expand Down
8 changes: 2 additions & 6 deletions dconfig-center/dde-dconfig-daemon/dconfigserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,8 @@ ResourceKey DSGConfigServer::getResourceKeyByConfigCache(const ConfigCacheKey &k

ConfigureId DSGConfigServer::getConfigureIdByPath(const QString &path)
{
QFileInfo fileInfo(path);
if (!fileInfo.exists()) {
return ConfigureId();
}

const auto &absolutePath = fileInfo.absoluteFilePath();
// Use absolute path for parsing, file may not exist (e.g., when deleted)
const auto &absolutePath = QFileInfo(path).absoluteFilePath();

auto res = getMetaConfigureId(absolutePath);
if (res.isInValid()) {
Expand Down
Loading