Provide UI Theme editor

PR #18655.
This commit is contained in:
Vladimir Golovnev 2023-03-16 10:03:05 +03:00 committed by GitHub
parent 989b1e6c2c
commit 77aa85fbd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1381 additions and 380 deletions

View file

@ -37,6 +37,7 @@
#include <QString>
#include "base/path.h"
#include "base/utils/fs.h"
Utils::IO::FileDeviceOutputIterator::FileDeviceOutputIterator(QFileDevice &device, const int bufferSize)
: m_device {&device}
@ -70,6 +71,8 @@ Utils::IO::FileDeviceOutputIterator &Utils::IO::FileDeviceOutputIterator::operat
nonstd::expected<void, QString> Utils::IO::saveToFile(const Path &path, const QByteArray &data)
{
if (const Path parentPath = path.parentPath(); !parentPath.isEmpty())
Utils::Fs::mkpath(parentPath);
QSaveFile file {path.data()};
if (!file.open(QIODevice::WriteOnly) || (file.write(data) != data.size()) || !file.flush() || !file.commit())
return nonstd::make_unexpected(file.errorString());