From 04721c64786cc196bd8242dff93984bb023e6cf3 Mon Sep 17 00:00:00 2001 From: "S. Razi Alavizadeh" Date: Fri, 3 Oct 2014 00:34:09 +0330 Subject: [PATCH] Make sure the Config and Temp pathes exist. - Closes #1479 --- src/lib/app/datapaths.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib/app/datapaths.cpp b/src/lib/app/datapaths.cpp index c7ef68843..2570ca224 100644 --- a/src/lib/app/datapaths.cpp +++ b/src/lib/app/datapaths.cpp @@ -51,6 +51,11 @@ void DataPaths::setPortableVersion() d->m_paths[Temp] = d->m_paths[Config]; d->m_paths[Temp].first().append(QLatin1String("/tmp")); + + // Make sure the Config and Temp pathes exist + QDir dir; + dir.mkpath(m_paths[Config].first()); + dir.mkpath(m_paths[Temp].first()); } // static @@ -134,10 +139,6 @@ void DataPaths::init() m_paths[Config].append(confPath.absolutePath()); } - // Make sure the Config path exists - QDir dir; - dir.mkpath(m_paths[Config].first()); - // Profiles m_paths[Profiles].append(m_paths[Config].first() + QLatin1String("/profiles")); @@ -151,6 +152,11 @@ void DataPaths::init() m_paths[Temp].append(m_paths[Config].first() + QLatin1String("/tmp")); #endif + // Make sure the Config and Temp pathes exist + QDir dir; + dir.mkpath(m_paths[Config].first()); + dir.mkpath(m_paths[Temp].first()); + // We also allow to load data from Config path m_paths[Translations].append(m_paths[Config].first() + QLatin1String("/locale")); m_paths[Themes].append(m_paths[Config].first() + QLatin1String("/themes"));