From: sirakaba Date: Thu, 4 Mar 2010 03:04:32 +0000 (+0000) Subject: 高速化。 X-Git-Tag: 0.01beta7~7 X-Git-Url: http://git.osdn.net/view?p=tpi%2Flychee.git;a=commitdiff_plain;h=c228ad7493cc6f2543c445b7dc5c1dd4f6ae76f9 高速化。 git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@281 9df91469-1e22-0410-86e7-ea8537beb833 --- diff --git a/src/lychee/dlg_process.cpp b/src/lychee/dlg_process.cpp index 24a38b9..e27b3f4 100644 --- a/src/lychee/dlg_process.cpp +++ b/src/lychee/dlg_process.cpp @@ -91,50 +91,55 @@ int ProcessDialog::CallbackProc(unsigned int _uMsg, void * _pStructure) { case TPI_MESSAGE_STATUS: { - static int s_nGaugeCounter = 0; + static int s_nGaugeCounter = 0, s_nInterval = 0; switch (piInfo->eStatus) { case TPI_STATUS_OPENARCHIVE: this->ebSource->ChangeValue(piInfo->fiInfo.fnFileName.GetFullPath()); break; case TPI_STATUS_BEGINPROCESS: - this->ebSource->ChangeValue(piInfo->fiInfo.fnFileName.GetFullPath()); - this->ebTarget->ChangeValue(piInfo->fnDestination.GetFullPath()); + // 小さなファイルなら表示しない。 if (piInfo->fiInfo.nUnpackedSize > 10000) { + this->ebSource->ChangeValue(piInfo->fiInfo.fnFileName.GetFullPath()); + this->ebTarget->ChangeValue(piInfo->fnDestination.GetFullPath()); this->gFile->SetRange(piInfo->fiInfo.nUnpackedSize); this->gFile->SetValue(0); + ::wxSafeYield(this, true); } - ::wxSafeYield(this, true); break; case TPI_STATUS_INPROCESS: - if (s_nGaugeCounter++ > 100) + if (piInfo->fiInfo.nUnpackedSize > 10000) { - if (piInfo->fiInfo.nUnpackedSize > 10000) - { - this->gFile->SetValue(piInfo->nProcessedSize); - } + this->gFile->SetValue(piInfo->nProcessedSize); ::wxSafeYield(this, true); - s_nGaugeCounter = 0; } break; case TPI_STATUS_ENDPROCESS: -// this->gFile->SetValue(piInfo->fiInfo.nUnpackedSize.ToULong()); - this->gArchive->SetValue(this->gArchive->GetValue() + 1); + if (s_nGaugeCounter++ > s_nInterval) + { + this->gArchive->SetValue(this->gArchive->GetValue() + s_nInterval); + ::wxSafeYield(this, true); + s_nGaugeCounter = 0; + } break; // 書庫ロード時用の独自仕様。 case 0x1000: this->ebSource->ChangeValue(piInfo->fiInfo.fnFileName.GetFullPath()); this->gArchive->SetRange(piInfo->fiInfo.nUnpackedSize); this->gArchive->SetValue(0); + s_nInterval = piInfo->fiInfo.nUnpackedSize / 10; break; case 0x1001: - // 更新しすぎると低速なので100ファイル毎に更新する。 - if (piInfo->nProcessedSize > this->gArchive->GetValue() + 100) + if (piInfo->fiInfo.nUnpackedSize > 10000) { this->ebTarget->ChangeValue(piInfo->fiInfo.fnFileName.GetFullPath()); + } + if (s_nGaugeCounter++ > s_nInterval) + { this->gArchive->SetValue(piInfo->nProcessedSize); ::wxSafeYield(this, true); + s_nGaugeCounter = 0; } break; }