Keymap: Change GetModifiedCharacters API to return BStringList.
Simplifies the API and makes ownership semantics clearer. Change-Id: I59d2e3ef8055253e85943500fb65356762055c54 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8914 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
3e245f7b20
commit
007126ed6f
@@ -561,12 +561,12 @@ TermWindow::_SetupMenu()
|
||||
|
||||
BKeymap keymap;
|
||||
keymap.SetToCurrent();
|
||||
BObjectList<const char> unmodified(3, true);
|
||||
if (keymap.GetModifiedCharacters("+", B_SHIFT_KEY, 0, &unmodified)
|
||||
BStringList unmodified(3);
|
||||
if (keymap.GetModifiedCharacters("+", B_SHIFT_KEY, 0, unmodified)
|
||||
== B_OK) {
|
||||
int32 count = unmodified.CountItems();
|
||||
int32 count = unmodified.CountStrings();
|
||||
for (int32 i = 0; i < count; i++) {
|
||||
uint32 key = BUnicodeChar::FromUTF8(unmodified.ItemAt(i));
|
||||
uint32 key = BUnicodeChar::FromUTF8(unmodified.StringAt(i));
|
||||
if (!HasShortcut(key, 0)) {
|
||||
// Add semantic + shortcut, bug #7428
|
||||
AddShortcut(key, B_COMMAND_KEY,
|
||||
|
||||
@@ -687,12 +687,12 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings,
|
||||
|
||||
BKeymap keymap;
|
||||
keymap.SetToCurrent();
|
||||
BObjectList<const char> unmodified(3, true);
|
||||
if (keymap.GetModifiedCharacters("+", B_SHIFT_KEY, 0, &unmodified)
|
||||
BStringList unmodified(3);
|
||||
if (keymap.GetModifiedCharacters("+", B_SHIFT_KEY, 0, unmodified)
|
||||
== B_OK) {
|
||||
int32 count = unmodified.CountItems();
|
||||
int32 count = unmodified.CountStrings();
|
||||
for (int32 i = 0; i < count; i++) {
|
||||
uint32 key = BUnicodeChar::FromUTF8(unmodified.ItemAt(i));
|
||||
uint32 key = BUnicodeChar::FromUTF8(unmodified.StringAt(i));
|
||||
if (!HasShortcut(key, 0)) {
|
||||
// Add semantic zoom in shortcut, bug #7428
|
||||
AddShortcut(key, B_COMMAND_KEY,
|
||||
|
||||
Reference in New Issue
Block a user