Skip to content

Commit

Permalink
fix: UOS非AD域名帐户删除AD域名账户后home目录下的AD域账户目录没有同步删除
Browse files Browse the repository at this point in the history
daemon删除用户目录后dconfig-daemon创建了指定用户路径
修改为当用户目录不存在时不进行相应操作,避免错误的创建目录

Log: 修复UOS非AD域名帐户删除AD域名账户后home目录下的AD域账户目录没有同步删除
Influence: 控制中心-账户-删除用户目录
Bug: https://pms.uniontech.com/bug-view-185841.html
Change-Id: Ibe6dd08b0227bc41beef66834d519c30b4e8f7ef
  • Loading branch information
robertkill authored and Whale107 committed May 30, 2024
1 parent cae3ff7 commit 610b963
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dconfigfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ class Q_DECL_HIDDEN DConfigCacheImpl : public DConfigCache {
homePath = DStandardPaths::homePath(getuid());
}

if (homePath.isEmpty())
if (homePath.isEmpty() || !QDir().exists(homePath))
return QString();

// fallback to default application cache directory.
Expand Down Expand Up @@ -1212,7 +1212,7 @@ bool DConfigCacheImpl::save(const QString &localPrefix, QJsonDocument::JsonForma
cacheChanged = false;
const QString &dir = getCacheDir(localPrefix);
if (dir.isEmpty()) {
qCWarning(cfLog, "Falied on saveing, the config cache directory is empty for the user[%d], "
qCWarning(cfLog, "Failed on saving, the config cache directory is empty for the user[%d], "
"the current user[%d].", userid, getuid());
return false;
}
Expand All @@ -1224,7 +1224,7 @@ bool DConfigCacheImpl::save(const QString &localPrefix, QJsonDocument::JsonForma
}

if (!cache.open(QIODevice::WriteOnly)) {
qCWarning(cfLog, "Falied on saveing data when open file: \"%s\", error message: \"%s\"",
qCWarning(cfLog, "Failed on saving data when open file: \"%s\", error message: \"%s\"",
qPrintable(cache.fileName()), qPrintable(cache.errorString()));
return false;
}
Expand Down

0 comments on commit 610b963

Please sign in to comment.