VirtualBox

Changeset 37051 in vbox


Ignore:
Timestamp:
May 12, 2011 1:48:15 PM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: 4989: Lazy init VM settings dialog: Erase cache before loading data.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDefs.h

    r36915 r37051  
    8383    void cacheCurrentData(const CacheData &currentData) { m_value.second = currentData; }
    8484
    85     /* Reset the current data to be empty: */
    86     void reset() { m_value.second = CacheData(); }
    87 
    8885    /* Reset the initial and the current data to be both empty: */
    8986    void clear() { m_value.first = CacheData(); m_value.second = CacheData(); }
     
    141138    }
    142139
    143     /* Reset the current data to be empty.
    144      * Perform the same for all the children: */
    145     void reset()
    146     {
    147         UISettingsCache<ParentCacheData>::reset();
    148         for (int iChildIndex = 0; iChildIndex < childCount(); ++iChildIndex)
    149             child(iChildIndex).reset();
    150     }
    151 
    152140    /* Reset the initial and the current data to be both empty.
    153      * Perform the same for all the children: */
     141     * Removes all the children: */
    154142    void clear()
    155143    {
    156144        UISettingsCache<ParentCacheData>::clear();
    157         for (int iChildIndex = 0; iChildIndex < childCount(); ++iChildIndex)
    158             child(iChildIndex).clear();
     145        m_children.clear();
    159146    }
    160147
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h

    r36594 r37051  
    100100    /* Settings dialog type stuff: */
    101101    SettingsDialogType dialogType() const { return m_dialogType; }
    102     virtual void setDialogType(SettingsDialogType settingsDialogType) { m_dialogType = settingsDialogType; }
     102    virtual void setDialogType(SettingsDialogType settingsDialogType) { m_dialogType = settingsDialogType; polishPage(); }
    103103    bool isMachineOffline() const { return dialogType() == SettingsDialogType_Offline; }
    104104    bool isMachineSaved() const { return dialogType() == SettingsDialogType_Saved; }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.cpp

    r36924 r37051  
    3535    /* Fetch data to machine: */
    3636    UISettingsPageMachine::fetchData(data);
     37
     38    /* Clear cache initially: */
     39    m_cache.clear();
    3740
    3841    /* Prepare audio data: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r36920 r37051  
    153153    UISettingsPageMachine::fetchData(data);
    154154
     155    /* Clear cache initially: */
     156    m_cache.clear();
     157
    155158    /* Prepare display data: */
    156159    UIDataSettingsMachineDisplay displayData;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp

    r36917 r37051  
    7474    /* Fetch data to machine: */
    7575    UISettingsPageMachine::fetchData(data);
     76
     77    /* Clear cache initially: */
     78    m_cache.clear();
    7679
    7780    /* Prepare general data: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp

    r36928 r37051  
    748748    /* Fetch data to machine: */
    749749    UISettingsPageMachine::fetchData(data);
     750
     751    /* Clear cache initially: */
     752    m_cache.clear();
    750753
    751754    /* Cache names lists: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.cpp

    r36930 r37051  
    202202    /* Fetch data to machine: */
    203203    UISettingsPageMachine::fetchData(data);
     204
     205    /* Clear cache initially: */
     206    m_cache.clear();
    204207
    205208    /* For each parallel port: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.cpp

    r36932 r37051  
    223223    UISettingsPageMachine::fetchData(data);
    224224
     225    /* Clear cache initially: */
     226    m_cache.clear();
     227
    225228    /* Load machine (permanent) shared folders into shared folders cache if possible: */
    226229    if (isSharedFolderTypeSupported(MachineType))
     
    269272void UIMachineSettingsSF::getFromCache()
    270273{
     274    /* Clear list initially: */
     275    mTwFolders->clear();
     276
    271277    /* Update root items visibility: */
    272278    updateRootItemsVisibility();
     
    686692}
    687693
     694void UIMachineSettingsSF::polishPage()
     695{
     696    /* Update root items visibility: */
     697    updateRootItemsVisibility();
     698}
     699
    688700CSharedFolderVector UIMachineSettingsSF::getSharedFolders(UISharedFolderType sharedFoldersType)
    689701{
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.h

    r36932 r37051  
    130130    void setRootItemVisible(UISharedFolderType sharedFolderType, bool fVisible);
    131131
     132    void polishPage();
     133
    132134    CSharedFolderVector getSharedFolders(UISharedFolderType sharedFoldersType);
    133135
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.cpp

    r36929 r37051  
    236236    /* Fetch data to machine: */
    237237    UISettingsPageMachine::fetchData(data);
     238
     239    /* Clear cache initially: */
     240    m_cache.clear();
    238241
    239242    /* For each serial port: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r36923 r37051  
    14231423{
    14241424    m_dialogType = dialogType;
     1425}
     1426
     1427void StorageModel::clear()
     1428{
     1429    while (mRootItem->childCount())
     1430    {
     1431        beginRemoveRows(root(), 0, 0);
     1432        delete mRootItem->childByPos(0);
     1433        endRemoveRows();
     1434    }
    14251435}
    14261436
     
    17841794    UISettingsPageMachine::fetchData(data);
    17851795
     1796    /* Clear cache initially: */
     1797    m_cache.clear();
     1798
    17861799    /* Prepare storage data: */
    17871800    UIDataSettingsMachineStorage storageData;
     
    18491862void UIMachineSettingsStorage::getFromCache()
    18501863{
     1864    /* Clear model initially: */
     1865    mStorageModel->clear();
     1866
    18511867    /* Get storage data from cache: */
    18521868    const UIDataSettingsMachineStorage &storageData = m_cache.base();
     
    34243440void UIMachineSettingsStorage::setDialogType(SettingsDialogType settingsDialogType)
    34253441{
     3442    /* Update 'settings dialog type' of base class: */
    34263443    UISettingsPageMachine::setDialogType(settingsDialogType);
     3444    /* Update model 'settings dialog type': */
    34273445    mStorageModel->setDialogType(dialogType());
     3446    /* Update action states: */
     3447    updateActionsState();
    34283448}
    34293449
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h

    r36923 r37051  
    503503    void setChipsetType(KChipsetType type);
    504504
    505     void setDialogType(SettingsDialogType dialogType);
     505    void setDialogType(SettingsDialogType settingsDialogType);
     506
     507    void clear();
    506508
    507509    QMap<KStorageBus, int> currentControllerTypes() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp

    r36919 r37051  
    169169    /* Fetch data to machine: */
    170170    UISettingsPageMachine::fetchData(data);
     171
     172    /* Clear cache initially: */
     173    m_cache.clear();
    171174
    172175    /* Prepare system data: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp

    r36936 r37051  
    152152    /* Fetch data to properties & settings or machine: */
    153153    fetchData(data);
     154
     155    /* Clear cache initially: */
     156    m_cache.clear();
    154157
    155158    /* Depending on page type: */
     
    257260void UIMachineSettingsUSB::getFromCache()
    258261{
     262    /* Clear list initially: */
     263    mTwFilters->clear();
     264    m_filters.clear();
     265
    259266    /* Depending on page type: */
    260267    switch (pageType())
Note: See TracChangeset for help on using the changeset viewer.

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