feat: backup window-layout (#5647)

This commit is contained in:
nerix
2024-11-24 23:39:20 +01:00
committed by GitHub
parent 9b7007beda
commit c8bafbd03e
4 changed files with 55 additions and 11 deletions
+26
View File
@@ -0,0 +1,26 @@
#pragma once
#include <QFileDevice>
#include <QString>
#include <filesystem>
namespace chatterino {
inline QString stdPathToQString(const std::filesystem::path &path)
{
#ifdef Q_OS_WIN
return QString::fromStdWString(path.native());
#else
return QString::fromStdString(path.native());
#endif
}
inline std::filesystem::path qStringToStdPath(const QString &path)
{
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
const auto *ptr = reinterpret_cast<const char16_t *>(path.utf16());
return {ptr, ptr + path.size()};
}
} // namespace chatterino