diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-11-21 16:21:40 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-11-21 15:55:36 +0000 |
commit | 2734613df1b5dd73e1f9c1f80c661556d8620faf (patch) | |
tree | 089969e90ea432eb9eab9130b578de19ba2da7d1 | |
parent | f469615fa1083ede58ec8603447b5feadaa83bd8 (diff) |
Create the config directory when it does not exist
Change-Id: I5760ec8f4fe118dbc0c6d5f6064c18feff427e73
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r-- | src/sensehat/qsensehatsensors.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sensehat/qsensehatsensors.cpp b/src/sensehat/qsensehatsensors.cpp index 3d159a8..ce0e098 100644 --- a/src/sensehat/qsensehatsensors.cpp +++ b/src/sensehat/qsensehatsensors.cpp @@ -99,10 +99,12 @@ void QSenseHatSensorsPrivate::open() if (!flags.testFlag(QSenseHatSensors::DontCopyIniFile)) { if (!QFile::exists(writableConfig)) { qCDebug(qLcSH) << "Copying" << defaultConfig << "to" << writableConfig; - if (QFile::exists(defaultConfig)) + if (QFile::exists(defaultConfig)) { + QDir(QStringLiteral("/")).mkpath(writableConfigDir); QFile::copy(defaultConfig, writableConfig); - else + } else { qWarning("/etc/RTIMULib.ini not found, sensors may not be functional"); + } } QByteArray dirName = writableConfigDir.toUtf8(); settings = new RTIMUSettings(dirName.constData(), "RTIMULib"); |