mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-09 23:57:59 +00:00
qt fix for freebsd
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
b612d8e9e3
commit
4226341ef8
|
|
@ -2,6 +2,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include <filesystem>
|
||||
#include <system_error>
|
||||
#include <JlCompress.h>
|
||||
#include "frontend_common/mod_manager.h"
|
||||
#include "mod.h"
|
||||
|
|
@ -83,8 +84,9 @@ QStringList GetModFolders(const QString& root, const QString& fallbackName) {
|
|||
// now make a temp directory...
|
||||
const auto mod_dir = fs::temp_directory_path() / "eden" / "mod" / name.toStdString();
|
||||
const auto tmp = mod_dir / to_make;
|
||||
fs::remove_all(mod_dir);
|
||||
if (!fs::create_directories(tmp)) {
|
||||
std::error_code ec;
|
||||
fs::remove_all(mod_dir, ec);
|
||||
if (!fs::create_directories(tmp, ec)) {
|
||||
LOG_ERROR(Frontend, "Failed to create temporary directory {}", tmp.string());
|
||||
return {};
|
||||
}
|
||||
|
|
@ -115,13 +117,13 @@ QStringList GetModFolders(const QString& root, const QString& fallbackName) {
|
|||
// TODO(crueter): Make this a common extract_to_tmp func
|
||||
const QString ExtractMod(const QString& path) {
|
||||
namespace fs = std::filesystem;
|
||||
fs::path tmp{fs::temp_directory_path() / "eden" / "unzip_mod"};
|
||||
|
||||
fs::remove_all(tmp);
|
||||
if (!fs::create_directories(tmp)) {
|
||||
fs::path tmp{fs::temp_directory_path() / "eden" / "modzip"};
|
||||
std::error_code ec;
|
||||
fs::remove_all(tmp, ec);
|
||||
if (!fs::create_directories(tmp, ec)) {
|
||||
QtCommon::Frontend::Critical(tr("Mod Extract Failed"),
|
||||
tr("Failed to create temporary directory %1")
|
||||
.arg(QString::fromStdString(tmp.string())));
|
||||
tr("Failed to create temporary directory %1")
|
||||
.arg(QString::fromStdString(tmp.string())));
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue