VirtualBox

Ignore:
Timestamp:
Feb 15, 2013 12:37:40 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: 6065: UIHotKeyTableModel: Sorting routine: Make sure host-combo item is always the first one as the most important shortcut.

File:
1 edited

Legend:

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

    r44662 r44711  
    350350void UIHotKeyTableModel::sort(int iColumn, Qt::SortOrder order /*= Qt::AscendingOrder*/)
    351351{
     352    /* Sort whole the list: */
    352353    qStableSort(m_shortcuts.begin(), m_shortcuts.end(), UIShortcutCacheItemFunctor(iColumn, order));
     354    /* Make sure host-combo item is always the first one: */
     355    UIShortcutCacheItem fakeHostComboItem(UIHostCombo::hostComboCacheKey(), QString(), QString(), QString());
     356    int iIndexOfHostComboItem = m_shortcuts.indexOf(fakeHostComboItem);
     357    if (iIndexOfHostComboItem != -1)
     358    {
     359        UIShortcutCacheItem hostComboItem = m_shortcuts.takeAt(iIndexOfHostComboItem);
     360        m_shortcuts.prepend(hostComboItem);
     361    }
     362    /* Apply the filter: */
    353363    applyFilter();
     364    /* Notify the model: */
    354365    emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
    355366}
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