mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
When changing memstick dir, don't bother calculating space for the "old" choice. Can be super slow.
This commit is contained in:
1 parent
6b987fa4ac
commit
5538176ce0
2 files changed
+1
-23
No files matched your search
+1
-21
@@ -483,11 +483,7 @@ ConfirmMemstickMoveScreen::~ConfirmMemstickMoveScreen() {
|
||||
moveDataTask_->BlockUntilReady();
|
||||
delete moveDataTask_;
|
||||
}
|
||||
// These we just cancel / leak.
|
||||
if (oldSpaceTask_) {
|
||||
oldSpaceTask_->Cancel();
|
||||
delete oldSpaceTask_;
|
||||
}
|
||||
// This we just cancel / leak.
|
||||
if (newSpaceTask_) {
|
||||
newSpaceTask_->Cancel();
|
||||
delete newSpaceTask_;
|
||||
@@ -543,16 +539,8 @@ void ConfirmMemstickMoveScreen::CreateViews() {
|
||||
}
|
||||
|
||||
if (!oldMemstickFolder.empty()) {
|
||||
oldSpaceTask_ = Promise<SpaceResult *>::Spawn(&g_threadManager, [oldMemstickFolder]() -> SpaceResult * {
|
||||
int64_t freeSpaceOld;
|
||||
INFO_LOG(Log::System, "Computing free space in %s", oldMemstickFolder.c_str());
|
||||
free_disk_space(oldMemstickFolder, freeSpaceOld);
|
||||
return new SpaceResult{ freeSpaceOld };
|
||||
}, TaskType::IO_BLOCKING, TaskPriority::HIGH);
|
||||
|
||||
rightColumn->Add(new TextView(std::string(ms->T("Current")) + ":", ALIGN_LEFT, false));
|
||||
rightColumn->Add(new TextView(oldMemstickFolder.ToVisualString(), ALIGN_LEFT, false));
|
||||
oldFreeSpaceView_ = rightColumn->Add(new TextView(ApplySafeSubstitutions("%1: ...", ms->T("Free space")), ALIGN_LEFT, false));
|
||||
}
|
||||
|
||||
if (moveDataTask_) {
|
||||
@@ -618,14 +606,6 @@ void ConfirmMemstickMoveScreen::update() {
|
||||
newSpaceTask_ = nullptr;
|
||||
}
|
||||
}
|
||||
if (oldSpaceTask_ && oldFreeSpaceView_) {
|
||||
SpaceResult *result = oldSpaceTask_->Poll();
|
||||
if (result) {
|
||||
oldFreeSpaceView_->SetText(std::string(ms->T("Free space")) + ": " + FormatSpaceString(result->bytesFree));
|
||||
delete oldSpaceTask_;
|
||||
oldSpaceTask_ = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UI::EventReturn ConfirmMemstickMoveScreen::OnConfirm(UI::EventParams ¶ms) {
|
||||
|
||||
@@ -128,10 +128,8 @@ private:
|
||||
MoveProgressReporter progressReporter_;
|
||||
UI::TextView *progressView_ = nullptr;
|
||||
UI::TextView *newFreeSpaceView_ = nullptr;
|
||||
UI::TextView *oldFreeSpaceView_ = nullptr;
|
||||
|
||||
Promise<MoveResult *> *moveDataTask_ = nullptr;
|
||||
Promise<SpaceResult *> *oldSpaceTask_ = nullptr;
|
||||
Promise<SpaceResult *> *newSpaceTask_ = nullptr;
|
||||
|
||||
std::string error_;
|
||||
|
||||
Reference in new issue
Block a user