chore(ios): minor code cleanup

Signed-off-by: rooot <hey@rooot.gay>
This commit is contained in:
rooot 2025-03-15 21:01:57 +01:00
parent 3938ad4727
commit e4aa9a556a
No known key found for this signature in database
GPG key ID: 3582D7B034FF964F
2 changed files with 6 additions and 10 deletions
loader/src
internal
platform/ios

View file

@ -1,7 +1,6 @@
#include "crashlog.hpp"
#include <fmt/core.h>
#include "about.hpp"
#include "../loader/ModImpl.hpp"
#include <Geode/Utils.hpp>
using namespace geode::prelude;
@ -43,11 +42,11 @@ void crashlog::printMods(std::stringstream& stream) {
using namespace std::string_view_literals;
for (auto& mod : mods) {
stream << fmt::format("{} | [{}] {}\n",
mod->isCurrentlyLoading() ? "o"sv :
mod->isEnabled() ? "x"sv :
mod->isCurrentlyLoading() ? "o"sv :
mod->isEnabled() ? "x"sv :
mod->hasLoadProblems() ? "!"sv : // thank you for this bug report
mod->targetsOutdatedVersion() ? "*"sv : // thank you very much for this bug report
mod->shouldLoad() ? "~"sv :
mod->shouldLoad() ? "~"sv :
" "sv,
mod->getVersion().toVString(), mod->getID()
);
@ -66,7 +65,7 @@ std::string crashlog::writeCrashlog(geode::Mod* faultyMod, std::string const& in
// add a file to let Geode know on next launch that it crashed previously
// this could also be done by saving a loader setting or smth but eh.
(void)utils::file::writeBinary(crashlog::getCrashLogDirectory() / "last-crashed", {});
std::stringstream file;
file << getDateString(false) << "\n"

View file

@ -32,7 +32,7 @@ std::string utils::clipboard::read() {
void utils::web::openLinkInBrowser(std::string const& url) {
[[UIApplication sharedApplication]
openURL:[NSURL URLWithString:[NSString stringWithUTF8String:url.c_str()]]];
openURL:[NSURL URLWithString:[NSString stringWithUTF8String:url.c_str()]] options:{} completionHandler:nil];
}
#pragma region Folder Pick Delegate
@ -81,10 +81,7 @@ UIViewController* getCurrentViewController() {
}
bool utils::file::openFolder(std::filesystem::path const& path) {
std::string newPath = fmt::format("shareddocuments://{}", path);
if (getenv("GEODEINJECT_LOADED")) {
newPath = fmt::format("filza://{}", path);
}
std::string newPath = fmt::format("{}://{}", getenv("GEODEINJECT_LOADED") ? "filza" : "shareddocuments", path);
NSURL *url = [NSURL URLWithString:[NSString stringWithUTF8String:newPath.c_str()]];
if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];