OSDN Git Service

AppliStation-GUI,依存解決処理で複数個のソフトを選択された時のぬるぽ例外発生問題を解決した。
authorttp <ttp@users.sourceforge.jp>
Sun, 14 Sep 2008 11:45:11 +0000 (11:45 +0000)
committerttp <ttp@users.sourceforge.jp>
Sun, 14 Sep 2008 11:45:11 +0000 (11:45 +0000)
 * 依存解決の処理をシングルスレッドにした。(処理時間は特に長いわけでもなかったため。)
 * 依存解決のときに、依存ソフトのみをリストビューで更新するようにしたら、うまく動作するようになった。

git-svn-id: http://localhost/svn/AppliStation/trunk@979 34ed2c89-c49f-4a4b-abdb-c318350108cf

AppliStation/InstallationConfirmForm.cs

index 4127c7a..5422480 100644 (file)
@@ -66,7 +66,9 @@ namespace AppliStation
                /// </summary>\r
                private void updateInstsListView()\r
                {\r
-                       instsListView.Items.Clear();\r
+                       if (instsListView.Items.Count > 0) {\r
+                               instsListView.Items.Clear();\r
+                       }\r
                        \r
                        addInstsListItemPerGroup(requiredInstallations, instsListView.Groups["requires"], true);\r
                        addInstsListItemPerGroup(selectedInstallations, instsListView.Groups["install"], false);\r
@@ -251,9 +253,11 @@ namespace AppliStation
 \r
                void InstallationConfirmFormShown(object sender, EventArgs e)\r
                {\r
-                       System.Threading.Thread thread = new System.Threading.Thread(\r
-                               new System.Threading.ThreadStart(resolveDependecies));\r
-                       thread.Start(); \r
+                       if (InvokeRequired) {\r
+                               Invoke(new MethodInvoker(resolveDependecies));\r
+                       } else {\r
+                               resolveDependecies();\r
+                       }\r
                }\r
                \r
                /// <summary>\r
@@ -272,11 +276,10 @@ namespace AppliStation
                                \r
                                requiredInstallations = dependencies;\r
                                \r
-                               if (InvokeRequired) {\r
-                                       Invoke(new MethodInvoker(updateInstsListView));\r
-                               } else {\r
-                                       updateInstsListView();\r
-                               }\r
+                               addInstsListItemPerGroup(requiredInstallations, instsListView.Groups["requires"], true);\r
+                               \r
+                               InstsListViewItemChecked(instsListView, null);\r
+                               instsListView.Refresh();\r
                        }\r
                }\r
                \r