- Gui rewrite.

- Gui: Bug fixes and cleanup.
- Gui: Performance improvement (loading, resizing...etc)
- Added a simple PKG Viewer(Settings-> Utils -> PKG Viewer), added pkg folders will be saved.
- PKG Viewer: Shows game info(name, id, region...etc)
- PKG Viewer: Right click -> Install PKG to install/extract a game. Patch installation is also possible.
- Added option to dump game list  (Settings -> Utils -> Dump Game List), will be dumped to emu folder GameList.txt
This commit is contained in:
raziel1000 2024-03-28 23:43:46 -06:00 committed by Jonah
parent 2d0414c365
commit ca6f582ea8
28 changed files with 1315 additions and 1744 deletions

View file

@ -14,12 +14,23 @@ public:
static const QStringList suffixes = {"B", "KB", "MB", "GB", "TB"};
int suffixIndex = 0;
while (size >= 1024 && suffixIndex < suffixes.size() - 1) {
size /= 1024;
double gameSize = static_cast<double>(size);
while (gameSize >= 1024 && suffixIndex < suffixes.size() - 1) {
gameSize /= 1024;
++suffixIndex;
}
return QString("%1 %2").arg(size).arg(suffixes[suffixIndex]);
// Format the size with a specified precision
QString sizeString;
if (gameSize < 10.0) {
sizeString = QString::number(gameSize, 'f', 2);
} else if (gameSize < 100.0) {
sizeString = QString::number(gameSize, 'f', 1);
} else {
sizeString = QString::number(gameSize, 'f', 0);
}
return sizeString + " " + suffixes[suffixIndex];
}
static QString GetFolderSize(const QDir& dir) {
@ -32,7 +43,7 @@ public:
if (it.fileInfo().isFile()) {
total += it.fileInfo().size();
}
it.next();
it.next(); // this is heavy.
}
// if there is a file left "at the end" get it's size