chore: make sure autostart dir existed
mkdir if autostart dir not existed
This commit is contained in:
parent
84db7090d5
commit
571cd93382
@ -652,7 +652,14 @@ void ApplicationService::setAutoStart(bool autostart) noexcept
|
||||
return;
|
||||
}
|
||||
|
||||
auto fileName = QDir{getAutoStartDirs().first()}.filePath(m_desktopSource.desktopId() + ".desktop");
|
||||
QDir startDir (getAutoStartDirs().first());
|
||||
if (!startDir.exists() && !startDir.mkpath(startDir.path())) {
|
||||
qWarning() << "mkpath " << startDir.path() << "failed";
|
||||
safe_sendErrorReply(QDBusError::InternalError);
|
||||
return;
|
||||
}
|
||||
|
||||
auto fileName = startDir.filePath(m_desktopSource.desktopId() + ".desktop");
|
||||
QFile autostartFile{fileName};
|
||||
if (!autostartFile.open(QFile::WriteOnly | QFile::Text | QFile::Truncate)) {
|
||||
qWarning() << "open file" << fileName << "failed:" << autostartFile.error();
|
||||
|
Loading…
x
Reference in New Issue
Block a user