mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Try creating base dir in FileWriteDescriptor.
This commit is contained in:
parent
99111cc1cc
commit
e4e1f7f5d6
1 changed files with 8 additions and 1 deletions
|
@ -197,7 +197,14 @@ bool FileWriteDescriptor::open(File &file, char postfix) {
|
|||
|
||||
bool FileWriteDescriptor::writeHeader(QFileDevice &file) {
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
return false;
|
||||
const auto dir = QDir(_basePath);
|
||||
if (dir.exists()) {
|
||||
return false;
|
||||
} else if (!QDir().mkpath(dir.absolutePath())) {
|
||||
return false;
|
||||
} else if (!file.open(QIODevice::WriteOnly)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
file.write(TdfMagic, TdfMagicLen);
|
||||
const auto version = qint32(AppVersion);
|
||||
|
|
Loading…
Add table
Reference in a new issue