1 | Make sure return values are checked. |
---|
2 | |
---|
3 | From: Erik Hovland <erik@hovland.org> |
---|
4 | |
---|
5 | |
---|
6 | --- |
---|
7 | |
---|
8 | mythtv/libs/libmythui/mythdialogbox.cpp | 9 ++++++--- |
---|
9 | mythtv/libs/libmythui/mythmainwindow.cpp | 3 +-- |
---|
10 | mythtv/libs/libmythui/mythuihelper.cpp | 4 +++- |
---|
11 | mythtv/libs/libmythui/mythvirtualkeyboard.cpp | 3 ++- |
---|
12 | 4 files changed, 12 insertions(+), 7 deletions(-) |
---|
13 | |
---|
14 | |
---|
15 | diff --git a/mythtv/libs/libmythui/mythdialogbox.cpp b/mythtv/libs/libmythui/mythdialogbox.cpp |
---|
16 | index 18d0840..db64bfd 100644 |
---|
17 | --- a/mythtv/libs/libmythui/mythdialogbox.cpp |
---|
18 | +++ b/mythtv/libs/libmythui/mythdialogbox.cpp |
---|
19 | @@ -216,7 +216,8 @@ bool MythConfirmationDialog::Create(void) |
---|
20 | |
---|
21 | messageText->SetText(m_message); |
---|
22 | |
---|
23 | - BuildFocusList(); |
---|
24 | + if (!BuildFocusList()) |
---|
25 | + VERBOSE(VB_IMPORTANT, "Failed to build a focuslist."); |
---|
26 | |
---|
27 | SetFocusWidget(okButton); |
---|
28 | |
---|
29 | @@ -382,7 +383,8 @@ bool MythTextInputDialog::Create(void) |
---|
30 | |
---|
31 | messageText->SetText(m_message); |
---|
32 | |
---|
33 | - BuildFocusList(); |
---|
34 | + if (!BuildFocusList()) |
---|
35 | + VERBOSE(VB_IMPORTANT, "Failed to build a focuslist."); |
---|
36 | |
---|
37 | return true; |
---|
38 | } |
---|
39 | @@ -483,7 +485,8 @@ bool MythUISearchDialog::Create(void) |
---|
40 | if (m_matchesText) |
---|
41 | m_matchesText->SetText(tr("%n match(es)", "", 0)); |
---|
42 | |
---|
43 | - BuildFocusList(); |
---|
44 | + if (!BuildFocusList()) |
---|
45 | + VERBOSE(VB_IMPORTANT, "Failed to build a focuslist."); |
---|
46 | |
---|
47 | slotUpdateList(); |
---|
48 | |
---|
49 | diff --git a/mythtv/libs/libmythui/mythmainwindow.cpp b/mythtv/libs/libmythui/mythmainwindow.cpp |
---|
50 | index a0a9940..9235149 100644 |
---|
51 | --- a/mythtv/libs/libmythui/mythmainwindow.cpp |
---|
52 | +++ b/mythtv/libs/libmythui/mythmainwindow.cpp |
---|
53 | @@ -1247,9 +1247,8 @@ void MythMainWindow::RegisterJump(const QString &destination, |
---|
54 | query.bindValue(":DEST", destination); |
---|
55 | query.bindValue(":HOST", GetMythDB()->GetHostName()); |
---|
56 | |
---|
57 | - if (query.exec() && query.isActive() && query.size() > 0) |
---|
58 | + if (query.exec() && query.isActive() && query.next()) |
---|
59 | { |
---|
60 | - query.next(); |
---|
61 | keybind = query.value(0).toString(); |
---|
62 | } |
---|
63 | else |
---|
64 | diff --git a/mythtv/libs/libmythui/mythuihelper.cpp b/mythtv/libs/libmythui/mythuihelper.cpp |
---|
65 | index 9bc64a4..285e8be 100644 |
---|
66 | --- a/mythtv/libs/libmythui/mythuihelper.cpp |
---|
67 | +++ b/mythtv/libs/libmythui/mythuihelper.cpp |
---|
68 | @@ -1228,7 +1228,9 @@ MythImage *MythUIHelper::LoadCacheImage(QString srcfile, QString label) |
---|
69 | if (fi.exists()) |
---|
70 | { |
---|
71 | // Now compare the time on the source versus our cached copy |
---|
72 | - FindThemeFile(srcfile); |
---|
73 | + if (!FindThemeFile(srcfile)) |
---|
74 | + return ret; |
---|
75 | + |
---|
76 | QFileInfo original(srcfile); |
---|
77 | if (fi.lastModified() > original.lastModified()) |
---|
78 | { |
---|
79 | diff --git a/mythtv/libs/libmythui/mythvirtualkeyboard.cpp b/mythtv/libs/libmythui/mythvirtualkeyboard.cpp |
---|
80 | index 9a23336..a3b6dd4 100644 |
---|
81 | --- a/mythtv/libs/libmythui/mythvirtualkeyboard.cpp |
---|
82 | +++ b/mythtv/libs/libmythui/mythvirtualkeyboard.cpp |
---|
83 | @@ -106,7 +106,8 @@ bool MythUIVirtualKeyboard::Create() |
---|
84 | if (!LoadWindowFromXML("keyboard/keyboard.xml", "keyboard", this)) |
---|
85 | return false; |
---|
86 | |
---|
87 | - BuildFocusList(); |
---|
88 | + if (!BuildFocusList()) |
---|
89 | + VERBOSE(VB_IMPORTANT, "Failed to build a focuslist."); |
---|
90 | |
---|
91 | loadKeyDefinitions(GetMythUI()->GetLanguageAndVariant()); |
---|
92 | updateKeys(true); |
---|