- Timestamp:
- Feb 11, 2015 4:02:18 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 98178
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r54145 r54146 318 318 : UISessionStateStatusBarIndicator(pSession) 319 319 , m_pTimerAutoUpdate(0) 320 , m_cMaxNetworkAdapters(0) 320 321 { 321 322 /* Assign state-icons: */ … … 327 328 connect(m_pSession, SIGNAL(sigMachineStateChange()), 328 329 this, SLOT(sltHandleMachineStateChange())); 330 /* Fetch maximum network adapters count: */ 331 const CVirtualBox vbox = vboxGlobal().virtualBox(); 332 const CMachine machine = m_pSession->machine(); 333 m_cMaxNetworkAdapters = vbox.GetSystemProperties().GetMaxNetworkAdapters(machine.GetChipsetType()); 329 334 /* Create auto-update timer: */ 330 335 m_pTimerAutoUpdate = new QTimer(this); … … 388 393 machine.GetGuestProperty("/VirtualBox/GuestInfo/Net/Count", strCount, iTimestamp, strFlags); 389 394 bool fPropsValid = (u64Now - iTimestamp < UINT64_C(60000000000)); /* timeout beacon */ 390 ulong uMaxCount = vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(machine.GetChipsetType());391 395 QStringList ipList, macList; 392 396 if (fPropsValid) 393 397 { 394 const int cAdapters = RT_MIN(strCount.toInt(), (int)uMaxCount);398 const int cAdapters = RT_MIN(strCount.toInt(), m_cMaxNetworkAdapters); 395 399 for (int i = 0; i < cAdapters; ++i) 396 400 { … … 400 404 } 401 405 402 /* Enumerate up to uMaxCountadapters: */406 /* Enumerate up to m_cMaxNetworkAdapters adapters: */ 403 407 bool fAdaptersPresent = false; 404 408 bool fCablesDisconnected = true; 405 for (ulong uSlot = 0; uSlot < uMaxCount; ++uSlot)409 for (ulong uSlot = 0; uSlot < m_cMaxNetworkAdapters; ++uSlot) 406 410 { 407 411 const CNetworkAdapter &adapter = machine.GetNetworkAdapter(uSlot); … … 453 457 /** Holds the auto-update timer instance. */ 454 458 QTimer *m_pTimerAutoUpdate; 459 /** Holds the maximum amount of the network adapters. */ 460 int m_cMaxNetworkAdapters; 455 461 }; 456 462
Note:
See TracChangeset
for help on using the changeset viewer.