Merge lp:~aacid/unity-2d/noEmptyCStringsToQStrings into lp:unity-2d

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 850
Merged at revision: 852
Proposed branch: lp:~aacid/unity-2d/noEmptyCStringsToQStrings
Merge into: lp:unity-2d
Diff against target: 110 lines (+9/-12)
5 files modified
libunity-2d-private/src/giodefaultapplication.cpp (+1/-4)
libunity-2d-private/src/launcherapplication.cpp (+5/-5)
libunity-2d-private/src/launcherdevice.cpp (+1/-1)
libunity-2d-private/src/panelstyle.cpp (+1/-1)
panel/applets/appname/appnameapplet.cpp (+1/-1)
To merge this branch: bzr merge lp:~aacid/unity-2d/noEmptyCStringsToQStrings
Reviewer Review Type Date Requested Status
Gerry Boland Pending
Review via email: mp+88535@code.launchpad.net

Description of the change

Do not use "" to assign to QStrings, use QString() instead that is much faster or do not do nothing if they were just declared

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 'libunity-2d-private/src/giodefaultapplication.cpp'
2--- libunity-2d-private/src/giodefaultapplication.cpp 2011-09-01 12:28:40 +0000
3+++ libunity-2d-private/src/giodefaultapplication.cpp 2012-01-13 17:35:25 +0000
4@@ -35,9 +35,6 @@
5
6 GioDefaultApplication::GioDefaultApplication(QObject* parent)
7 : QObject(parent),
8- m_contentType(""),
9- m_desktopFile(""),
10- m_defaultDesktopFile(""),
11 m_mimeappsWatcher(new QFileSystemWatcher(this))
12 {
13 /* GIO does not have any signal to inform us of changes in default
14@@ -125,7 +122,7 @@
15 if (!app_info.isNull()) {
16 m_desktopFile = QString::fromUtf8(g_desktop_app_info_get_filename((GDesktopAppInfo*)app_info.data()));
17 } else {
18- m_desktopFile = "";
19+ m_desktopFile = QString();
20 }
21
22 Q_EMIT desktopFileChanged();
23
24=== modified file 'libunity-2d-private/src/launcherapplication.cpp'
25--- libunity-2d-private/src/launcherapplication.cpp 2012-01-03 11:24:53 +0000
26+++ libunity-2d-private/src/launcherapplication.cpp 2012-01-13 17:35:25 +0000
27@@ -182,7 +182,7 @@
28 return QString::fromUtf8(sn_startup_sequence_get_name(m_snStartupSequence.data()));
29 }
30
31- return QString("");
32+ return QString();
33 }
34
35 QString
36@@ -206,7 +206,7 @@
37 return QString::fromUtf8(sn_startup_sequence_get_icon_name(m_snStartupSequence.data()));
38 }
39
40- return QString("");
41+ return QString();
42 }
43
44 QString
45@@ -216,7 +216,7 @@
46 return m_application->application_type();
47 }
48
49- return QString("");
50+ return QString();
51 }
52
53 QString
54@@ -230,7 +230,7 @@
55 return QString::fromUtf8(g_desktop_app_info_get_filename((GDesktopAppInfo*)m_appInfo.data()));
56 }
57
58- return QString("");
59+ return QString();
60 }
61
62 QString
63@@ -244,7 +244,7 @@
64 return QString::fromUtf8(sn_startup_sequence_get_binary_name(m_snStartupSequence.data()));
65 }
66
67- return QString("");
68+ return QString();
69 }
70
71 void
72
73=== modified file 'libunity-2d-private/src/launcherdevice.cpp'
74--- libunity-2d-private/src/launcherdevice.cpp 2011-08-03 11:57:25 +0000
75+++ libunity-2d-private/src/launcherdevice.cpp 2012-01-13 17:35:25 +0000
76@@ -87,7 +87,7 @@
77 return s;
78 }
79
80- return QString("");
81+ return QString();
82 }
83
84 QString
85
86=== modified file 'libunity-2d-private/src/panelstyle.cpp'
87--- libunity-2d-private/src/panelstyle.cpp 2011-10-05 08:27:09 +0000
88+++ libunity-2d-private/src/panelstyle.cpp 2012-01-13 17:35:25 +0000
89@@ -105,7 +105,7 @@
90
91 switch (state) {
92 case PanelStyle::NormalState:
93- stateString = "";
94+ // stateString = QString(); no need since we just declared and noone assigned anything to it
95 break;
96 case PanelStyle::PrelightState:
97 stateString = "_focused_prelight";
98
99=== modified file 'panel/applets/appname/appnameapplet.cpp'
100--- panel/applets/appname/appnameapplet.cpp 2011-12-02 06:41:22 +0000
101+++ panel/applets/appname/appnameapplet.cpp 2012-01-13 17:35:25 +0000
102@@ -295,7 +295,7 @@
103 } else if (showDesktopLabel) {
104 d->m_label->setText(u2dTr("Ubuntu Desktop"));
105 } else {
106- d->m_label->setText("");
107+ d->m_label->setText(QString());
108 }
109
110 // Define label width

Subscribers

People subscribed via source and target branches