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