Skip to content

Commit

Permalink
feat: Unable to set timer reminder in Linglong environment
Browse files Browse the repository at this point in the history
玲珑环境会将家目录config进行隔离, 无法在此创建systemd服务
检测玲珑环境并修正config路径位置

Log:
  • Loading branch information
myml committed Aug 14, 2024
1 parent f868a6a commit ab885f7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion calendar-service/src/csystemdtimercontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "commondef.h"
#include "units.h"
#include <qloggingcategory.h>

#include <QDir>
#include <QStandardPaths>
Expand Down Expand Up @@ -231,8 +232,14 @@ void CSystemdTimerControl::stopUploadTask()
void CSystemdTimerControl::createPath()
{
m_systemdPath = getHomeConfigPath().append("/systemd/user/");
// 如果位于玲珑环境, 更改systemd path路径
QString linglongAppID = qgetenv("LINGLONG_APPID");
if (!linglongAppID.isEmpty()) {
m_systemdPath = "/run/host/rootfs" + m_systemdPath;
qCInfo(ServiceLogger) << "In Linglong environment, change the systemd path to " << m_systemdPath;
}
QDir dir;
//如果该路径不存在,则创建该文件夹
// 如果该路径不存在,则创建该文件夹
if (!dir.exists(m_systemdPath)) {
dir.mkpath(m_systemdPath);
}
Expand Down

0 comments on commit ab885f7

Please sign in to comment.