Use fs::path::native whenever possible, avoid unnecessary fs->string conversions in GUI code (#1064)

* Use filesystem::path whenever possible, remove fs::path::string

* My hatred for Windows grows with every passing day

* More Qt stuff

* custom u8string formatter for fmt library

* Use u8string for imgui

* Fix toml errors hopefully

* Fix not printing issue

* Oh and on SDL

* I hate Windows even more today

* fix toml reading utf-8 paths

also small fix for fmt::UTF

* Formatting

* Fix QT path to run games

* Fix path logging in save data

* Fix trophy path handling

* Update game_list_frame.cpp

fixed snd0path

* Update main_window.cpp

fix snd0path

* Update main_window.cpp

* paths finally fixed

* git info in WIP versions title

---------

Co-authored-by: Vinicius Rangel <me@viniciusrangel.dev>
Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
This commit is contained in:
Paris Oplopoios 2024-09-26 11:41:59 +03:00 committed by GitHub
parent 54e2179337
commit 6295d6c416
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 271 additions and 125 deletions

View file

@ -3,11 +3,14 @@
#pragma once
#include "common/path_util.h"
struct GameInfo {
std::string path; // root path of game directory (normally directory that contains eboot.bin)
std::string icon_path; // path of icon0.png
std::string pic_path; // path of pic1.png
std::string snd0_path; // path of snd0.at9
std::filesystem::path path; // root path of game directory
// (normally directory that contains eboot.bin)
std::filesystem::path icon_path; // path of icon0.png
std::filesystem::path pic_path; // path of pic1.png
std::filesystem::path snd0_path; // path of snd0.at9
QImage icon;
std::string size;
// variables extracted from param.sfo
@ -44,7 +47,9 @@ public:
}
static void GetFolderSize(GameInfo& game) {
QDir dir(QString::fromStdString(game.path));
QString dirPath;
Common::FS::PathToQString(dirPath, game.path);
QDir dir(dirPath);
QDirIterator it(dir.absolutePath(), QDirIterator::Subdirectories);
qint64 total = 0;
while (it.hasNext()) {