Merge lp:~aacid/bamf-qt/constref into lp:bamf-qt

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 396
Merged at revision: 398
Proposed branch: lp:~aacid/bamf-qt/constref
Merge into: lp:bamf-qt
Diff against target: 129 lines (+10/-10)
10 files modified
bamf-application.cpp (+1/-1)
bamf-application.h (+1/-1)
bamf-factory.cpp (+1/-1)
bamf-factory.h (+1/-1)
bamf-indicator.cpp (+1/-1)
bamf-indicator.h (+1/-1)
bamf-view.cpp (+1/-1)
bamf-view.h (+1/-1)
bamf-window.cpp (+1/-1)
bamf-window.h (+1/-1)
To merge this branch: bzr merge lp:~aacid/bamf-qt/constref
Reviewer Review Type Date Requested Status
Gerry Boland Pending
Review via email: mp+103080@code.launchpad.net

Commit message

Add const & to some parameters

Avoids a copy of each object. It is true that most of those objects are
implicitly shared so the win isn't huge but we still save some atomic/mutex/something locking

Description of the change

Add const & to some parameters

Avoids a copy of each object. It is true that most of those objects are
implicitly shared so the win isn't huge but we still save some atomic/mutex/something locking

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bamf-application.cpp'
2--- bamf-application.cpp 2011-01-13 21:37:10 +0000
3+++ bamf-application.cpp 2012-04-23 11:41:18 +0000
4@@ -22,7 +22,7 @@
5 #include "bamf-application-proxy.h"
6 #include "bamf-factory.h"
7
8-BamfApplication::BamfApplication(QString path) :
9+BamfApplication::BamfApplication(const QString &path) :
10 BamfView(path), m_application_proxy(NULL)
11 {
12 m_application_proxy = new OrgAyatanaBamfApplicationInterface("org.ayatana.bamf", path,
13
14=== modified file 'bamf-application.h'
15--- bamf-application.h 2011-07-27 22:42:41 +0000
16+++ bamf-application.h 2012-04-23 11:41:18 +0000
17@@ -39,7 +39,7 @@
18 friend class BamfFactory;
19
20 private:
21- BamfApplication(QString path);
22+ BamfApplication(const QString &path);
23 ~BamfApplication();
24 BamfApplication(BamfApplication const&);
25 void operator=(BamfApplication const&);
26
27=== modified file 'bamf-factory.cpp'
28--- bamf-factory.cpp 2012-04-13 14:48:10 +0000
29+++ bamf-factory.cpp 2012-04-23 11:41:18 +0000
30@@ -31,7 +31,7 @@
31 }
32
33 BamfView *
34-BamfFactory::view_for_path(QString path)
35+BamfFactory::view_for_path(const QString &path)
36 {
37 if (path.isEmpty())
38 return NULL;
39
40=== modified file 'bamf-factory.h'
41--- bamf-factory.h 2011-07-27 22:42:41 +0000
42+++ bamf-factory.h 2012-04-23 11:41:18 +0000
43@@ -37,7 +37,7 @@
44 return instance;
45 }
46
47- BamfView * view_for_path(QString path);
48+ BamfView * view_for_path(const QString &path);
49
50 private:
51 BamfFactory();
52
53=== modified file 'bamf-indicator.cpp'
54--- bamf-indicator.cpp 2011-01-31 10:16:00 +0000
55+++ bamf-indicator.cpp 2012-04-23 11:41:18 +0000
56@@ -22,7 +22,7 @@
57 #include "bamf-indicator-proxy.h"
58 #include "bamf-factory.h"
59
60-BamfIndicator::BamfIndicator(QString path) :
61+BamfIndicator::BamfIndicator(const QString &path) :
62 BamfView(path), m_indicator_proxy(NULL)
63 {
64 m_indicator_proxy = new OrgAyatanaBamfIndicatorInterface("org.ayatana.bamf", path,
65
66=== modified file 'bamf-indicator.h'
67--- bamf-indicator.h 2011-07-27 22:42:41 +0000
68+++ bamf-indicator.h 2012-04-23 11:41:18 +0000
69@@ -38,7 +38,7 @@
70 friend class BamfFactory;
71
72 private:
73- BamfIndicator(QString path);
74+ BamfIndicator(const QString &path);
75 ~BamfIndicator();
76 BamfIndicator(BamfIndicator const&);
77 void operator=(BamfIndicator const&);
78
79=== modified file 'bamf-view.cpp'
80--- bamf-view.cpp 2010-12-21 09:56:42 +0000
81+++ bamf-view.cpp 2012-04-23 11:41:18 +0000
82@@ -22,7 +22,7 @@
83 #include "bamf-view-proxy.h"
84 #include "bamf-factory.h"
85
86-BamfView::BamfView(QString path) :
87+BamfView::BamfView(const QString &path) :
88 m_proxy(NULL)
89 {
90 m_proxy = new OrgAyatanaBamfViewInterface("org.ayatana.bamf", path,
91
92=== modified file 'bamf-view.h'
93--- bamf-view.h 2011-07-27 22:42:41 +0000
94+++ bamf-view.h 2012-04-23 11:41:18 +0000
95@@ -43,7 +43,7 @@
96 friend class BamfFactory;
97
98 protected:
99- BamfView(QString path);
100+ BamfView(const QString &path);
101 ~BamfView();
102
103 private:
104
105=== modified file 'bamf-window.cpp'
106--- bamf-window.cpp 2011-01-13 21:37:10 +0000
107+++ bamf-window.cpp 2012-04-23 11:41:18 +0000
108@@ -22,7 +22,7 @@
109 #include "bamf-window-proxy.h"
110 #include "bamf-factory.h"
111
112-BamfWindow::BamfWindow(QString path) :
113+BamfWindow::BamfWindow(const QString &path) :
114 BamfView(path), m_window_proxy(NULL)
115 {
116 m_window_proxy = new OrgAyatanaBamfWindowInterface("org.ayatana.bamf", path,
117
118=== modified file 'bamf-window.h'
119--- bamf-window.h 2011-07-27 22:42:41 +0000
120+++ bamf-window.h 2012-04-23 11:41:18 +0000
121@@ -39,7 +39,7 @@
122 friend class BamfFactory;
123
124 private:
125- BamfWindow(QString path);
126+ BamfWindow(const QString &path);
127 ~BamfWindow();
128 BamfWindow(BamfWindow const&);
129 void operator=(BamfWindow const&);

Subscribers

People subscribed via source and target branches