From 5275fdc8a4291782a1f6bd3fcc5e107d5737121a Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 26 May 2022 14:16:35 +0300 Subject: [PATCH] kdecore: create the last directory of the special resource if it does not exist Signed-off-by: Ivailo Monev --- kdecore/kernel/kstandarddirs.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kdecore/kernel/kstandarddirs.cpp b/kdecore/kernel/kstandarddirs.cpp index f2764987..5633e283 100644 --- a/kdecore/kernel/kstandarddirs.cpp +++ b/kdecore/kernel/kstandarddirs.cpp @@ -868,7 +868,10 @@ void KStandardDirs::KStandardDirsPrivate::createSpecialResource(const char *type } else { Q_ASSERT(false); } - q->addResourceDir(type, QDir::cleanPath(resourceDir) + QLatin1Char('/'), false); + // NOTE: QStandardPaths::writableLocation() should create the base directory + const QString cleanPath = QDir::cleanPath(resourceDir) + QLatin1Char('/'); + KStandardDirs::makeDir(cleanPath, 0700); + q->addResourceDir(type, cleanPath, false); } QStringList KStandardDirs::resourceDirs(const char *type) const @@ -1238,7 +1241,7 @@ QString KStandardDirs::saveLocation(const char *type, #endif return fullPath; } - if(!makeDir(fullPath, 0700)) { + if(!KStandardDirs::makeDir(fullPath, 0700)) { return fullPath; } d->m_dircache.remove(type);