From 2c146d830d6b5b50f7440c423eee4661168774d9 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Sun, 25 Aug 2019 17:31:02 +0200 Subject: [PATCH] Fixes from review --- src/common/accelcmn.cpp | 8 +++---- src/gtk/menu.cpp | 49 +++++++++-------------------------------- 2 files changed, 15 insertions(+), 42 deletions(-) diff --git a/src/common/accelcmn.cpp b/src/common/accelcmn.cpp index bc8937a2b8..6bfb3a184c 100644 --- a/src/common/accelcmn.cpp +++ b/src/common/accelcmn.cpp @@ -193,8 +193,8 @@ bool wxAcceleratorEntry::ValidateKey(int flags, int keycode) if ( !flags ) { valid = false; - wxLogDebug( wxString::Format( wxT("Compatibility issue: %s key must have modifiers to be an accelerator key on GTK"), - keyname ) ); + wxLogDebug( "Compatibility issue: %s key must have modifiers to be an accelerator key on GTK", + keyname ); } break; @@ -238,8 +238,8 @@ bool wxAcceleratorEntry::ValidateKey(int flags, int keycode) case WXK_SPECIAL16: case WXK_SPECIAL17: case WXK_SPECIAL18: case WXK_SPECIAL19: case WXK_SPECIAL20: valid = false; - wxLogDebug( wxString::Format( wxT("Compatibility issue: %s is not supported as a keyboard accelerator key on GTK"), - keyname ) ); + wxLogDebug( "Compatibility issue: %s is not supported as a keyboard accelerator key on GTK", + keyname ); break; } diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 3065fa2564..05d0bc0326 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -1062,37 +1062,25 @@ static wxString GetGtkHotKey( const wxMenuItem& item ) if ( flags ) hotkey << wxT("Up" ); else - { - wxLogDebug( wxT("The Up key must have modifiers to be an accelerator key") ); - hotkey.Clear(); - } + hotkey.clear(); break; case WXK_DOWN: if ( flags ) hotkey << wxT("Down" ); else - { - wxLogDebug( wxT("The Down key must have modifiers to be an accelerator key") ); - hotkey.Clear(); - } + hotkey.clear(); break; case WXK_LEFT: if ( flags ) hotkey << wxT("Left" ); else - { - wxLogDebug( wxT("The Left key must have modifiers to be an accelerator key") ); - hotkey.Clear(); - } + hotkey.clear(); break; case WXK_RIGHT: if ( flags ) hotkey << wxT("Right" ); else - { - wxLogDebug( wxT("The Right key must have modifiers to be an accelerator key") ); - hotkey.Clear(); - } + hotkey.clear(); break; case WXK_PAGEUP: hotkey << wxT("Page_Up" ); @@ -1168,37 +1156,25 @@ static wxString GetGtkHotKey( const wxMenuItem& item ) if ( flags ) hotkey << wxT("KP_Up" ); else - { - wxLogDebug( wxT("The KP_Up key must have modifiers to be an accelerator key") ); - hotkey.Clear(); - } + hotkey.clear(); break; case WXK_NUMPAD_DOWN: if ( flags ) hotkey << wxT("KP_Down" ); else - { - wxLogDebug( wxT("The KP_Down key must have modifiers to be an accelerator key") ); - hotkey.Clear(); - } + hotkey.clear(); break; case WXK_NUMPAD_LEFT: if ( flags ) hotkey << wxT("KP_Left" ); else - { - wxLogDebug( wxT("The KP_Left key must have modifiers to be an accelerator key") ); - hotkey.Clear(); - } + hotkey.clear(); break; case WXK_NUMPAD_RIGHT: if ( flags ) hotkey << wxT("KP_Right" ); else - { - wxLogDebug( wxT("The KP_Right key must have modifiers to be an accelerator key") ); - hotkey.Clear(); - } + hotkey.clear(); break; case WXK_NUMPAD_PAGEUP: hotkey << wxT("KP_Page_Up" ); @@ -1282,9 +1258,7 @@ static wxString GetGtkHotKey( const wxMenuItem& item ) case WXK_SPECIAL13: case WXK_SPECIAL14: case WXK_SPECIAL15: case WXK_SPECIAL16: case WXK_SPECIAL17: case WXK_SPECIAL18: case WXK_SPECIAL19: case WXK_SPECIAL20: - wxLogDebug( wxString::Format( wxT("Unsupported keyboard accelerator key: %s"), - accel->ToString() ) ); - hotkey.Clear(); + hotkey.clear(); break; // if there are any other keys wxAcceleratorEntry::Create() may @@ -1302,9 +1276,8 @@ static wxString GetGtkHotKey( const wxMenuItem& item ) } } - wxLogDebug( wxString::Format( wxT("unknown keyboard accelerator key code: %i"), - code ) ); - hotkey.Clear(); + wxLogDebug( "Unknown keyboard accelerator key code: %i", code ); + hotkey.clear(); } delete accel;