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
No related tags found
No related merge requests found
......@@ -38,6 +38,9 @@
#include <QJsonDocument>
#include <fstream>
#if !defined(Q_OS_LINUX) || __GNUC__ > 8
#include <filesystem>
#endif
#include <thread>
#include <cstring>
......@@ -292,9 +295,13 @@ setProfile(const QString& accountId, const api::profile::Info& profileInfo, cons
QFileInfo fileInfo(path);
auto dir = fileInfo.dir();
if (!dir.exists()) {
#if !defined(Q_OS_LINUX) || __GNUC__ > 8
if (!std::filesystem::create_directory(dir.path().toStdString())) {
#endif
qWarning() << "Cannot create " << dir.path();
#if !defined(Q_OS_LINUX) || __GNUC__ > 8
}
#endif
}
if (!lf.lock()) {
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