VirtualBox

Changeset 44713 in vbox for trunk


Ignore:
Timestamp:
Feb 15, 2013 1:32:58 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
83813
Message:

FE/Qt: 6065: Some rework in shortcuts settings saving procedure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp

    r44712 r44713  
    137137void UIHotKeyTableModel::save(UIShortcutCache &shortcuts)
    138138{
    139     /* Save shortcuts: */
     139    /* Save model items: */
    140140    foreach (const UIShortcutCacheItem &item, m_shortcuts)
    141141    {
    142         /* Search for corresponding cache item pointer: */
    143         UIShortcutCache::iterator cacheItemPointer = qFind(shortcuts.begin(), shortcuts.end(), item);
    144         /* Make sure the pointer is valid: */
    145         if (cacheItemPointer == shortcuts.end())
     142        /* Search for corresponding cache item index: */
     143        int iIndexOfCacheItem = shortcuts.indexOf(item);
     144        /* Make sure index is valid: */
     145        if (iIndexOfCacheItem == -1)
    146146            continue;
    147         /* Save shortcut cache item into cache: */
    148         *cacheItemPointer = item;
     147        /* Save model item into the cache: */
     148        shortcuts[iIndexOfCacheItem] = item;
    149149    }
    150150}
     
    328328                    /* Set sequence to shortcut: */
    329329                    UIShortcutCacheItem &filteredShortcut = m_filteredShortcuts[iIndex];
    330                     UIShortcutCache::iterator shortcutPointer = qFind(m_shortcuts.begin(), m_shortcuts.end(), filteredShortcut);
    331                     if (shortcutPointer != m_shortcuts.end())
     330                    int iShortcutIndex = m_shortcuts.indexOf(filteredShortcut);
     331                    if (iShortcutIndex != -1)
    332332                    {
    333333                        filteredShortcut.currentSequence = filteredShortcut.key == UIHostCombo::hostComboCacheKey() ?
    334334                                                           value.value<UIHostComboWrapper>().toString() :
    335335                                                           value.value<UIHotKey>().sequence();
    336                         *shortcutPointer = filteredShortcut;
     336                        m_shortcuts[iShortcutIndex] = filteredShortcut;
    337337                        emit sigRevalidationRequired();
    338338                        return true;
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