Skip to content
Snippets Groups Projects
Commit e481bb4e authored by Sébastien Blin's avatar Sébastien Blin
Browse files

storagehelper: include filesystem

Change-Id: I1db1553cc1f9078b8e33e99cadb7a8d842bf024c
parent 9a123fca
Branches
Tags
No related merge requests found
...@@ -38,6 +38,9 @@ ...@@ -38,6 +38,9 @@
#include <QJsonDocument> #include <QJsonDocument>
#include <fstream> #include <fstream>
#if !defined(Q_OS_LINUX) || __GNUC__ > 8
#include <filesystem>
#endif
#include <thread> #include <thread>
#include <cstring> #include <cstring>
...@@ -292,9 +295,13 @@ setProfile(const QString& accountId, const api::profile::Info& profileInfo, cons ...@@ -292,9 +295,13 @@ setProfile(const QString& accountId, const api::profile::Info& profileInfo, cons
QFileInfo fileInfo(path); QFileInfo fileInfo(path);
auto dir = fileInfo.dir(); auto dir = fileInfo.dir();
if (!dir.exists()) { if (!dir.exists()) {
#if !defined(Q_OS_LINUX) || __GNUC__ > 8
if (!std::filesystem::create_directory(dir.path().toStdString())) { if (!std::filesystem::create_directory(dir.path().toStdString())) {
#endif
qWarning() << "Cannot create " << dir.path(); qWarning() << "Cannot create " << dir.path();
#if !defined(Q_OS_LINUX) || __GNUC__ > 8
} }
#endif
} }
if (!lf.lock()) { if (!lf.lock()) {
qWarning().noquote() << "Can't lock file for writing: " << file.fileName(); qWarning().noquote() << "Can't lock file for writing: " << file.fileName();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment