From 2c0bdcf67810f3fa491c718dcde1145caa2ffba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 10 Feb 2026 11:34:59 +0100 Subject: [PATCH] InstallZipScreen improvements, small cleanup --- Common/File/PathBrowser.cpp | 2 +- Common/GPU/OpenGL/GLQueueRunner.cpp | 2 +- Common/Log/ConsoleListener.cpp | 2 +- Common/Thread/ParallelLoop.cpp | 4 ++-- Common/Thread/ThreadManager.cpp | 2 +- UI/InstallZipScreen.cpp | 18 ++++++++++++------ 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Common/File/PathBrowser.cpp b/Common/File/PathBrowser.cpp index 3f1a26fa1b..008e0f5394 100644 --- a/Common/File/PathBrowser.cpp +++ b/Common/File/PathBrowser.cpp @@ -152,7 +152,7 @@ void PathBrowser::HandlePath() { if (pendingThread_.joinable()) return; - pendingThread_ = std::thread([&] { + pendingThread_ = std::thread([this] { SetCurrentThreadName("PathBrowser"); AndroidJNIThreadContext jniContext; // destructor detaches diff --git a/Common/GPU/OpenGL/GLQueueRunner.cpp b/Common/GPU/OpenGL/GLQueueRunner.cpp index 803e22d2f1..e85d830e5a 100644 --- a/Common/GPU/OpenGL/GLQueueRunner.cpp +++ b/Common/GPU/OpenGL/GLQueueRunner.cpp @@ -59,7 +59,7 @@ void GLQueueRunner::CreateDeviceObjects() { // Populate some strings from the GL thread so they can be queried from thin3d. // TODO: Merge with GLFeatures.cpp/h - auto populate = [&](int name) { + auto populate = [this](int name) { const GLubyte *value = glGetString(name); if (!value) glStrings_[name] = "?"; diff --git a/Common/Log/ConsoleListener.cpp b/Common/Log/ConsoleListener.cpp index 1e48743f83..dd1feeaf4c 100644 --- a/Common/Log/ConsoleListener.cpp +++ b/Common/Log/ConsoleListener.cpp @@ -124,7 +124,7 @@ void ConsoleListener::Open() { } if (useThread_ && hTriggerEvent != NULL && !thread_.joinable()) { - thread_ = std::thread([&] { + thread_ = std::thread([this] { SetCurrentThreadName("Console"); LogWriterThread(); }); diff --git a/Common/Thread/ParallelLoop.cpp b/Common/Thread/ParallelLoop.cpp index 4f4036d4e3..25fbaddbe4 100644 --- a/Common/Thread/ParallelLoop.cpp +++ b/Common/Thread/ParallelLoop.cpp @@ -129,7 +129,7 @@ void ParallelMemcpy(ThreadManager *threadMan, void *dst, const void *src, size_t char *d = (char *)dst; const char *s = (const char *)src; - ParallelRangeLoop(threadMan, [&](int l, int h) { + ParallelRangeLoop(threadMan, [d, s](int l, int h) { memmove(d + l, s + l, h - l); }, 0, (int)bytes, 128 * 1024, priority); } @@ -145,7 +145,7 @@ void ParallelMemset(ThreadManager *threadMan, void *dst, uint8_t value, size_t b // unknown's testing showed that 128kB is an appropriate minimum size. char *d = (char *)dst; - ParallelRangeLoop(threadMan, [&](int l, int h) { + ParallelRangeLoop(threadMan, [d, value](int l, int h) { memset(d + l, value, h - l); }, 0, (int)bytes, 128 * 1024, priority); } diff --git a/Common/Thread/ThreadManager.cpp b/Common/Thread/ThreadManager.cpp index 98e0b43a57..efd35f3f26 100644 --- a/Common/Thread/ThreadManager.cpp +++ b/Common/Thread/ThreadManager.cpp @@ -68,7 +68,7 @@ void ThreadManager::Teardown() { // Purge any cancellable tasks while the threads shut down. if (global_->compute_queue_size > 0 || global_->io_queue_size > 0) { - auto drainQueue = [&](std::deque queue[TASK_PRIORITY_COUNT], std::atomic &size) { + auto drainQueue = [this](std::deque queue[TASK_PRIORITY_COUNT], std::atomic &size) { for (size_t i = 0; i < TASK_PRIORITY_COUNT; ++i) { for (auto it = queue[i].begin(); it != queue[i].end(); ++it) { if (TeardownTask(*it, false)) { diff --git a/UI/InstallZipScreen.cpp b/UI/InstallZipScreen.cpp index aa6a69a097..e8a7d80259 100644 --- a/UI/InstallZipScreen.cpp +++ b/UI/InstallZipScreen.cpp @@ -99,7 +99,14 @@ void InstallZipScreen::CreateSettingsViews(UI::ViewGroup *parent) { default: // Nothing to do! break; - } + } + + if (System_GetPropertyBool(SYSPROP_CAN_SHOW_FILE)) { + parent->Add(new Spacer(12.0f)); + parent->Add(new Choice(di->T("Show in folder")))->OnClick.Add([this](UI::EventParams &) { + System_ShowFileInFolder(zipPath_); + }); + } if (showDeleteCheckbox) { parent->Add(new Spacer(12.0f)); @@ -168,8 +175,6 @@ void InstallZipScreen::CreateContentViews(UI::ViewGroup *parent) { leftColumn->Add(new TextView(question)); leftColumn->Add(new TextView(shortFilename)); - doneView_ = leftColumn->Add(new TextView("")); - showDeleteCheckbox = true; break; } @@ -188,7 +193,6 @@ void InstallZipScreen::CreateContentViews(UI::ViewGroup *parent) { destFolders_.push_back(savestateDir); // TODO: Use the GameInfoCache to display data about the game if available. - doneView_ = leftColumn->Add(new TextView("")); showDeleteCheckbox = true; break; } @@ -230,7 +234,6 @@ void InstallZipScreen::CreateContentViews(UI::ViewGroup *parent) { } } - doneView_ = leftColumn->Add(new TextView("")); showDeleteCheckbox = true; break; } @@ -244,13 +247,17 @@ void InstallZipScreen::CreateContentViews(UI::ViewGroup *parent) { leftColumn->Add(new TextView(er->T("File format not supported"))); break; case ZipFileContents::UNKNOWN: + leftColumn->Add(new TextView(GetFriendlyPath(zipPath_))); leftColumn->Add(new TextView(iz->T("Zip file does not contain PSP software"), ALIGN_LEFT, false, new AnchorLayoutParams(10, 10, NONE, NONE))); break; default: + leftColumn->Add(new TextView(GetFriendlyPath(zipPath_))); leftColumn->Add(new TextView(er->T("The file is not a valid zip file"), ALIGN_LEFT, false, new AnchorLayoutParams(10, 10, NONE, NONE))); break; } + doneView_ = leftColumn->Add(new TextView("")); + if (destFolders_.size() > 1) { leftColumn->Add(new TextView(iz->T("Install into folder"))); for (int i = 0; i < (int)destFolders_.size(); i++) { @@ -260,7 +267,6 @@ void InstallZipScreen::CreateContentViews(UI::ViewGroup *parent) { leftColumn->Add(new TextView(iz->T("Install into folder"))); leftColumn->Add(new TextView(GetFriendlyPath(destFolders_[0])))->SetAlign(FLAG_WRAP_TEXT); } - if (overwrite) { leftColumn->Add(new NoticeView(NoticeLevel::WARN, di->T("Confirm Overwrite"), "")); }