Ticket #5296: libs_libmyth-check-return-value.patch

File libs_libmyth-check-return-value.patch, 1.3 KB (added by Erik Hovland <erik@…>, 13 years ago)
  • libs/libmyth/mythdialogs.cpp

    Always check the return value to make sure the function worked.
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     libs/libmyth/mythdialogs.cpp |    4 +++-
     libs/libmyth/mythwidgets.cpp |    3 ++-
     2 files changed, 5 insertions(+), 2 deletions(-)
    
    diff --git a/libs/libmyth/mythdialogs.cpp b/libs/libmyth/mythdialogs.cpp
    index b509b5a..a4383b2 100644
    a b void MythPopupBox::keyPressEvent(QKeyEvent *e) 
    574574{
    575575    bool handled = false;
    576576    QStringList actions;
    577     gContext->TranslateKeyPress("qt", e, actions);
     577    if (!gContext->TranslateKeyPress("qt", e, actions))
     578        MythDialog::keyPressEvent(e);
     579
    578580    for ( int i = 0; i < actions.size() && !handled; i++)
    579581    {
    580582        QString action = actions[i];
  • libs/libmyth/mythwidgets.cpp

    diff --git a/libs/libmyth/mythwidgets.cpp b/libs/libmyth/mythwidgets.cpp
    index 3741bf6..3fc5dd6 100644
    a b void MythListView::keyPressEvent(QKeyEvent *e) 
    13591359
    13601360    bool handled = false;
    13611361    QStringList actions;
    1362     gContext->TranslateKeyPress("qt", e, actions);
     1362    if (!gContext->TranslateKeyPress("qt", e, actions))
     1363        Q3ListView::keyPressEvent(e);
    13631364
    13641365    for (int i = 0; i < actions.size() && !handled; i++)
    13651366    {