mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-23 13:37:04 +02:00
[desktop] More qt_common reorganization (#3916)
Ported from QML branch. Main "big" change is that EmuThread is now a shared state in QtCommon, not individually managed/passed around by GRenderWindow and MainWindow. Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3916 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
This commit is contained in:
parent
300a646a34
commit
feb8c5f88e
44 changed files with 963 additions and 932 deletions
|
|
@ -63,27 +63,31 @@ DataWidget::DataWidget(FrontendCommon::DataManager::DataDir data_dir,
|
|||
|
||||
void DataWidget::clear() {
|
||||
std::optional<std::string> user_id = selectProfile();
|
||||
if (!user_id) return;
|
||||
if (!user_id)
|
||||
return;
|
||||
QtCommon::Content::ClearDataDir(m_dir, user_id.value());
|
||||
scan();
|
||||
}
|
||||
|
||||
void DataWidget::open() {
|
||||
std::optional<std::string> user_id = selectProfile();
|
||||
if (!user_id) return;
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(
|
||||
QString::fromStdString(FrontendCommon::DataManager::GetDataDirString(m_dir, user_id.value()))));
|
||||
if (!user_id)
|
||||
return;
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(
|
||||
FrontendCommon::DataManager::GetDataDirString(m_dir, user_id.value()))));
|
||||
}
|
||||
|
||||
void DataWidget::upload() {
|
||||
std::optional<std::string> user_id = selectProfile();
|
||||
if (!user_id) return;
|
||||
if (!user_id)
|
||||
return;
|
||||
QtCommon::Content::ExportDataDir(m_dir, user_id.value(), m_exportName);
|
||||
}
|
||||
|
||||
void DataWidget::download() {
|
||||
std::optional<std::string> user_id = selectProfile();
|
||||
if (!user_id) return;
|
||||
if (!user_id)
|
||||
return;
|
||||
QtCommon::Content::ImportDataDir(m_dir, user_id.value(), std::bind(&DataWidget::scan, this));
|
||||
}
|
||||
|
||||
|
|
@ -107,7 +111,8 @@ std::optional<std::string> DataWidget::selectProfile() {
|
|||
std::string user_id{};
|
||||
if (m_dir == FrontendCommon::DataManager::DataDir::Saves) {
|
||||
user_id = GetProfileIDString();
|
||||
if (user_id.empty()) return std::nullopt;
|
||||
if (user_id.empty())
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return user_id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue