Changeset 14372 in vbox for trunk/src/VBox
- Timestamp:
- Nov 19, 2008 6:51:46 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h
r13950 r14372 960 960 QThread *mMediaEnumThread; 961 961 VBoxMediaList mMediaList; 962 VBoxMediaList::iterator mCurrentMediumIterator;963 962 964 963 VBoxDefs::RenderMode vm_render_mode; -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r14312 r14372 607 607 608 608 /** Constructs a regular enum event */ 609 VBoxMediaEnumEvent (const VBoxMedium &aMedium) 609 VBoxMediaEnumEvent (const VBoxMedium &aMedium, 610 VBoxMediaList::const_iterator &aIterator) 610 611 : QEvent ((QEvent::Type) VBoxDefs::MediaEnumEventType) 611 , mMedium (aMedium), m Last (false)612 , mMedium (aMedium), mIterator (aIterator), mLast (false) 612 613 {} 613 614 /** Constructs the last enum event */ … … 617 618 {} 618 619 620 /** The last enumerated medium iterator (invalid when #last is true) */ 621 VBoxMediaList::const_iterator mIterator; 619 622 /** The last enumerated medium (not valid when #last is true) */ 620 623 const VBoxMedium mMedium; … … 2833 2836 } 2834 2837 } 2835 mCurrentMediumIterator = mMediaList.begin();2836 2838 2837 2839 /* enumeration thread class */ … … 2851 2853 2852 2854 /* Enumerate the list */ 2853 int index = 0; 2854 VBoxMediaList::const_iterator it; 2855 for (it = mList.begin(); 2856 it != mList.end() && !sVBoxGlobalInCleanup; 2857 ++ it, ++ index) 2855 for (VBoxMediaList::const_iterator it = mList.begin(); 2856 it != mList.end() && !sVBoxGlobalInCleanup; ++ it) 2858 2857 { 2859 2858 VBoxMedium medium = *it; 2860 2859 medium.blockAndQueryState(); 2861 QApplication::postEvent (self, new VBoxMediaEnumEvent (medium ));2860 QApplication::postEvent (self, new VBoxMediaEnumEvent (medium, it)); 2862 2861 } 2863 2862 … … 4950 4949 !ev->mMedium.result().isOk()) 4951 4950 vboxProblem().cannotGetMediaAccessibility (ev->mMedium); 4952 Assert ( mCurrentMediumIterator != mMediaList.end());4953 *mCurrentMediumIterator = ev->mMedium;4954 emit mediumEnumerated (*mCurrentMediumIterator);4955 ++ mCurrentMediumIterator;4951 Assert (ev->mIterator != mMediaList.end()); 4952 VBoxMedium *medium = unconst (&*ev->mIterator); 4953 *medium = ev->mMedium; 4954 emit mediumEnumerated (*medium); 4956 4955 } 4957 4956 else … … 4961 4960 delete mMediaEnumThread; 4962 4961 mMediaEnumThread = 0; 4963 Assert (mCurrentMediumIterator == mMediaList.end());4964 4962 emit mediumEnumFinished (mMediaList); 4965 4963 } … … 5330 5328 /* media list contains a lot of CUUnknown, release them */ 5331 5329 mMediaList.clear(); 5332 mCurrentMediumIterator = mMediaList.end();5333 5330 /* the last step to ensure we don't use COM any more */ 5334 5331 mVBox.detach();
Note:
See TracChangeset
for help on using the changeset viewer.