VirtualBox

Ticket #12862: 008-preferences-crush.patch

File 008-preferences-crush.patch, 1.1 KB (added by Serge Roussak, 11 years ago)
  • src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp

    # Serge Roussak [email protected]
    diff -urp a/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp b/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp
    a b void UIHotKeyTableModel::sort(int iColum  
    497497void UIHotKeyTableModel::applyFilter()
    498498{
    499499    /* Erase items first: */
    500     beginRemoveRows(QModelIndex(), 0, m_filteredShortcuts.size() - 1);
     500    beginRemoveRows(QModelIndex(), 0, qMax(m_filteredShortcuts.size() - 1, 0));
    501501    m_filteredShortcuts.clear();
    502502    endRemoveRows();
    503503
    void UIHotKeyTableModel::applyFilter()  
    520520            m_filteredShortcuts << item;
    521521        }
    522522    }
    523     beginInsertRows(QModelIndex(), 0, m_filteredShortcuts.size() - 1);
     523    beginInsertRows(QModelIndex(), 0, qMax(m_filteredShortcuts.size() - 1, 0));
    524524    endInsertRows();
    525525}
    526526

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