VirtualBox

Ignore:
Timestamp:
Aug 3, 2010 1:00:54 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
64371
Message:

Main: rework new implementation of Machine::Unregister() and Machine::Delete() to be more flexible and still easy to use

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp

    r31240 r31333  
    680680        {
    681681            CMachine machine = item->machine();
    682             QVector<QString> files = machine.Unregister(false /*fDetachMedia*/);
     682            QVector<CMedium> aMedia = machine.Unregister(KCleanupMode_UnregisterOnly);          //  @todo replace with DetachAllReturnHardDisksOnly once a progress dialog is in place below
    683683            if (machine.isOk() && item->accessible())
    684684            {
    685685                /* delete machine settings */
    686                 machine.Delete();
     686                CProgress progress = machine.Delete(aMedia);
     687                progress.WaitForCompletion(-1);         // @todo do this nicely with a progress dialog, this can delete many files!
     688
    687689                /* remove the item shortly: cmachine it refers to is no longer valid! */
    688690                int row = mVMModel->rowById (item->id());
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp

    r31070 r31333  
    782782        {
    783783            /* Unregister on failure */
    784             QVector<QString> files = m_Machine.Unregister(false /*fDetachMedia*/);
     784            QVector<CMedium> aMedia = m_Machine.Unregister(KCleanupMode_UnregisterOnly);   //  @todo replace with DetachAllReturnHardDisksOnly once a progress dialog is in place below
    785785            if (vbox.isOk())
    786                 m_Machine.Delete();
     786            {
     787                CProgress progress = m_Machine.Delete(aMedia);
     788                progress.WaitForCompletion(-1);         // @todo do this nicely with a progress dialog, this can delete lots of files
     789            }
    787790            return false;
    788791        }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette