From 3f2136c49d9609f412af6c1918e2af699f5856b9 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sun, 23 May 2021 01:40:50 +0200 Subject: [PATCH] [kcm/autostart] Fix loading and adding logout scripts m_xdgConfigPath.filePath(QStringLiteral("/plasma-workspace/shutdown/")) resolves to /plasma-workspace/shutdown/ Remove the leading slash to make it work properly --- kcms/autostart/autostartmodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kcms/autostart/autostartmodel.cpp b/kcms/autostart/autostartmodel.cpp index 777e2b3f0..f5c61bcae 100644 --- a/kcms/autostart/autostartmodel.cpp +++ b/kcms/autostart/autostartmodel.cpp @@ -126,9 +126,9 @@ void AutostartModel::load() m_entries.append(scriptEntries); - loadScriptsFromDir(QStringLiteral("/plasma-workspace/env/"), AutostartModel::AutostartEntrySource::PlasmaEnvScripts); + loadScriptsFromDir(QStringLiteral("plasma-workspace/env/"), AutostartModel::AutostartEntrySource::PlasmaEnvScripts); - loadScriptsFromDir(QStringLiteral("/plasma-workspace/shutdown/"), AutostartModel::AutostartEntrySource::PlasmaShutdown); + loadScriptsFromDir(QStringLiteral("plasma-workspace/shutdown/"), AutostartModel::AutostartEntrySource::PlasmaShutdown); endResetModel(); } @@ -322,7 +322,7 @@ void AutostartModel::addScript(const QUrl &url, AutostartModel::AutostartEntrySo AutostartScriptDesktopFile desktopFile(fileName, file.filePath()); insertScriptEntry(lastLoginScript + 1, fileName, desktopFile.fileName(), kind); } else if (kind == AutostartModel::AutostartEntrySource::PlasmaShutdown) { - const QUrl destinationScript = QUrl::fromLocalFile(QDir(m_xdgConfigPath.filePath(QStringLiteral("/plasma-workspace/shutdown/"))).filePath(fileName)); + const QUrl destinationScript = QUrl::fromLocalFile(QDir(m_xdgConfigPath.filePath(QStringLiteral("plasma-workspace/shutdown/"))).filePath(fileName)); KIO::CopyJob *job = KIO::link(url, destinationScript, KIO::HideProgressInfo); job->setAutoRename(true); job->setProperty("finalUrl", destinationScript);