InstallZipScreen improvements, small cleanup

This commit is contained in:
Henrik Rydgård
2026-02-10 11:34:59 +01:00
parent 2bc43810a8
commit 2c0bdcf678
6 changed files with 18 additions and 12 deletions
+1 -1
View File
@@ -152,7 +152,7 @@ void PathBrowser::HandlePath() {
if (pendingThread_.joinable())
return;
pendingThread_ = std::thread([&] {
pendingThread_ = std::thread([this] {
SetCurrentThreadName("PathBrowser");
AndroidJNIThreadContext jniContext; // destructor detaches
+1 -1
View File
@@ -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] = "?";
+1 -1
View File
@@ -124,7 +124,7 @@ void ConsoleListener::Open() {
}
if (useThread_ && hTriggerEvent != NULL && !thread_.joinable()) {
thread_ = std::thread([&] {
thread_ = std::thread([this] {
SetCurrentThreadName("Console");
LogWriterThread();
});
+2 -2
View File
@@ -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);
}
+1 -1
View File
@@ -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<Task *> queue[TASK_PRIORITY_COUNT], std::atomic<int> &size) {
auto drainQueue = [this](std::deque<Task *> queue[TASK_PRIORITY_COUNT], std::atomic<int> &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)) {
+12 -6
View File
@@ -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"), ""));
}