580 } |
580 } |
581 |
581 |
582 // |
582 // |
583 // Get the list of shortcuts selected |
583 // Get the list of shortcuts selected |
584 // |
584 // |
585 QList<ShortcutListItem*> ConfigDialog::getShortcutSelection() |
585 QVector<ShortcutListItem*> ConfigDialog::getShortcutSelection() |
586 { |
586 { |
587 QList<ShortcutListItem*> out; |
587 QVector<ShortcutListItem*> out; |
588 |
588 |
589 for (QListWidgetItem* entry : ui.shortcutsList->selectedItems()) |
589 for (QListWidgetItem* entry : ui.shortcutsList->selectedItems()) |
590 out << static_cast<ShortcutListItem*> (entry); |
590 out << static_cast<ShortcutListItem*> (entry); |
591 |
591 |
592 return out; |
592 return out; |
595 // |
595 // |
596 // Edit the shortcut of a given action. |
596 // Edit the shortcut of a given action. |
597 // |
597 // |
598 void ConfigDialog::slot_setShortcut() |
598 void ConfigDialog::slot_setShortcut() |
599 { |
599 { |
600 QList<ShortcutListItem*> sel = getShortcutSelection(); |
600 QVector<ShortcutListItem*> sel = getShortcutSelection(); |
601 |
601 |
602 if (countof(sel) < 1) |
602 if (countof(sel) < 1) |
603 return; |
603 return; |
604 |
604 |
605 ShortcutListItem* item = sel[0]; |
605 ShortcutListItem* item = sel[0]; |
611 // |
611 // |
612 // Reset a shortcut to defaults |
612 // Reset a shortcut to defaults |
613 // |
613 // |
614 void ConfigDialog::slot_resetShortcut() |
614 void ConfigDialog::slot_resetShortcut() |
615 { |
615 { |
616 QList<ShortcutListItem*> sel = getShortcutSelection(); |
616 QVector<ShortcutListItem*> sel = getShortcutSelection(); |
617 |
617 |
618 for (ShortcutListItem* item : sel) |
618 for (ShortcutListItem* item : sel) |
619 { |
619 { |
620 item->setSequence (m_window->defaultShortcut (item->action())); |
620 item->setSequence (m_window->defaultShortcut (item->action())); |
621 setShortcutText (item); |
621 setShortcutText (item); |
625 // |
625 // |
626 // Remove the shortcut of an action. |
626 // Remove the shortcut of an action. |
627 // |
627 // |
628 void ConfigDialog::slot_clearShortcut() |
628 void ConfigDialog::slot_clearShortcut() |
629 { |
629 { |
630 QList<ShortcutListItem*> sel = getShortcutSelection(); |
630 QVector<ShortcutListItem*> sel = getShortcutSelection(); |
631 |
631 |
632 for (ShortcutListItem* item : sel) |
632 for (ShortcutListItem* item : sel) |
633 { |
633 { |
634 item->setSequence (QKeySequence()); |
634 item->setSequence (QKeySequence()); |
635 setShortcutText (item); |
635 setShortcutText (item); |