OSDN Git Service

高速化。
authorsirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Thu, 4 Mar 2010 03:04:32 +0000 (03:04 +0000)
committersirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Thu, 4 Mar 2010 03:04:32 +0000 (03:04 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@281 9df91469-1e22-0410-86e7-ea8537beb833

src/lychee/dlg_process.cpp

index 24a38b9..e27b3f4 100644 (file)
@@ -91,50 +91,55 @@ int ProcessDialog::CallbackProc(unsigned int _uMsg, void * _pStructure)
        {\r
        case TPI_MESSAGE_STATUS:\r
        {\r
-               static int s_nGaugeCounter = 0;\r
+               static int s_nGaugeCounter = 0, s_nInterval = 0;\r
                switch (piInfo->eStatus)\r
                {\r
                case TPI_STATUS_OPENARCHIVE:\r
                        this->ebSource->ChangeValue(piInfo->fiInfo.fnFileName.GetFullPath());\r
                        break;\r
                case TPI_STATUS_BEGINPROCESS:\r
-                       this->ebSource->ChangeValue(piInfo->fiInfo.fnFileName.GetFullPath());\r
-                       this->ebTarget->ChangeValue(piInfo->fnDestination.GetFullPath());\r
+                       // 小さなファイルなら表示しない。\r
                        if (piInfo->fiInfo.nUnpackedSize > 10000)\r
                        {\r
+                               this->ebSource->ChangeValue(piInfo->fiInfo.fnFileName.GetFullPath());\r
+                               this->ebTarget->ChangeValue(piInfo->fnDestination.GetFullPath());\r
                                this->gFile->SetRange(piInfo->fiInfo.nUnpackedSize);\r
                                this->gFile->SetValue(0);\r
+                               ::wxSafeYield(this, true);\r
                        }\r
-                       ::wxSafeYield(this, true);\r
                        break;\r
                case TPI_STATUS_INPROCESS:\r
-                       if (s_nGaugeCounter++ > 100)\r
+                       if (piInfo->fiInfo.nUnpackedSize > 10000)\r
                        {\r
-                               if (piInfo->fiInfo.nUnpackedSize > 10000)\r
-                               {\r
-                                       this->gFile->SetValue(piInfo->nProcessedSize);\r
-                               }\r
+                               this->gFile->SetValue(piInfo->nProcessedSize);\r
                                ::wxSafeYield(this, true);\r
-                               s_nGaugeCounter = 0;\r
                        }\r
                        break;\r
                case TPI_STATUS_ENDPROCESS:\r
-//                     this->gFile->SetValue(piInfo->fiInfo.nUnpackedSize.ToULong());\r
-                       this->gArchive->SetValue(this->gArchive->GetValue() + 1);\r
+                       if (s_nGaugeCounter++ > s_nInterval)\r
+                       {\r
+                               this->gArchive->SetValue(this->gArchive->GetValue() + s_nInterval);\r
+                               ::wxSafeYield(this, true);\r
+                               s_nGaugeCounter = 0;\r
+                       }\r
                        break;\r
                // 書庫ロード時用の独自仕様。\r
                case 0x1000:\r
                        this->ebSource->ChangeValue(piInfo->fiInfo.fnFileName.GetFullPath());\r
                        this->gArchive->SetRange(piInfo->fiInfo.nUnpackedSize);\r
                        this->gArchive->SetValue(0);\r
+                       s_nInterval = piInfo->fiInfo.nUnpackedSize / 10;\r
                        break;\r
                case 0x1001:\r
-                       // 更新しすぎると低速なので100ファイル毎に更新する。\r
-                       if (piInfo->nProcessedSize > this->gArchive->GetValue() + 100)\r
+                       if (piInfo->fiInfo.nUnpackedSize > 10000)\r
                        {\r
                                this->ebTarget->ChangeValue(piInfo->fiInfo.fnFileName.GetFullPath());\r
+                       }\r
+                       if (s_nGaugeCounter++ > s_nInterval)\r
+                       {\r
                                this->gArchive->SetValue(piInfo->nProcessedSize);\r
                                ::wxSafeYield(this, true);\r
+                               s_nGaugeCounter = 0;\r
                        }\r
                        break;\r
                }\r