Merge lp:~aacid/unity8/fast_string_concatenation into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michael Zanetti
Approved revision: 1988
Merged at revision: 2015
Proposed branch: lp:~aacid/unity8/fast_string_concatenation
Merge into: lp:unity8
Diff against target: 117 lines (+20/-15)
7 files modified
CMakeLists.txt (+3/-0)
plugins/IntegratedLightDM/UsersModel.cpp (+7/-6)
plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp (+2/-1)
tests/mocks/Unity/Launcher/MockQuickListModel.cpp (+1/-1)
tests/mocks/Unity/fake_resultsmodel.cpp (+1/-1)
tests/mocks/Unity/fake_scopesoverview.cpp (+1/-1)
tests/plugins/Wizard/tst_pagelist.cpp (+5/-5)
To merge this branch: bzr merge lp:~aacid/unity8/fast_string_concatenation
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+272904@code.launchpad.net

Commit message

Enable Efficient String Construction by default

See http://blog.qt.io/blog/2011/06/13/string-concatenation-with-qstringbuilder/

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1988
http://jenkins.qa.ubuntu.com/job/unity8-ci/6390/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/4433
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-wily-touch/768
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1102
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-wily/420
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/997
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/998
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-amd64-ci/629
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-i386-ci/630
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-mako/3608
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4430
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4430/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/23815
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-wily-mako/463
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/768
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/768/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/23810

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6390/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

ok. works for me. Seems like a good idea to have such optimizations in a project of this size.

 * Did you perform an exploratory manual test run of the code change and any related functionality?

nothing really changed. tests still passing

 * Did CI run pass? If not, please explain why.

yes

 * Did you make sure that the branch does not contain spurious tags?

yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2015-09-02 08:04:41 +0000
+++ CMakeLists.txt 2015-09-30 13:12:27 +0000
@@ -101,6 +101,9 @@
101# Save a few container detach and conversions101# Save a few container detach and conversions
102add_definitions(-DQT_STRICT_ITERATORS)102add_definitions(-DQT_STRICT_ITERATORS)
103103
104# Use the fast string builder
105add_definitions(-DQT_USE_QSTRINGBUILDER)
106
104# Autopilot tests107# Autopilot tests
105include(autopilot)108include(autopilot)
106declare_autopilot_test(shell unity8.shell ${CMAKE_SOURCE_DIR}/tests/autopilot/)109declare_autopilot_test(shell unity8.shell ${CMAKE_SOURCE_DIR}/tests/autopilot/)
107110
=== modified file 'plugins/IntegratedLightDM/UsersModel.cpp'
--- plugins/IntegratedLightDM/UsersModel.cpp 2015-04-30 09:31:51 +0000
+++ plugins/IntegratedLightDM/UsersModel.cpp 2015-09-30 13:12:27 +0000
@@ -43,16 +43,17 @@
4343
44QVariant MangleModel::data(const QModelIndex &index, int role) const44QVariant MangleModel::data(const QModelIndex &index, int role) const
45{45{
46 QVariant data = QSortFilterProxyModel::data(index, role);46 QVariant variantData = QSortFilterProxyModel::data(index, role);
4747
48 // If user's real name is empty, switch to unix name48 // If user's real name is empty, switch to unix name
49 if (role == QLightDM::UsersModel::RealNameRole && data.toString().isEmpty()) {49 if (role == QLightDM::UsersModel::RealNameRole && variantData.toString().isEmpty()) {
50 data = QSortFilterProxyModel::data(index, QLightDM::UsersModel::NameRole);50 variantData = QSortFilterProxyModel::data(index, QLightDM::UsersModel::NameRole);
51 } else if (role == QLightDM::UsersModel::BackgroundPathRole && data.toString().startsWith('#')) {51 } else if (role == QLightDM::UsersModel::BackgroundPathRole && variantData.toString().startsWith('#')) {
52 data = "data:image/svg+xml,<svg><rect width='100%' height='100%' fill='" + data.toString() + "'/></svg>";52 const QString stringData = "data:image/svg+xml,<svg><rect width='100%' height='100%' fill='" + variantData.toString() + "'/></svg>";
53 variantData = stringData;
53 }54 }
5455
55 return data;56 return variantData;
56}57}
5758
58// **** Now we continue with actual UsersModel class ****59// **** Now we continue with actual UsersModel class ****
5960
=== modified file 'plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp'
--- plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp 2015-09-14 09:11:08 +0000
+++ plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp 2015-09-30 13:12:27 +0000
@@ -34,7 +34,8 @@
34 entries.reserve(users.count());34 entries.reserve(users.count());
35 Q_FOREACH(const QString &user, users)35 Q_FOREACH(const QString &user, users)
36 {36 {
37 QString name = settings.value(user + "/name", user[0].toUpper() + user.mid(1)).toString();37 QVariant defaultValue = QString(user[0].toUpper() + user.mid(1));
38 QString name = settings.value(user + "/name", defaultValue).toString();
38 entries.append({user, name, 0, 0, false, false, 0, 0});39 entries.append({user, name, 0, 0, false, false, 0, 0});
39 }40 }
40}41}
4142
=== modified file 'tests/mocks/Unity/Launcher/MockQuickListModel.cpp'
--- tests/mocks/Unity/Launcher/MockQuickListModel.cpp 2013-08-19 15:10:58 +0000
+++ tests/mocks/Unity/Launcher/MockQuickListModel.cpp 2015-09-30 13:12:27 +0000
@@ -32,7 +32,7 @@
32 switch (role)32 switch (role)
33 {33 {
34 case RoleLabel:34 case RoleLabel:
35 return QLatin1String("test menu entry ") + QString::number(index.row());35 return QString(QLatin1String("test menu entry ") + QString::number(index.row()));
36 case RoleIcon:36 case RoleIcon:
37 return QLatin1String("copy.png");37 return QLatin1String("copy.png");
38 case RoleClickable:38 case RoleClickable:
3939
=== modified file 'tests/mocks/Unity/fake_resultsmodel.cpp'
--- tests/mocks/Unity/fake_resultsmodel.cpp 2015-09-22 10:44:21 +0000
+++ tests/mocks/Unity/fake_resultsmodel.cpp 2015-09-30 13:12:27 +0000
@@ -78,7 +78,7 @@
78 case RoleTitle:78 case RoleTitle:
79 return QString("Title.%1.%2").arg(m_categoryId).arg(index.row());79 return QString("Title.%1.%2").arg(m_categoryId).arg(index.row());
80 case RoleArt:80 case RoleArt:
81 return qmlDirectory() + "/graphics/applicationIcons/dash.png";81 return QString(qmlDirectory() + "/graphics/applicationIcons/dash.png");
82 case RoleSubtitle:82 case RoleSubtitle:
83 return QString("Subtitle.%1.%2").arg(m_categoryId).arg(index.row());83 return QString("Subtitle.%1.%2").arg(m_categoryId).arg(index.row());
84 case RoleMascot:84 case RoleMascot:
8585
=== modified file 'tests/mocks/Unity/fake_scopesoverview.cpp'
--- tests/mocks/Unity/fake_scopesoverview.cpp 2015-09-22 10:44:21 +0000
+++ tests/mocks/Unity/fake_scopesoverview.cpp 2015-09-30 13:12:27 +0000
@@ -308,7 +308,7 @@
308 case RoleSubtitle:308 case RoleSubtitle:
309 return scope && scope->name() == "Videos this is long ab cd ef gh ij kl" ? "tube, movies, cinema, pictures, art, moving images, magic in a box" : QString();309 return scope && scope->name() == "Videos this is long ab cd ef gh ij kl" ? "tube, movies, cinema, pictures, art, moving images, magic in a box" : QString();
310 case RoleArt:310 case RoleArt:
311 return qmlDirectory() + "/graphics/applicationIcons/dash.png";311 return QString(qmlDirectory() + "/graphics/applicationIcons/dash.png");
312 case RoleMascot:312 case RoleMascot:
313 case RoleEmblem:313 case RoleEmblem:
314 case RoleSummary:314 case RoleSummary:
315315
=== modified file 'tests/plugins/Wizard/tst_pagelist.cpp'
--- tests/plugins/Wizard/tst_pagelist.cpp 2014-11-14 17:47:00 +0000
+++ tests/plugins/Wizard/tst_pagelist.cpp 2015-09-30 13:12:27 +0000
@@ -88,13 +88,13 @@
8888
89 PageList pageList;89 PageList pageList;
90 QCOMPARE(pageList.index(), -1);90 QCOMPARE(pageList.index(), -1);
91 QCOMPARE(pageList.next(), root.path() + "/a/" + PAGES_PATH + "/1.qml");91 QCOMPARE(pageList.next(), QString(root.path() + "/a/" + PAGES_PATH + "/1.qml"));
92 QCOMPARE(pageList.prev(), QString());92 QCOMPARE(pageList.prev(), QString());
93 QCOMPARE(pageList.next(), root.path() + "/a/" + PAGES_PATH + "/2.qml");93 QCOMPARE(pageList.next(), QString(root.path() + "/a/" + PAGES_PATH + "/2.qml"));
94 QCOMPARE(pageList.prev(), root.path() + "/a/" + PAGES_PATH + "/1.qml");94 QCOMPARE(pageList.prev(), QString(root.path() + "/a/" + PAGES_PATH + "/1.qml"));
95 QCOMPARE(pageList.index(), 0);95 QCOMPARE(pageList.index(), 0);
96 QCOMPARE(pageList.next(), root.path() + "/a/" + PAGES_PATH + "/2.qml");96 QCOMPARE(pageList.next(), QString(root.path() + "/a/" + PAGES_PATH + "/2.qml"));
97 QCOMPARE(pageList.next(), root.path() + "/a/" + PAGES_PATH + "/3.qml");97 QCOMPARE(pageList.next(), QString(root.path() + "/a/" + PAGES_PATH + "/3.qml"));
98 QCOMPARE(pageList.index(), 2);98 QCOMPARE(pageList.index(), 2);
99 QCOMPARE(pageList.next(), QString());99 QCOMPARE(pageList.next(), QString());
100 QCOMPARE(pageList.index(), 2);100 QCOMPARE(pageList.index(), 2);

Subscribers

People subscribed via source and target branches