Ticket #7169: programs_mythfrontend-pass-by-value

File programs_mythfrontend-pass-by-value, 2.6 KB (added by Erik Hovland <erik@…>, 11 years ago)

Pass RecordingInfo? by reference to use fewer resources.

Line 
1Change to pass-by-reference or pass-by-pointer where pass-by-value is too heavy.
2
3From: Erik Hovland <erik@hovland.org>
4
5
6---
7
8 mythtv/programs/mythfrontend/schedulecommon.cpp |    6 +++---
9 mythtv/programs/mythfrontend/schedulecommon.h   |    6 +++---
10 2 files changed, 6 insertions(+), 6 deletions(-)
11
12
13diff --git a/mythtv/programs/mythfrontend/schedulecommon.cpp b/mythtv/programs/mythfrontend/schedulecommon.cpp
14index ad9c0fd..21d1635 100644
15--- a/mythtv/programs/mythfrontend/schedulecommon.cpp
16+++ b/mythtv/programs/mythfrontend/schedulecommon.cpp
17@@ -137,7 +137,7 @@ void ScheduleCommon::MakeOverride(RecordingInfo *recinfo)
18 *  \brief Creates a dialog displaying current recording status and options
19 *         available
20 */
21-void ScheduleCommon::ShowRecordingDialog(RecordingInfo recinfo)
22+void ScheduleCommon::ShowRecordingDialog(const RecordingInfo& recinfo)
23 {
24     QString message = recinfo.title;
25     
26@@ -248,7 +248,7 @@ void ScheduleCommon::ShowRecordingDialog(RecordingInfo recinfo)
27 *  \brief Creates a dialog displaying current recording status and options
28 *         available
29 */
30-void ScheduleCommon::ShowNotRecordingDialog(RecordingInfo recinfo)
31+void ScheduleCommon::ShowNotRecordingDialog(const RecordingInfo& recinfo)
32 {
33     QString timeFormat = gContext->GetSetting("TimeFormat", "h:mm AP");
34 
35@@ -500,7 +500,7 @@ void ScheduleCommon::customEvent(QEvent *event)
36 *  \brief Returns true if a search should be employed to find a matching
37 *         program.
38 */
39-bool ScheduleCommon::IsFindApplicable(RecordingInfo recInfo) const
40+bool ScheduleCommon::IsFindApplicable(const RecordingInfo& recInfo) const
41 {
42     return recInfo.rectype == kFindDailyRecord ||
43            recInfo.rectype == kFindWeeklyRecord;
44diff --git a/mythtv/programs/mythfrontend/schedulecommon.h b/mythtv/programs/mythfrontend/schedulecommon.h
45index 19926c8..987c0f3 100644
46--- a/mythtv/programs/mythfrontend/schedulecommon.h
47+++ b/mythtv/programs/mythfrontend/schedulecommon.h
48@@ -24,13 +24,13 @@ class ScheduleCommon : public MythScreenType
49     void EditScheduled(ProgramInfo *pginfo);
50     void EditScheduled(RecordingInfo *recinfo);
51     void MakeOverride(RecordingInfo *recinfo);
52-    void ShowRecordingDialog(RecordingInfo recinfo);
53-    void ShowNotRecordingDialog(RecordingInfo recinfo);
54+    void ShowRecordingDialog(const RecordingInfo& recinfo);
55+    void ShowNotRecordingDialog(const RecordingInfo& recinfo);
56 
57     virtual void customEvent(QEvent*);
58 
59   private:
60-    bool IsFindApplicable(RecordingInfo recInfo) const;
61+    bool IsFindApplicable(const RecordingInfo& recInfo) const;
62         
63 };
64