qt_common init

Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
crueter 2025-07-22 16:31:36 -04:00
parent 28d26b0d76
commit 11db0f0dbf
Signed by: crueter
GPG key ID: 425ACD2D4830EBC6
56 changed files with 233 additions and 153 deletions

View file

@ -1,14 +1,15 @@
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "yuzu/configuration/configure_filesystem.h"
#include <QFileDialog>
#include <QMessageBox>
#include "common/fs/fs.h"
#include "common/fs/path_util.h"
#include "common/settings.h"
#include "qt_common/qt_common.h"
#include "qt_common/uisettings.h"
#include "ui_configure_filesystem.h"
#include "yuzu/configuration/configure_filesystem.h"
#include "yuzu/uisettings.h"
ConfigureFilesystem::ConfigureFilesystem(QWidget* parent)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureFilesystem>()) {
@ -126,19 +127,16 @@ void ConfigureFilesystem::SetDirectory(DirectoryTarget target, QLineEdit* edit)
}
void ConfigureFilesystem::ResetMetadata() {
if (!Common::FS::Exists(Common::FS::GetEdenPath(Common::FS::EdenPath::CacheDir) /
"game_list/")) {
QMessageBox::information(this, tr("Reset Metadata Cache"),
tr("The metadata cache is already empty."));
} else if (Common::FS::RemoveDirRecursively(
Common::FS::GetEdenPath(Common::FS::EdenPath::CacheDir) / "game_list")) {
QMessageBox::information(this, tr("Reset Metadata Cache"),
tr("The operation completed successfully."));
UISettings::values.is_game_list_reload_pending.exchange(true);
} else {
QMessageBox::warning(
this, tr("Reset Metadata Cache"),
tr("The metadata cache couldn't be deleted. It might be in use or non-existent."));
auto result = QtCommon::ResetMetadata();
const QString resultMessage = tr(QtCommon::GetResetMetadataResultString(result));
const QString title = tr("Reset Metadata Cache");
switch (result) {
case QtCommon::Failure:
QMessageBox::warning(this, title, resultMessage);
break;
default:
QMessageBox::information(this, title, resultMessage);
}
}