Permalink
Browse files

CApplication::OnAppCommand returns true or false not 1 or 0

  • Loading branch information...
1 parent efb0526 commit 263353bd793b81105c865940244337565e6f04fa John Rennie committed May 25, 2011
Showing with 6 additions and 6 deletions.
  1. +5 −5 xbmc/Application.cpp
  2. +1 −1 xbmc/windowing/windows/WinEventsWin32.cpp
View
@@ -2356,7 +2356,7 @@ bool CApplication::OnKey(const CKey& key)
}
// OnAppCommand is called in response to a XBMC_APPCOMMAND event.
-// This needs to return 1 if it processed the appcommand or zero if it didn't
+// This needs to return true if it processed the appcommand or false if it didn't
bool CApplication::OnAppCommand(const CAction &action)
{
// Reset the screen saver
@@ -2373,21 +2373,21 @@ bool CApplication::OnAppCommand(const CAction &action)
int iWin = g_windowManager.GetActiveWindow() & WINDOW_ID_MASK;
CAction appcmdaction = CButtonTranslator::GetInstance().GetAction(iWin, key);
- // If we couldn't find an action return zero to indicate we have not
+ // If we couldn't find an action return false to indicate we have not
// handled this appcommand
if (!appcmdaction.GetID())
{
CLog::Log(LOGDEBUG, "%s: unknown appcommand %d", __FUNCTION__, appcmd);
- return 0;
+ return false;
}
// Process the appcommand
CLog::Log(LOGDEBUG, "%s: appcommand %d, trying action %s", __FUNCTION__, appcmd, appcmdaction.GetName().c_str());
OnAction(appcmdaction);
- // Always return 1 regardless of whether the action succeeded or not.
+ // Always return true regardless of whether the action succeeded or not.
// This stops Windows handling the appcommand itself.
- return 1;
+ return true;
}
bool CApplication::OnAction(const CAction &action)
@@ -501,7 +501,7 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
CLog::Log(LOGDEBUG, "WinEventsWin32.cpp: APPCOMMAND %d", GET_APPCOMMAND_LPARAM(lParam));
newEvent.appcommand.type = XBMC_APPCOMMAND;
newEvent.appcommand.action = GET_APPCOMMAND_LPARAM(lParam);
- return m_pEventFunc(newEvent);
+ return m_pEventFunc(newEvent) ? 1 : 0;
}
case WM_GESTURENOTIFY:
{

0 comments on commit 263353b

Please sign in to comment.