diff --git a/dconfig-center/dde-dconfig-daemon/dconfig_global.h b/dconfig-center/dde-dconfig-daemon/dconfig_global.h index edda033..a9ea532 100644 --- a/dconfig-center/dde-dconfig-daemon/dconfig_global.h +++ b/dconfig-center/dde-dconfig-daemon/dconfig_global.h @@ -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/(?([a-z0-9\s\-_\@\-\^!#$%&.]+\/)?)(?([a-z0-9\s\-_\@\-\^!#$%&.]+\/)*)(?[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/)(?([a-z0-9\s\-_\@\-\^!#$%&.]+\/)?)(?([a-z0-9\s\-_\@\-\^!#$%&.]+\/)*)(?[a-z0-9\s\-_\@\-\^!#$%&.]+).json$)"); QRegularExpressionMatch match; match = usrReg.match(path); diff --git a/dconfig-center/dde-dconfig-daemon/dconfigserver.cpp b/dconfig-center/dde-dconfig-daemon/dconfigserver.cpp index cd798bc..44efd78 100644 --- a/dconfig-center/dde-dconfig-daemon/dconfigserver.cpp +++ b/dconfig-center/dde-dconfig-daemon/dconfigserver.cpp @@ -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()) {