File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1382,7 +1382,7 @@ void CTrafficMonitorDlg::DoMonitorAcquisition()
13821382 if (lite_version /* || is_arm64ec*/ || !theApp.m_general_data .IsHardwareEnable (HI_HDD))
13831383 {
13841384 const auto & disk_names = m_disk_usage_helper.GetDiskNames ();
1385- int disk_index = 0 ;
1385+ int disk_index = - 1 ;
13861386 for (int i = 0 ; i < static_cast <int >(disk_names.size ()); i++)
13871387 {
13881388 if (theApp.m_general_data .hard_disk_name == disk_names[i].GetString ())
@@ -1391,6 +1391,12 @@ void CTrafficMonitorDlg::DoMonitorAcquisition()
13911391 break ;
13921392 }
13931393 }
1394+ // 没有找到要监控的硬盘时默认使用第1个
1395+ if (disk_index < 0 && !disk_names.empty ())
1396+ {
1397+ disk_index = 0 ;
1398+ theApp.m_general_data .hard_disk_name = disk_names.front ();
1399+ }
13941400 if (m_disk_usage_helper.GetDiskUsage (disk_index, theApp.m_hdd_usage ))
13951401 m_get_disk_usage_by_pdh = true ;
13961402 }
You can’t perform that action at this time.
0 commit comments