on xenial help sign in
Improvements from running clazy over the code
abf56e4Albert Astals Cid
include/paths.h.in+13−13
@@ -29,23 +29,23 @@
29
29
30inline bool isRunningInstalled() {
30inline bool isRunningInstalled() {
31 static bool installed = (QCoreApplication::applicationDirPath() ==
31 static bool installed = (QCoreApplication::applicationDirPath() ==
32− QDir(("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@")).canonicalPath());
32+ QDir(QStringLiteral("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@")).canonicalPath());
33 return installed;
33 return installed;
34}
34}
35
35
36inline QString buildDirectory() {
36inline QString buildDirectory() {
37 if (!qEnvironmentVariableIsEmpty("UNITY_BINARY_DIR")) return qgetenv("UNITY_BINARY_DIR");
37 if (!qEnvironmentVariableIsEmpty("UNITY_BINARY_DIR")) return qgetenv("UNITY_BINARY_DIR");
38− return QString("@CMAKE_BINARY_DIR@");
38+ return QStringLiteral("@CMAKE_BINARY_DIR@");
39}
39}
40
40
41inline QString sourceDirectory() {
41inline QString sourceDirectory() {
42 if (!qEnvironmentVariableIsEmpty("UNITY_SOURCE_DIR")) return qgetenv("UNITY_SOURCE_DIR");
42 if (!qEnvironmentVariableIsEmpty("UNITY_SOURCE_DIR")) return qgetenv("UNITY_SOURCE_DIR");
43− return QString("@CMAKE_SOURCE_DIR@");
43+ return QStringLiteral("@CMAKE_SOURCE_DIR@");
44}
44}
45
45
46inline QString translationDirectory() {
46inline QString translationDirectory() {
47 if (isRunningInstalled()) {
47 if (isRunningInstalled()) {
48− return QString("@CMAKE_INSTALL_PREFIX@/share/locale");
48+ return QStringLiteral("@CMAKE_INSTALL_PREFIX@/share/locale");
49 } else {
49 } else {
50 return QString(buildDirectory() + "/po/locale");
50 return QString(buildDirectory() + "/po/locale");
51 }
51 }
@@ -53,7 +53,7 @@ inline QString translationDirectory() {
53
53
54inline QString qmlDirectory() {
54inline QString qmlDirectory() {
55 if (isRunningInstalled()) {
55 if (isRunningInstalled()) {
56− return QString("@CMAKE_INSTALL_PREFIX@/@SHELL_APP_DIR@/");
56+ return QStringLiteral("@CMAKE_INSTALL_PREFIX@/@SHELL_APP_DIR@/");
57 } else {
57 } else {
58 return QString(sourceDirectory() + "/qml");
58 return QString(sourceDirectory() + "/qml");
59 }
59 }
@@ -70,7 +70,7 @@ inline QStringList overrideImportPaths() {
70inline QStringList nonMirImportPaths() {
70inline QStringList nonMirImportPaths() {
71 QStringList paths;
71 QStringList paths;
72 if (isRunningInstalled()) {
72 if (isRunningInstalled()) {
73− paths << QString("@CMAKE_INSTALL_PREFIX@/@SHELL_INSTALL_QML@/nonmirplugins");
73+ paths << QStringLiteral("@CMAKE_INSTALL_PREFIX@/@SHELL_INSTALL_QML@/nonmirplugins");
74 } else {
74 } else {
75 paths << QString(buildDirectory() + "/nonmirplugins");
75 paths << QString(buildDirectory() + "/nonmirplugins");
76 }
76 }
@@ -80,13 +80,13 @@ inline QStringList nonMirImportPaths() {
80inline QStringList fallbackImportPaths() {
80inline QStringList fallbackImportPaths() {
81 QStringList paths;
81 QStringList paths;
82 if (isRunningInstalled()) {
82 if (isRunningInstalled()) {
83− paths << QString("@CMAKE_INSTALL_PREFIX@/@SHELL_INSTALL_QML@");
83+ paths << QStringLiteral("@CMAKE_INSTALL_PREFIX@/@SHELL_INSTALL_QML@");
84− paths << QString("@USS_PRIVATE_PLUGINDIR@");
84+ paths << QStringLiteral("@USS_PRIVATE_PLUGINDIR@");
85− paths << QString("@SHELL_PLUGINDIR@");
85+ paths << QStringLiteral("@SHELL_PLUGINDIR@");
86− paths << QString("@CMAKE_INSTALL_PREFIX@/@SHELL_INSTALL_QML@/mocks");
86+ paths << QStringLiteral("@CMAKE_INSTALL_PREFIX@/@SHELL_INSTALL_QML@/mocks");
87 } else {
87 } else {
88− paths << QString("@USS_PRIVATE_PLUGINDIR@");
88+ paths << QStringLiteral("@USS_PRIVATE_PLUGINDIR@");
89− paths << QString("@SHELL_PLUGINDIR@");
89+ paths << QStringLiteral("@SHELL_PLUGINDIR@");
90 paths << QString(buildDirectory() + "/tests/mocks");
90 paths << QString(buildDirectory() + "/tests/mocks");
91 }
91 }
92 return paths;
92 return paths;
@@ -94,7 +94,7 @@ inline QStringList fallbackImportPaths() {
94
94
95inline QString mockPluginsDir() {
95inline QString mockPluginsDir() {
96 if (isRunningInstalled()) {
96 if (isRunningInstalled()) {
97− return QString("@CMAKE_INSTALL_PREFIX@/@SHELL_INSTALL_QML@/mocks");
97+ return QStringLiteral("@CMAKE_INSTALL_PREFIX@/@SHELL_INSTALL_QML@/mocks");
98 } else {
98 } else {
99 return QString(buildDirectory() + "/tests/mocks");
99 return QString(buildDirectory() + "/tests/mocks");
100 }
100 }
libs/UbuntuGestures/DebugHelpers.cpp+7−7
@@ -22,15 +22,15 @@ QString touchPointStateToString(Qt::TouchPointState state)
22{
22{
23 switch (state) {
23 switch (state) {
24 case Qt::TouchPointPressed:
24 case Qt::TouchPointPressed:
25− return QString("pressed");
25+ return QStringLiteral("pressed");
26 case Qt::TouchPointMoved:
26 case Qt::TouchPointMoved:
27− return QString("moved");
27+ return QStringLiteral("moved");
28 case Qt::TouchPointStationary:
28 case Qt::TouchPointStationary:
29− return QString("stationary");
29+ return QStringLiteral("stationary");
30 case Qt::TouchPointReleased:
30 case Qt::TouchPointReleased:
31− return QString("released");
31+ return QStringLiteral("released");
32 default:
32 default:
33− return QString("INVALID_STATE");
33+ return QStringLiteral("INVALID_STATE");
34 }
34 }
35}
35}
36
36
@@ -57,7 +57,7 @@ QString touchEventToString(const QTouchEvent *ev)
57
57
58 foreach(const QTouchEvent::TouchPoint& touchPoint, ev->touchPoints()) {
58 foreach(const QTouchEvent::TouchPoint& touchPoint, ev->touchPoints()) {
59 message.append(
59 message.append(
60− QString("(id:%1, state:%2, scenePos:(%3,%4)) ")
60+ QStringLiteral("(id:%1, state:%2, scenePos:(%3,%4)) ")
61 .arg(touchPoint.id())
61 .arg(touchPoint.id())
62 .arg(touchPointStateToString(touchPoint.state()))
62 .arg(touchPointStateToString(touchPoint.state()))
63 .arg(touchPoint.scenePos().x())
63 .arg(touchPoint.scenePos().x())
@@ -89,7 +89,7 @@ QString mouseEventToString(const QMouseEvent *ev)
89 message.append("INVALID_MOUSE_EVENT_TYPE ");
89 message.append("INVALID_MOUSE_EVENT_TYPE ");
90 }
90 }
91
91
92− message.append(QString("pos(%1, %2)").arg(ev->x()).arg(ev->y()));
92+ message.append(QStringLiteral("pos(%1, %2)").arg(ev->x()).arg(ev->y()));
93
93
94 return message;
94 return message;
95}
95}
libs/UbuntuGestures/TouchRegistry.cpp+1−1
@@ -105,7 +105,7 @@ void TouchRegistry::deliverTouchUpdatesToUndecidedCandidatesAndWatchers(const QT
105 // E.g.: a QTouchEvent might have three touches but a given item might be interested in only
105 // E.g.: a QTouchEvent might have three touches but a given item might be interested in only
106 // one of them. So he will get a UnownedTouchEvent from this QTouchEvent containing only that
106 // one of them. So he will get a UnownedTouchEvent from this QTouchEvent containing only that
107 // touch point.
107 // touch point.
108− QMap<QQuickItem*, QList<int>> touchIdsForItems;
108+ QHash<QQuickItem*, QList<int>> touchIdsForItems;
109
109
110 // Build touchIdsForItems
110 // Build touchIdsForItems
111 m_touchInfoPool.forEach([&](Pool<TouchInfo>::Iterator &touchInfo) {
111 m_touchInfoPool.forEach([&](Pool<TouchInfo>::Iterator &touchInfo) {
plugins/AccountsService/AccountsService.cpp+35−35
@@ -74,7 +74,7 @@ void AccountsService::setDemoEdges(bool demoEdges)
74{
74{
75 if (m_demoEdges != demoEdges) {
75 if (m_demoEdges != demoEdges) {
76 m_demoEdges = demoEdges;
76 m_demoEdges = demoEdges;
77− m_service->setUserProperty(m_user, "com.canonical.unity.AccountsService", "demo-edges", demoEdges);
77+ m_service->setUserProperty(m_user, QStringLiteral("com.canonical.unity.AccountsService"), QStringLiteral("demo-edges"), demoEdges);
78
78
79 Q_EMIT demoEdgesChanged();
79 Q_EMIT demoEdgesChanged();
80 }
80 }
@@ -114,7 +114,7 @@ void AccountsService::setHereEnabled(bool enabled)
114{
114{
115 if (m_hereEnabled != enabled) {
115 if (m_hereEnabled != enabled) {
116 m_hereEnabled = enabled;
116 m_hereEnabled = enabled;
117− m_service->setUserProperty(m_user, "com.ubuntu.location.providers.here.AccountsService", "LicenseAccepted", enabled);
117+ m_service->setUserProperty(m_user, QStringLiteral("com.ubuntu.location.providers.here.AccountsService"), QStringLiteral("LicenseAccepted"), enabled);
118
118
119 Q_EMIT hereEnabledChanged();
119 Q_EMIT hereEnabledChanged();
120 }
120 }
@@ -133,8 +133,8 @@ bool AccountsService::hereLicensePathValid() const
133void AccountsService::updateDemoEdges(bool async)
133void AccountsService::updateDemoEdges(bool async)
134{
134{
135 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
135 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
136− "com.canonical.unity.AccountsService",
136+ QStringLiteral("com.canonical.unity.AccountsService"),
137− "demo-edges");
137+ QStringLiteral("demo-edges"));
138 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
138 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
139
139
140 connect(watcher, &QDBusPendingCallWatcher::finished,
140 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -162,8 +162,8 @@ void AccountsService::updateDemoEdges(bool async)
162void AccountsService::updateEnableLauncherWhileLocked(bool async)
162void AccountsService::updateEnableLauncherWhileLocked(bool async)
163{
163{
164 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
164 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
165− "com.ubuntu.AccountsService.SecurityPrivacy",
165+ QStringLiteral("com.ubuntu.AccountsService.SecurityPrivacy"),
166− "EnableLauncherWhileLocked");
166+ QStringLiteral("EnableLauncherWhileLocked"));
167 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
167 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
168
168
169 connect(watcher, &QDBusPendingCallWatcher::finished,
169 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -191,8 +191,8 @@ void AccountsService::updateEnableLauncherWhileLocked(bool async)
191void AccountsService::updateEnableIndicatorsWhileLocked(bool async)
191void AccountsService::updateEnableIndicatorsWhileLocked(bool async)
192{
192{
193 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
193 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
194− "com.ubuntu.AccountsService.SecurityPrivacy",
194+ QStringLiteral("com.ubuntu.AccountsService.SecurityPrivacy"),
195− "EnableIndicatorsWhileLocked");
195+ QStringLiteral("EnableIndicatorsWhileLocked"));
196 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
196 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
197
197
198 connect(watcher, &QDBusPendingCallWatcher::finished,
198 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -220,8 +220,8 @@ void AccountsService::updateEnableIndicatorsWhileLocked(bool async)
220void AccountsService::updateBackgroundFile(bool async)
220void AccountsService::updateBackgroundFile(bool async)
221{
221{
222 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
222 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
223− "org.freedesktop.Accounts.User",
223+ QStringLiteral("org.freedesktop.Accounts.User"),
224− "BackgroundFile");
224+ QStringLiteral("BackgroundFile"));
225 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
225 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
226
226
227 connect(watcher, &QDBusPendingCallWatcher::finished,
227 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -249,8 +249,8 @@ void AccountsService::updateBackgroundFile(bool async)
249void AccountsService::updateStatsWelcomeScreen(bool async)
249void AccountsService::updateStatsWelcomeScreen(bool async)
250{
250{
251 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
251 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
252− "com.ubuntu.touch.AccountsService.SecurityPrivacy",
252+ QStringLiteral("com.ubuntu.touch.AccountsService.SecurityPrivacy"),
253− "StatsWelcomeScreen");
253+ QStringLiteral("StatsWelcomeScreen"));
254 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
254 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
255
255
256 connect(watcher, &QDBusPendingCallWatcher::finished,
256 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -278,8 +278,8 @@ void AccountsService::updateStatsWelcomeScreen(bool async)
278void AccountsService::updatePasswordDisplayHint(bool async)
278void AccountsService::updatePasswordDisplayHint(bool async)
279{
279{
280 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
280 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
281− "com.ubuntu.AccountsService.SecurityPrivacy",
281+ QStringLiteral("com.ubuntu.AccountsService.SecurityPrivacy"),
282− "PasswordDisplayHint");
282+ QStringLiteral("PasswordDisplayHint"));
283 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
283 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
284
284
285 connect(watcher, &QDBusPendingCallWatcher::finished,
285 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -307,8 +307,8 @@ void AccountsService::updatePasswordDisplayHint(bool async)
307void AccountsService::updateFailedLogins(bool async)
307void AccountsService::updateFailedLogins(bool async)
308{
308{
309 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
309 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
310− "com.canonical.unity.AccountsService.Private",
310+ QStringLiteral("com.canonical.unity.AccountsService.Private"),
311− "FailedLogins");
311+ QStringLiteral("FailedLogins"));
312 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
312 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
313
313
314 connect(watcher, &QDBusPendingCallWatcher::finished,
314 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -336,8 +336,8 @@ void AccountsService::updateFailedLogins(bool async)
336void AccountsService::updateHereEnabled(bool async)
336void AccountsService::updateHereEnabled(bool async)
337{
337{
338 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
338 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
339− "com.ubuntu.location.providers.here.AccountsService",
339+ QStringLiteral("com.ubuntu.location.providers.here.AccountsService"),
340− "LicenseAccepted");
340+ QStringLiteral("LicenseAccepted"));
341 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
341 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
342
342
343 connect(watcher, &QDBusPendingCallWatcher::finished,
343 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -365,8 +365,8 @@ void AccountsService::updateHereEnabled(bool async)
365void AccountsService::updateHereLicensePath(bool async)
365void AccountsService::updateHereLicensePath(bool async)
366{
366{
367 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
367 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
368− "com.ubuntu.location.providers.here.AccountsService",
368+ QStringLiteral("com.ubuntu.location.providers.here.AccountsService"),
369− "LicenseBasePath");
369+ QStringLiteral("LicenseBasePath"));
370 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
370 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
371
371
372 connect(watcher, &QDBusPendingCallWatcher::finished,
372 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -381,7 +381,7 @@ void AccountsService::updateHereLicensePath(bool async)
381
381
382 QString hereLicensePath = reply.value().toString();
382 QString hereLicensePath = reply.value().toString();
383 if (hereLicensePath.isEmpty() || !QFile::exists(hereLicensePath))
383 if (hereLicensePath.isEmpty() || !QFile::exists(hereLicensePath))
384− hereLicensePath = "";
384+ hereLicensePath = QLatin1String("");
385
385
386 if (m_hereLicensePath.isNull() || m_hereLicensePath != hereLicensePath) {
386 if (m_hereLicensePath.isNull() || m_hereLicensePath != hereLicensePath) {
387 m_hereLicensePath = hereLicensePath;
387 m_hereLicensePath = hereLicensePath;
@@ -403,7 +403,7 @@ void AccountsService::setFailedLogins(uint failedLogins)
403{
403{
404 if (m_failedLogins != failedLogins) {
404 if (m_failedLogins != failedLogins) {
405 m_failedLogins = failedLogins;
405 m_failedLogins = failedLogins;
406− m_service->setUserProperty(m_user, "com.canonical.unity.AccountsService.Private", "FailedLogins", failedLogins);
406+ m_service->setUserProperty(m_user, QStringLiteral("com.canonical.unity.AccountsService.Private"), QStringLiteral("FailedLogins"), failedLogins);
407
407
408 Q_EMIT failedLoginsChanged();
408 Q_EMIT failedLoginsChanged();
409 }
409 }
@@ -415,33 +415,33 @@ void AccountsService::onPropertiesChanged(const QString &user, const QString &in
415 return;
415 return;
416 }
416 }
417
417
418− if (interface == "com.canonical.unity.AccountsService") {
418+ if (interface == QLatin1String("com.canonical.unity.AccountsService")) {
419− if (changed.contains("demo-edges")) {
419+ if (changed.contains(QStringLiteral("demo-edges"))) {
420 updateDemoEdges();
420 updateDemoEdges();
421 }
421 }
422− } else if (interface == "com.canonical.unity.AccountsService.Private") {
422+ } else if (interface == QLatin1String("com.canonical.unity.AccountsService.Private")) {
423− if (changed.contains("FailedLogins")) {
423+ if (changed.contains(QStringLiteral("FailedLogins"))) {
424 updateFailedLogins();
424 updateFailedLogins();
425 }
425 }
426− } else if (interface == "com.ubuntu.touch.AccountsService.SecurityPrivacy") {
426+ } else if (interface == QLatin1String("com.ubuntu.touch.AccountsService.SecurityPrivacy")) {
427− if (changed.contains("StatsWelcomeScreen")) {
427+ if (changed.contains(QStringLiteral("StatsWelcomeScreen"))) {
428 updateStatsWelcomeScreen();
428 updateStatsWelcomeScreen();
429 }
429 }
430− } else if (interface == "com.ubuntu.AccountsService.SecurityPrivacy") {
430+ } else if (interface == QLatin1String("com.ubuntu.AccountsService.SecurityPrivacy")) {
431− if (changed.contains("PasswordDisplayHint")) {
431+ if (changed.contains(QStringLiteral("PasswordDisplayHint"))) {
432 updatePasswordDisplayHint();
432 updatePasswordDisplayHint();
433 }
433 }
434− if (changed.contains("EnableLauncherWhileLocked")) {
434+ if (changed.contains(QStringLiteral("EnableLauncherWhileLocked"))) {
435 updateEnableLauncherWhileLocked();
435 updateEnableLauncherWhileLocked();
436 }
436 }
437− if (changed.contains("EnableIndicatorsWhileLocked")) {
437+ if (changed.contains(QStringLiteral("EnableIndicatorsWhileLocked"))) {
438 updateEnableIndicatorsWhileLocked();
438 updateEnableIndicatorsWhileLocked();
439 }
439 }
440− } else if (interface == "com.ubuntu.location.providers.here.AccountsService") {
440+ } else if (interface == QLatin1String("com.ubuntu.location.providers.here.AccountsService")) {
441− if (changed.contains("LicenseAccepted")) {
441+ if (changed.contains(QStringLiteral("LicenseAccepted"))) {
442 updateHereEnabled();
442 updateHereEnabled();
443 }
443 }
444− if (changed.contains("LicenseBasePath")) {
444+ if (changed.contains(QStringLiteral("LicenseBasePath"))) {
445 updateHereLicensePath();
445 updateHereLicensePath();
446 }
446 }
447 }
447 }
plugins/AccountsService/AccountsServiceDBusAdaptor.cpp+17−17
@@ -30,10 +30,10 @@ AccountsServiceDBusAdaptor::AccountsServiceDBusAdaptor(QObject* parent)
30{
30{
31 QDBusConnection connection = QDBusConnection::SM_BUSNAME();
31 QDBusConnection connection = QDBusConnection::SM_BUSNAME();
32 QDBusConnectionInterface *interface = connection.interface();
32 QDBusConnectionInterface *interface = connection.interface();
33− interface->startService("org.freedesktop.Accounts");
33+ interface->startService(QStringLiteral("org.freedesktop.Accounts"));
34− m_accountsManager = new QDBusInterface("org.freedesktop.Accounts",
34+ m_accountsManager = new QDBusInterface(QStringLiteral("org.freedesktop.Accounts"),
35− "/org/freedesktop/Accounts",
35+ QStringLiteral("/org/freedesktop/Accounts"),
36− "org.freedesktop.Accounts",
36+ QStringLiteral("org.freedesktop.Accounts"),
37 connection, this);
37 connection, this);
38}
38}
39
39
@@ -41,7 +41,7 @@ QVariant AccountsServiceDBusAdaptor::getUserProperty(const QString &user, const
41{
41{
42 QDBusInterface *iface = getUserInterface(user);
42 QDBusInterface *iface = getUserInterface(user);
43 if (iface != nullptr && iface->isValid()) {
43 if (iface != nullptr && iface->isValid()) {
44− QDBusReply<QVariant> answer = iface->call("Get", interface, property);
44+ QDBusReply<QVariant> answer = iface->call(QStringLiteral("Get"), interface, property);
45 if (answer.isValid()) {
45 if (answer.isValid()) {
46 return answer;
46 return answer;
47 }
47 }
@@ -53,9 +53,9 @@ QDBusPendingReply<QVariant> AccountsServiceDBusAdaptor::getUserPropertyAsync(con
53{
53{
54 QDBusInterface *iface = getUserInterface(user);
54 QDBusInterface *iface = getUserInterface(user);
55 if (iface != nullptr && iface->isValid()) {
55 if (iface != nullptr && iface->isValid()) {
56− return iface->asyncCall("Get", interface, property);
56+ return iface->asyncCall(QStringLiteral("Get"), interface, property);
57 }
57 }
58− return QDBusPendingReply<QVariant>(QDBusMessage::createError(QDBusError::Other, "Invalid Interface"));
58+ return QDBusPendingReply<QVariant>(QDBusMessage::createError(QDBusError::Other, QStringLiteral("Invalid Interface")));
59}
59}
60
60
61void AccountsServiceDBusAdaptor::setUserProperty(const QString &user, const QString &interface, const QString &property, const QVariant &value)
61void AccountsServiceDBusAdaptor::setUserProperty(const QString &user, const QString &interface, const QString &property, const QVariant &value)
@@ -63,7 +63,7 @@ void AccountsServiceDBusAdaptor::setUserProperty(const QString &user, const QStr
63 QDBusInterface *iface = getUserInterface(user);
63 QDBusInterface *iface = getUserInterface(user);
64 if (iface != nullptr && iface->isValid()) {
64 if (iface != nullptr && iface->isValid()) {
65 // The value needs to be carefully wrapped
65 // The value needs to be carefully wrapped
66− iface->call("Set", interface, property, QVariant::fromValue(QDBusVariant(value)));
66+ iface->call(QStringLiteral("Set"), interface, property, QVariant::fromValue(QDBusVariant(value)));
67 }
67 }
68}
68}
69
69
@@ -72,9 +72,9 @@ QDBusPendingCall AccountsServiceDBusAdaptor::setUserPropertyAsync(const QString
72 QDBusInterface *iface = getUserInterface(user);
72 QDBusInterface *iface = getUserInterface(user);
73 if (iface != nullptr && iface->isValid()) {
73 if (iface != nullptr && iface->isValid()) {
74 // The value needs to be carefully wrapped
74 // The value needs to be carefully wrapped
75− return iface->asyncCall("Set", interface, property, QVariant::fromValue(QDBusVariant(value)));
75+ return iface->asyncCall(QStringLiteral("Set"), interface, property, QVariant::fromValue(QDBusVariant(value)));
76 }
76 }
77− return QDBusPendingCall::fromCompletedCall(QDBusMessage::createError(QDBusError::Other, "Invalid Interface"));
77+ return QDBusPendingCall::fromCompletedCall(QDBusMessage::createError(QDBusError::Other, QStringLiteral("Invalid Interface")));
78}
78}
79
79
80void AccountsServiceDBusAdaptor::propertiesChangedSlot(const QString &interface, const QVariantMap &changed, const QStringList &invalid)
80void AccountsServiceDBusAdaptor::propertiesChangedSlot(const QString &interface, const QVariantMap &changed, const QStringList &invalid)
@@ -116,13 +116,13 @@ QDBusInterface *AccountsServiceDBusAdaptor::getUserInterface(const QString &user
116{
116{
117 QDBusInterface *iface = m_users.value(user);
117 QDBusInterface *iface = m_users.value(user);
118 if (iface == nullptr && m_accountsManager->isValid()) {
118 if (iface == nullptr && m_accountsManager->isValid()) {
119− QDBusReply<QDBusObjectPath> answer = m_accountsManager->asyncCall("FindUserByName", user);
119+ QDBusReply<QDBusObjectPath> answer = m_accountsManager->asyncCall(QStringLiteral("FindUserByName"), user);
120 if (answer.isValid()) {
120 if (answer.isValid()) {
121 const QString path = answer.value().path();
121 const QString path = answer.value().path();
122
122
123− iface = new QDBusInterface("org.freedesktop.Accounts",
123+ iface = new QDBusInterface(QStringLiteral("org.freedesktop.Accounts"),
124 path,
124 path,
125− "org.freedesktop.DBus.Properties",
125+ QStringLiteral("org.freedesktop.DBus.Properties"),
126 m_accountsManager->connection(), this);
126 m_accountsManager->connection(), this);
127
127
128 // With its own pre-defined properties, AccountsService is oddly
128 // With its own pre-defined properties, AccountsService is oddly
@@ -132,8 +132,8 @@ QDBusInterface *AccountsServiceDBusAdaptor::getUserInterface(const QString &user
132 iface->connection().connect(
132 iface->connection().connect(
133 iface->service(),
133 iface->service(),
134 path,
134 path,
135− "org.freedesktop.Accounts.User",
135+ QStringLiteral("org.freedesktop.Accounts.User"),
136− "Changed",
136+ QStringLiteral("Changed"),
137 this,
137 this,
138 SLOT(maybeChangedSlot()));
138 SLOT(maybeChangedSlot()));
139
139
@@ -142,8 +142,8 @@ QDBusInterface *AccountsServiceDBusAdaptor::getUserInterface(const QString &user
142 iface->connection().connect(
142 iface->connection().connect(
143 iface->service(),
143 iface->service(),
144 path,
144 path,
145− "org.freedesktop.DBus.Properties",
145+ QStringLiteral("org.freedesktop.DBus.Properties"),
146− "PropertiesChanged",
146+ QStringLiteral("PropertiesChanged"),
147 this,
147 this,
148 SLOT(propertiesChangedSlot(QString, QVariantMap, QStringList)));
148 SLOT(propertiesChangedSlot(QString, QVariantMap, QStringList)));
149
149
plugins/Dash/horizontaljournal.cpp−2
@@ -33,8 +33,6 @@
33#include <private/qquickitem_p.h>
33#include <private/qquickitem_p.h>
34#pragma GCC diagnostic pop
34#pragma GCC diagnostic pop
35
35
36−static const qreal bufferRatio = 0.5;
37−
38HorizontalJournal::HorizontalJournal()
36HorizontalJournal::HorizontalJournal()
39 : m_firstVisibleIndex(-1)
37 : m_firstVisibleIndex(-1)
40 , m_rowHeight(0)
38 , m_rowHeight(0)
plugins/Dash/listviewwithpageheader.cpp+12−12
@@ -164,7 +164,7 @@ ListViewWithPageHeader::ListViewWithPageHeader()
164
164
165 m_contentYAnimation = new QQuickNumberAnimation(this);
165 m_contentYAnimation = new QQuickNumberAnimation(this);
166 m_contentYAnimation->setEasing(QEasingCurve::OutQuad);
166 m_contentYAnimation->setEasing(QEasingCurve::OutQuad);
167− m_contentYAnimation->setProperty("contentY");
167+ m_contentYAnimation->setProperty(QStringLiteral("contentY"));
168 m_contentYAnimation->setDuration(200);
168 m_contentYAnimation->setDuration(200);
169 m_contentYAnimation->setTargetObject(this);
169 m_contentYAnimation->setTargetObject(this);
170
170
@@ -745,8 +745,8 @@ QQuickItem *ListViewWithPageHeader::getSectionItem(const QString &sectionText)
745
745
746 QQmlContext *creationContext = m_sectionDelegate->creationContext();
746 QQmlContext *creationContext = m_sectionDelegate->creationContext();
747 QQmlContext *context = new QQmlContext(creationContext ? creationContext : qmlContext(this));
747 QQmlContext *context = new QQmlContext(creationContext ? creationContext : qmlContext(this));
748− context->setContextProperty(QLatin1String("section"), sectionText);
748+ context->setContextProperty(QStringLiteral("section"), sectionText);
749− context->setContextProperty(QLatin1String("delegateIndex"), -1);
749+ context->setContextProperty(QStringLiteral("delegateIndex"), -1);
750 QObject *nobj = m_sectionDelegate->beginCreate(context);
750 QObject *nobj = m_sectionDelegate->beginCreate(context);
751 if (nobj) {
751 if (nobj) {
752 QQml_setParent_noEvent(context, nobj);
752 QQml_setParent_noEvent(context, nobj);
@@ -879,7 +879,7 @@ ListViewWithPageHeader::ListItem *ListViewWithPageHeader::createItem(int modelIn
879 }
879 }
880 if (listItem->sectionItem()) {
880 if (listItem->sectionItem()) {
881 QQmlContext *context = QQmlEngine::contextForObject(listItem->sectionItem())->parentContext();
881 QQmlContext *context = QQmlEngine::contextForObject(listItem->sectionItem())->parentContext();
882− context->setContextProperty(QLatin1String("delegateIndex"), modelIndex);
882+ context->setContextProperty(QStringLiteral("delegateIndex"), modelIndex);
883 }
883 }
884 adjustMinYExtent();
884 adjustMinYExtent();
885 m_contentHeightDirty = true;
885 m_contentHeightDirty = true;
@@ -904,8 +904,8 @@ void ListViewWithPageHeader::itemCreated(int modelIndex, QObject *object)
904
904
905 item->setParentItem(m_clipItem);
905 item->setParentItem(m_clipItem);
906 QQmlContext *context = QQmlEngine::contextForObject(item)->parentContext();
906 QQmlContext *context = QQmlEngine::contextForObject(item)->parentContext();
907− context->setContextProperty(QLatin1String("ListViewWithPageHeader"), this);
907+ context->setContextProperty(QStringLiteral("ListViewWithPageHeader"), this);
908− context->setContextProperty(QLatin1String("heightToClip"), QVariant::fromValue<int>(0));
908+ context->setContextProperty(QStringLiteral("heightToClip"), QVariant::fromValue<int>(0));
909 if (modelIndex == m_asyncRequestedIndex) {
909 if (modelIndex == m_asyncRequestedIndex) {
910 createItem(modelIndex, false);
910 createItem(modelIndex, false);
911 refill();
911 refill();
@@ -1059,7 +1059,7 @@ void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool
1059 if (item && item->sectionItem()) {
1059 if (item && item->sectionItem()) {
1060 QQmlContext *context = QQmlEngine::contextForObject(item->sectionItem())->parentContext();
1060 QQmlContext *context = QQmlEngine::contextForObject(item->sectionItem())->parentContext();
1061 const QString sectionText = m_delegateModel->stringValue(i, m_sectionProperty);
1061 const QString sectionText = m_delegateModel->stringValue(i, m_sectionProperty);
1062− context->setContextProperty(QLatin1String("section"), sectionText);
1062+ context->setContextProperty(QStringLiteral("section"), sectionText);
1063 }
1063 }
1064 }
1064 }
1065 }
1065 }
@@ -1072,7 +1072,7 @@ void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool
1072 ListItem *item = m_visibleItems[i];
1072 ListItem *item = m_visibleItems[i];
1073 if (item->sectionItem()) {
1073 if (item->sectionItem()) {
1074 QQmlContext *context = QQmlEngine::contextForObject(item->sectionItem())->parentContext();
1074 QQmlContext *context = QQmlEngine::contextForObject(item->sectionItem())->parentContext();
1075− context->setContextProperty(QLatin1String("delegateIndex"), m_firstVisibleIndex + i);
1075+ context->setContextProperty(QStringLiteral("delegateIndex"), m_firstVisibleIndex + i);
1076 }
1076 }
1077 }
1077 }
1078
1078
@@ -1235,7 +1235,7 @@ void ListViewWithPageHeader::layout()
1235 // Update the top sticky section header
1235 // Update the top sticky section header
1236 const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
1236 const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
1237 QQmlContext *context = QQmlEngine::contextForObject(m_topSectionItem)->parentContext();
1237 QQmlContext *context = QQmlEngine::contextForObject(m_topSectionItem)->parentContext();
1238− context->setContextProperty(QLatin1String("section"), section);
1238+ context->setContextProperty(QStringLiteral("section"), section);
1239
1239
1240 QQuickItemPrivate::get(m_topSectionItem)->setCulled(false);
1240 QQuickItemPrivate::get(m_topSectionItem)->setCulled(false);
1241 m_topSectionItem->setY(topSectionStickPos);
1241 m_topSectionItem->setY(topSectionStickPos);
@@ -1247,7 +1247,7 @@ void ListViewWithPageHeader::layout()
1247 break;
1247 break;
1248 delegateIndex--;
1248 delegateIndex--;
1249 }
1249 }
1250− context->setContextProperty(QLatin1String("delegateIndex"), delegateIndex);
1250+ context->setContextProperty(QStringLiteral("delegateIndex"), delegateIndex);
1251 if (item->sectionItem()) {
1251 if (item->sectionItem()) {
1252 QQuickItemPrivate::get(item->sectionItem())->setCulled(true);
1252 QQuickItemPrivate::get(item->sectionItem())->setCulled(true);
1253 }
1253 }
@@ -1257,9 +1257,9 @@ void ListViewWithPageHeader::layout()
1257 QQmlContext *context = QQmlEngine::contextForObject(item->m_item)->parentContext();
1257 QQmlContext *context = QQmlEngine::contextForObject(item->m_item)->parentContext();
1258 const qreal clipFrom = visibleFrom + (!item->sectionItem() && m_topSectionItem && !QQuickItemPrivate::get(m_topSectionItem)->culled ? m_topSectionItem->height() : 0);
1258 const qreal clipFrom = visibleFrom + (!item->sectionItem() && m_topSectionItem && !QQuickItemPrivate::get(m_topSectionItem)->culled ? m_topSectionItem->height() : 0);
1259 if (!cull && pos < clipFrom) {
1259 if (!cull && pos < clipFrom) {
1260− context->setContextProperty(QLatin1String("heightToClip"), clipFrom - pos);
1260+ context->setContextProperty(QStringLiteral("heightToClip"), clipFrom - pos);
1261 } else {
1261 } else {
1262− context->setContextProperty(QLatin1String("heightToClip"), QVariant::fromValue<int>(0));
1262+ context->setContextProperty(QStringLiteral("heightToClip"), QVariant::fromValue<int>(0));
1263 }
1263 }
1264// qDebug() << "ListViewWithPageHeader::layout" << item->m_item;
1264// qDebug() << "ListViewWithPageHeader::layout" << item->m_item;
1265 pos += item->height();
1265 pos += item->height();
plugins/Dash/organicgrid.cpp−2
@@ -21,8 +21,6 @@
21#include <private/qquickitem_p.h>
21#include <private/qquickitem_p.h>
22#pragma GCC diagnostic pop
22#pragma GCC diagnostic pop
23
23
24−static const qreal bufferRatio = 0.5;
25−
26OrganicGrid::OrganicGrid()
24OrganicGrid::OrganicGrid()
27 : m_firstVisibleIndex(-1)
25 : m_firstVisibleIndex(-1)
28 , m_numberOfModulesPerRow(-1)
26 , m_numberOfModulesPerRow(-1)
plugins/Dash/verticaljournal.cpp−2
@@ -32,8 +32,6 @@
32#include <private/qquickitem_p.h>
32#include <private/qquickitem_p.h>
33#pragma GCC diagnostic pop
33#pragma GCC diagnostic pop
34
34
35−static const qreal bufferRatio = 0.5;
36−
37VerticalJournal::VerticalJournal()
35VerticalJournal::VerticalJournal()
38 : m_columnWidth(0)
36 : m_columnWidth(0)
39{
37{
plugins/Greeter/Unity/Launcher/launcheritem.cpp+2−2
@@ -35,7 +35,7 @@ LauncherItem::LauncherItem(const QString &appId, const QString &name, const QStr
35 m_quickList(new QuickListModel(this))
35 m_quickList(new QuickListModel(this))
36{
36{
37 QuickListEntry nameAction;
37 QuickListEntry nameAction;
38− nameAction.setActionId("launch_item");
38+ nameAction.setActionId(QStringLiteral("launch_item"));
39 nameAction.setText(m_name);
39 nameAction.setText(m_name);
40 m_quickList->appendAction(nameAction);
40 m_quickList->appendAction(nameAction);
41}
41}
@@ -55,7 +55,7 @@ void LauncherItem::setName(const QString &name)
55 if (m_name != name) {
55 if (m_name != name) {
56 m_name = name;
56 m_name = name;
57 QuickListEntry entry;
57 QuickListEntry entry;
58− entry.setActionId("launch_item");
58+ entry.setActionId(QStringLiteral("launch_item"));
59 entry.setText(m_name);
59 entry.setText(m_name);
60 m_quickList->updateAction(entry);
60 m_quickList->updateAction(entry);
61 Q_EMIT nameChanged(name);
61 Q_EMIT nameChanged(name);
plugins/Greeter/Unity/Launcher/launchermodelas.cpp+22−22
@@ -122,7 +122,7 @@ void LauncherModel::quickListActionInvoked(const QString &appId, int actionIndex
122 QString actionId = model->get(actionIndex).actionId();
122 QString actionId = model->get(actionIndex).actionId();
123
123
124 // Check if this is one of the launcher actions we handle ourselves
124 // Check if this is one of the launcher actions we handle ourselves
125− if (actionId == "launch_item") {
125+ if (actionId == QLatin1String("launch_item")) {
126 QDesktopServices::openUrl(getUrlForAppId(appId));
126 QDesktopServices::openUrl(getUrlForAppId(appId));
127
127
128 // Nope, we don't know this action, let the backend forward it to the application
128 // Nope, we don't know this action, let the backend forward it to the application
@@ -147,13 +147,13 @@ QString LauncherModel::getUrlForAppId(const QString &appId) const
147 return QString();
147 return QString();
148 }
148 }
149
149
150− if (!appId.contains("_")) {
150+ if (!appId.contains('_')) {
151 return "application:///" + appId + ".desktop";
151 return "application:///" + appId + ".desktop";
152 }
152 }
153
153
154 QStringList parts = appId.split('_');
154 QStringList parts = appId.split('_');
155 QString package = parts.value(0);
155 QString package = parts.value(0);
156− QString app = parts.value(1, "first-listed-app");
156+ QString app = parts.value(1, QStringLiteral("first-listed-app"));
157 return "appid://" + package + "/" + app + "/current-user-version";
157 return "appid://" + package + "/" + app + "/current-user-version";
158}
158}
159
159
@@ -200,7 +200,7 @@ void LauncherModel::refresh()
200 QList<QVariantMap> items;
200 QList<QVariantMap> items;
201
201
202 if (m_accounts && !m_user.isEmpty()) {
202 if (m_accounts && !m_user.isEmpty()) {
203− items = m_accounts->getUserProperty<VariantMapList>(m_user, "com.canonical.unity.AccountsService", "LauncherItems");
203+ items = m_accounts->getUserProperty<VariantMapList>(m_user, QStringLiteral("com.canonical.unity.AccountsService"), QStringLiteral("LauncherItems"));
204 }
204 }
205
205
206 // First walk through all the existing items and see if we need to remove something
206 // First walk through all the existing items and see if we need to remove something
@@ -210,16 +210,16 @@ void LauncherModel::refresh()
210 bool found = false;
210 bool found = false;
211 Q_FOREACH(const QVariant &asItem, items) {
211 Q_FOREACH(const QVariant &asItem, items) {
212 QVariantMap cachedMap = asItem.toMap();
212 QVariantMap cachedMap = asItem.toMap();
213− if (cachedMap.value("id").toString() == item->appId()) {
213+ if (cachedMap.value(QStringLiteral("id")).toString() == item->appId()) {
214 // Only keep and update it if we either show unpinned or it is pinned
214 // Only keep and update it if we either show unpinned or it is pinned
215− if (!m_onlyPinned || cachedMap.value("pinned").toBool()) {
215+ if (!m_onlyPinned || cachedMap.value(QStringLiteral("pinned")).toBool()) {
216 found = true;
216 found = true;
217− item->setName(cachedMap.value("name").toString());
217+ item->setName(cachedMap.value(QStringLiteral("name")).toString());
218− item->setIcon(cachedMap.value("icon").toString());
218+ item->setIcon(cachedMap.value(QStringLiteral("icon")).toString());
219− item->setCount(cachedMap.value("count").toInt());
219+ item->setCount(cachedMap.value(QStringLiteral("count")).toInt());
220− item->setCountVisible(cachedMap.value("countVisible").toBool());
220+ item->setCountVisible(cachedMap.value(QStringLiteral("countVisible")).toBool());
221− item->setProgress(cachedMap.value("progress").toInt());
221+ item->setProgress(cachedMap.value(QStringLiteral("progress")).toInt());
222− item->setRunning(cachedMap.value("running").toBool());
222+ item->setRunning(cachedMap.value(QStringLiteral("running")).toBool());
223
223
224 int idx = m_list.indexOf(item);
224 int idx = m_list.indexOf(item);
225 Q_EMIT dataChanged(index(idx), index(idx), {RoleName, RoleIcon, RoleCount, RoleCountVisible, RoleRunning, RoleProgress});
225 Q_EMIT dataChanged(index(idx), index(idx), {RoleName, RoleIcon, RoleCount, RoleCountVisible, RoleRunning, RoleProgress});
@@ -244,7 +244,7 @@ void LauncherModel::refresh()
244 for (int asIndex = 0; asIndex < items.count(); ++asIndex) {
244 for (int asIndex = 0; asIndex < items.count(); ++asIndex) {
245 QVariant entry = items.at(asIndex);
245 QVariant entry = items.at(asIndex);
246
246
247− if (m_onlyPinned && !entry.toMap().value("pinned").toBool()) {
247+ if (m_onlyPinned && !entry.toMap().value(QStringLiteral("pinned")).toBool()) {
248 // Skipping it as we only show pinned and it is not
248 // Skipping it as we only show pinned and it is not
249 skipped++;
249 skipped++;
250 continue;
250 continue;
@@ -253,7 +253,7 @@ void LauncherModel::refresh()
253
253
254 int itemIndex = -1;
254 int itemIndex = -1;
255 for (int i = 0; i < m_list.count(); ++i) {
255 for (int i = 0; i < m_list.count(); ++i) {
256− if (m_list.at(i)->appId() == entry.toMap().value("id").toString()) {
256+ if (m_list.at(i)->appId() == entry.toMap().value(QStringLiteral("id")).toString()) {
257 itemIndex = i;
257 itemIndex = i;
258 break;
258 break;
259 }
259 }
@@ -262,15 +262,15 @@ void LauncherModel::refresh()
262 if (itemIndex == -1) {
262 if (itemIndex == -1) {
263 QVariantMap cachedMap = entry.toMap();
263 QVariantMap cachedMap = entry.toMap();
264 // Need to add it. Just add it into the addedIndex to keep same ordering as the list in AS.
264 // Need to add it. Just add it into the addedIndex to keep same ordering as the list in AS.
265− LauncherItem *item = new LauncherItem(cachedMap.value("id").toString(),
265+ LauncherItem *item = new LauncherItem(cachedMap.value(QStringLiteral("id")).toString(),
266− cachedMap.value("name").toString(),
266+ cachedMap.value(QStringLiteral("name")).toString(),
267− cachedMap.value("icon").toString(),
267+ cachedMap.value(QStringLiteral("icon")).toString(),
268 this);
268 this);
269 item->setPinned(true);
269 item->setPinned(true);
270− item->setCount(cachedMap.value("count").toInt());
270+ item->setCount(cachedMap.value(QStringLiteral("count")).toInt());
271− item->setCountVisible(cachedMap.value("countVisible").toBool());
271+ item->setCountVisible(cachedMap.value(QStringLiteral("countVisible")).toBool());
272− item->setProgress(cachedMap.value("progress").toInt());
272+ item->setProgress(cachedMap.value(QStringLiteral("progress")).toInt());
273− item->setRunning(cachedMap.value("running").toBool());
273+ item->setRunning(cachedMap.value(QStringLiteral("running")).toBool());
274 beginInsertRows(QModelIndex(), newPosition, newPosition);
274 beginInsertRows(QModelIndex(), newPosition, newPosition);
275 m_list.insert(newPosition, item);
275 m_list.insert(newPosition, item);
276 endInsertRows();
276 endInsertRows();
@@ -286,7 +286,7 @@ void LauncherModel::refresh()
286
286
287void LauncherModel::propertiesChanged(const QString &user, const QString &interface, const QStringList &changed)
287void LauncherModel::propertiesChanged(const QString &user, const QString &interface, const QStringList &changed)
288{
288{
289− if (user != m_user || interface != "com.canonical.unity.AccountsService" || !changed.contains("LauncherItems")) {
289+ if (user != m_user || interface != QLatin1String("com.canonical.unity.AccountsService") || !changed.contains(QStringLiteral("LauncherItems"))) {
290 return;
290 return;
291 }
291 }
292 refresh();
292 refresh();
plugins/Greeter/Unity/Launcher/plugin.cpp+5−5
@@ -36,11 +36,11 @@ void UnityLauncherPlugin::registerTypes(const char *uri)
36{
36{
37 Q_ASSERT(uri == QLatin1String("Unity.Launcher"));
37 Q_ASSERT(uri == QLatin1String("Unity.Launcher"));
38
38
39− qmlRegisterUncreatableType<LauncherModelInterface>(uri, 0, 1, "LauncherModelInterface", "Abstract Interface. Cannot be instantiated.");
39+ qmlRegisterUncreatableType<LauncherModelInterface>(uri, 0, 1, "LauncherModelInterface", QStringLiteral("Abstract Interface. Cannot be instantiated."));
40− qmlRegisterUncreatableType<LauncherItemInterface>(uri, 0, 1, "LauncherItemInterface", "Abstract Interface. Cannot be instantiated.");
40+ qmlRegisterUncreatableType<LauncherItemInterface>(uri, 0, 1, "LauncherItemInterface", QStringLiteral("Abstract Interface. Cannot be instantiated."));
41− qmlRegisterUncreatableType<QuickListModelInterface>(uri, 0, 1, "QuickListInterface", "Abstract Interface. Cannot be instantiated.");
41+ qmlRegisterUncreatableType<QuickListModelInterface>(uri, 0, 1, "QuickListInterface", QStringLiteral("Abstract Interface. Cannot be instantiated."));
42
42
43 qmlRegisterSingletonType<LauncherModel>(uri, 0, 1, "LauncherModel", modelProvider);
43 qmlRegisterSingletonType<LauncherModel>(uri, 0, 1, "LauncherModel", modelProvider);
44− qmlRegisterUncreatableType<LauncherItem>(uri, 0, 1, "LauncherItem", "Can't create new Launcher Items in QML. Get them from the LauncherModel.");
44+ qmlRegisterUncreatableType<LauncherItem>(uri, 0, 1, "LauncherItem", QStringLiteral("Can't create new Launcher Items in QML. Get them from the LauncherModel."));
45− qmlRegisterUncreatableType<QuickListModel>(uri, 0, 1, "QuickListModel", "Can't create a QuickListModel in QML. Get them from the LauncherItems.");
45+ qmlRegisterUncreatableType<QuickListModel>(uri, 0, 1, "QuickListModel", QStringLiteral("Can't create a QuickListModel in QML. Get them from the LauncherItems."));
46}
46}
plugins/IntegratedLightDM/DBusGreeter.cpp+2−2
@@ -21,7 +21,7 @@
21#include <QStringList>
21#include <QStringList>
22
22
23DBusGreeter::DBusGreeter(Greeter *greeter, const QString &path)
23DBusGreeter::DBusGreeter(Greeter *greeter, const QString &path)
24− : UnityDBusObject(path, "com.canonical.UnityGreeter", true, greeter),
24+ : UnityDBusObject(path, QStringLiteral("com.canonical.UnityGreeter"), true, greeter),
25 m_greeter(greeter)
25 m_greeter(greeter)
26{
26{
27 connect(m_greeter, &Greeter::isActiveChanged, this, &DBusGreeter::isActiveChangedHandler);
27 connect(m_greeter, &Greeter::isActiveChanged, this, &DBusGreeter::isActiveChangedHandler);
@@ -44,6 +44,6 @@ void DBusGreeter::HideGreeter()
44
44
45void DBusGreeter::isActiveChangedHandler()
45void DBusGreeter::isActiveChangedHandler()
46{
46{
47− notifyPropertyChanged("IsActive", isActive());
47+ notifyPropertyChanged(QStringLiteral("IsActive"), isActive());
48 Q_EMIT isActiveChanged();
48 Q_EMIT isActiveChanged();
49}
49}
plugins/IntegratedLightDM/DBusGreeterList.cpp+3−3
@@ -21,7 +21,7 @@
21#include <QStringList>
21#include <QStringList>
22
22
23DBusGreeterList::DBusGreeterList(Greeter *greeter, const QString &path)
23DBusGreeterList::DBusGreeterList(Greeter *greeter, const QString &path)
24− : UnityDBusObject(path, "com.canonical.UnityGreeter", true, greeter),
24+ : UnityDBusObject(path, QStringLiteral("com.canonical.UnityGreeter"), true, greeter),
25 m_greeter(greeter)
25 m_greeter(greeter)
26{
26{
27 connect(m_greeter, &Greeter::authenticationUserChanged, this, &DBusGreeterList::authenticationUserChangedHandler);
27 connect(m_greeter, &Greeter::authenticationUserChanged, this, &DBusGreeterList::authenticationUserChangedHandler);
@@ -45,12 +45,12 @@ bool DBusGreeterList::entryIsLocked() const
45
45
46void DBusGreeterList::authenticationUserChangedHandler(const QString &user)
46void DBusGreeterList::authenticationUserChangedHandler(const QString &user)
47{
47{
48− notifyPropertyChanged("ActiveEntry", user);
48+ notifyPropertyChanged(QStringLiteral("ActiveEntry"), user);
49 Q_EMIT EntrySelected(user);
49 Q_EMIT EntrySelected(user);
50}
50}
51
51
52void DBusGreeterList::promptlessChangedHandler()
52void DBusGreeterList::promptlessChangedHandler()
53{
53{
54− notifyPropertyChanged("EntryIsLocked", entryIsLocked());
54+ notifyPropertyChanged(QStringLiteral("EntryIsLocked"), entryIsLocked());
55 Q_EMIT entryIsLockedChanged();
55 Q_EMIT entryIsLockedChanged();
56}
56}
plugins/IntegratedLightDM/Greeter.cpp+1−1
@@ -113,7 +113,7 @@ void Greeter::showPromptFilter(const QString &text, QLightDM::Greeter::PromptTyp
113
113
114 // Strip prompt of any colons at the end
114 // Strip prompt of any colons at the end
115 QString trimmedText = text.trimmed();
115 QString trimmedText = text.trimmed();
116− if (trimmedText.endsWith(":") || trimmedText.endsWith(":")) {
116+ if (trimmedText.endsWith(':') || trimmedText.endsWith(QStringLiteral(":"))) {
117 trimmedText.chop(1);
117 trimmedText.chop(1);
118 }
118 }
119
119
plugins/IntegratedLightDM/liblightdm/Greeter.cpp+5−5
@@ -55,12 +55,12 @@ bool Greeter::hasGuestAccountHint() const
55QString Greeter::getHint(const QString &name) const
55QString Greeter::getHint(const QString &name) const
56{
56{
57 Q_UNUSED(name)
57 Q_UNUSED(name)
58− return "";
58+ return QLatin1String("");
59}
59}
60
60
61QString Greeter::defaultSessionHint() const
61QString Greeter::defaultSessionHint() const
62{
62{
63− return "ubuntu";
63+ return QStringLiteral("ubuntu");
64}
64}
65
65
66bool Greeter::hideUsersHint() const
66bool Greeter::hideUsersHint() const
@@ -85,7 +85,7 @@ bool Greeter::lockHint () const
85
85
86QString Greeter::selectUserHint() const
86QString Greeter::selectUserHint() const
87{
87{
88− return "";
88+ return QLatin1String("");
89}
89}
90
90
91bool Greeter::selectGuestHint() const
91bool Greeter::selectGuestHint() const
@@ -95,7 +95,7 @@ bool Greeter::selectGuestHint() const
95
95
96QString Greeter::autologinUserHint() const
96QString Greeter::autologinUserHint() const
97{
97{
98− return "";
98+ return QLatin1String("");
99}
99}
100
100
101bool Greeter::autologinGuestHint() const
101bool Greeter::autologinGuestHint() const
@@ -115,7 +115,7 @@ bool Greeter::inAuthentication() const
115
115
116QString Greeter::hostname() const
116QString Greeter::hostname() const
117{
117{
118− return "hostname1";
118+ return QStringLiteral("hostname1");
119}
119}
120
120
121bool Greeter::isAuthenticated() const
121bool Greeter::isAuthenticated() const
plugins/IntegratedLightDM/liblightdm/GreeterPrivate.cpp+1−1
@@ -91,7 +91,7 @@ public:
91 } else {
91 } else {
92 delete appData;
92 delete appData;
93 greeterPrivate->authenticated = false;
93 greeterPrivate->authenticated = false;
94− Q_EMIT greeter->showMessage("Internal error: could not start PAM authentication", QLightDM::Greeter::MessageTypeError);
94+ Q_EMIT greeter->showMessage(QStringLiteral("Internal error: could not start PAM authentication"), QLightDM::Greeter::MessageTypeError);
95 Q_EMIT greeter->authenticationComplete();
95 Q_EMIT greeter->authenticationComplete();
96 }
96 }
97 }
97 }
plugins/IntegratedLightDM/liblightdm/UsersModel.cpp+1−1
@@ -55,7 +55,7 @@ UsersModel::UsersModel(QObject *parent) :
55 setRoleNames(roles);
55 setRoleNames(roles);
56
56
57 // Now modify our mock user backgrounds
57 // Now modify our mock user backgrounds
58− QDir bgdir = QDir("/usr/share/demo-assets/shell/backgrounds/");
58+ QDir bgdir = QDir(QStringLiteral("/usr/share/demo-assets/shell/backgrounds/"));
59 QStringList backgrounds = bgdir.entryList(QDir::Files | QDir::NoDotAndDotDot);
59 QStringList backgrounds = bgdir.entryList(QDir::Files | QDir::NoDotAndDotDot);
60
60
61 for (int i = 0, j = 0; i < d->entries.size(); i++) {
61 for (int i = 0, j = 0; i < d->entries.size(); i++) {
plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp+2−1
@@ -29,8 +29,9 @@ UsersModelPrivate::UsersModelPrivate(UsersModel* parent)
29 : q_ptr(parent)
29 : q_ptr(parent)
30{
30{
31 QSettings settings(QDir::homePath() + "/.unity8-greeter-demo", QSettings::NativeFormat);
31 QSettings settings(QDir::homePath() + "/.unity8-greeter-demo", QSettings::NativeFormat);
32− QStringList users = settings.value("users", QStringList() << qgetenv("USER")).toStringList();
32+ QStringList users = settings.value(QStringLiteral("users"), QStringList() << qgetenv("USER")).toStringList();
33
33
34+ entries.reserve(users.count());
34 Q_FOREACH(const QString &user, users)
35 Q_FOREACH(const QString &user, users)
35 {
36 {
36 QString name = settings.value(user + "/name", user[0].toUpper() + user.mid(1)).toString();
37 QString name = settings.value(user + "/name", user[0].toUpper() + user.mid(1)).toString();
plugins/IntegratedLightDM/plugin.cpp+3−3
@@ -34,8 +34,8 @@ static QObject *greeter_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
34 Q_UNUSED(scriptEngine)
34 Q_UNUSED(scriptEngine)
35
35
36 Greeter *greeter = new Greeter();
36 Greeter *greeter = new Greeter();
37− new DBusGreeter(greeter, "/");
37+ new DBusGreeter(greeter, QStringLiteral("/"));
38− new DBusGreeterList(greeter, "/list");
38+ new DBusGreeterList(greeter, QStringLiteral("/list"));
39
39
40 return greeter;
40 return greeter;
41}
41}
@@ -64,6 +64,6 @@ void IntegratedLightDMPlugin::registerTypes(const char *uri)
64 qRegisterMetaType<QLightDM::Greeter::PromptType>("QLightDM::Greeter::PromptType");
64 qRegisterMetaType<QLightDM::Greeter::PromptType>("QLightDM::Greeter::PromptType");
65 qmlRegisterSingletonType<Greeter>(uri, 0, 1, "Greeter", greeter_provider);
65 qmlRegisterSingletonType<Greeter>(uri, 0, 1, "Greeter", greeter_provider);
66 qmlRegisterSingletonType<UsersModel>(uri, 0, 1, "Users", users_provider);
66 qmlRegisterSingletonType<UsersModel>(uri, 0, 1, "Users", users_provider);
67− qmlRegisterUncreatableType<QLightDM::UsersModel>(uri, 0, 1, "UserRoles", "Type is not instantiable");
67+ qmlRegisterUncreatableType<QLightDM::UsersModel>(uri, 0, 1, "UserRoles", QStringLiteral("Type is not instantiable"));
68 qmlRegisterSingletonType<UserMetricsOutput::UserMetrics>(uri, 0, 1, "Infographic", infographic_provider);
68 qmlRegisterSingletonType<UserMetricsOutput::UserMetrics>(uri, 0, 1, "Infographic", infographic_provider);
69}
69}
plugins/Powerd/Powerd.cpp+11−11
@@ -22,19 +22,19 @@
22void autoBrightnessChanged(GSettings *settings, const gchar *key, QDBusInterface *unityScreen)
22void autoBrightnessChanged(GSettings *settings, const gchar *key, QDBusInterface *unityScreen)
23{
23{
24 bool value = g_settings_get_boolean(settings, key);
24 bool value = g_settings_get_boolean(settings, key);
25− unityScreen->asyncCall("userAutobrightnessEnable", QVariant(value));
25+ unityScreen->asyncCall(QStringLiteral("userAutobrightnessEnable"), QVariant(value));
26}
26}
27
27
28void activityTimeoutChanged(GSettings *settings, const gchar *key, QDBusInterface *unityScreen)
28void activityTimeoutChanged(GSettings *settings, const gchar *key, QDBusInterface *unityScreen)
29{
29{
30 int value = g_settings_get_uint(settings, key);
30 int value = g_settings_get_uint(settings, key);
31− unityScreen->asyncCall("setInactivityTimeouts", QVariant(value), QVariant(-1));
31+ unityScreen->asyncCall(QStringLiteral("setInactivityTimeouts"), QVariant(value), QVariant(-1));
32}
32}
33
33
34void dimTimeoutChanged(GSettings *settings, const gchar *key, QDBusInterface *unityScreen)
34void dimTimeoutChanged(GSettings *settings, const gchar *key, QDBusInterface *unityScreen)
35{
35{
36 int value = g_settings_get_uint(settings, key);
36 int value = g_settings_get_uint(settings, key);
37− unityScreen->asyncCall("setInactivityTimeouts", QVariant(-1), QVariant(value));
37+ unityScreen->asyncCall(QStringLiteral("setInactivityTimeouts"), QVariant(-1), QVariant(value));
38}
38}
39
39
40Powerd::Powerd(QObject* parent)
40Powerd::Powerd(QObject* parent)
@@ -42,15 +42,15 @@ Powerd::Powerd(QObject* parent)
42 unityScreen(nullptr),
42 unityScreen(nullptr),
43 cachedStatus(Status::On)
43 cachedStatus(Status::On)
44{
44{
45− unityScreen = new QDBusInterface("com.canonical.Unity.Screen",
45+ unityScreen = new QDBusInterface(QStringLiteral("com.canonical.Unity.Screen"),
46− "/com/canonical/Unity/Screen",
46+ QStringLiteral("/com/canonical/Unity/Screen"),
47− "com.canonical.Unity.Screen",
47+ QStringLiteral("com.canonical.Unity.Screen"),
48 QDBusConnection::SM_BUSNAME(), this);
48 QDBusConnection::SM_BUSNAME(), this);
49
49
50− unityScreen->connection().connect("com.canonical.Unity.Screen",
50+ unityScreen->connection().connect(QStringLiteral("com.canonical.Unity.Screen"),
51− "/com/canonical/Unity/Screen",
51+ QStringLiteral("/com/canonical/Unity/Screen"),
52− "com.canonical.Unity.Screen",
52+ QStringLiteral("com.canonical.Unity.Screen"),
53− "DisplayPowerStateChange",
53+ QStringLiteral("DisplayPowerStateChange"),
54 this,
54 this,
55 SLOT(handleDisplayPowerStateChange(int, int)));
55 SLOT(handleDisplayPowerStateChange(int, int)));
56
56
@@ -76,7 +76,7 @@ Powerd::Status Powerd::status() const
76
76
77void Powerd::setStatus(Powerd::Status status, DisplayStateChangeReason reason)
77void Powerd::setStatus(Powerd::Status status, DisplayStateChangeReason reason)
78{
78{
79− unityScreen->asyncCall("setScreenPowerMode",
79+ unityScreen->asyncCall(QStringLiteral("setScreenPowerMode"),
80 status == Powerd::On ? "on" : "off",
80 status == Powerd::On ? "on" : "off",
81 static_cast<qint32>(reason));
81 static_cast<qint32>(reason));
82}
82}
plugins/ScreenGrabber/screengrabber.cpp+4−4
@@ -50,8 +50,8 @@ ScreenGrabber::ScreenGrabber(QObject *parent)
50 qDebug() << "Using real environment";
50 qDebug() << "Using real environment";
51 screenshotsDir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
51 screenshotsDir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
52 }
52 }
53− screenshotsDir.mkpath("Screenshots");
53+ screenshotsDir.mkpath(QStringLiteral("Screenshots"));
54− screenshotsDir.cd("Screenshots");
54+ screenshotsDir.cd(QStringLiteral("Screenshots"));
55 if (screenshotsDir.exists()) {
55 if (screenshotsDir.exists()) {
56 fileNamePrefix = screenshotsDir.absolutePath();
56 fileNamePrefix = screenshotsDir.absolutePath();
57 fileNamePrefix.append("/screenshot");
57 fileNamePrefix.append("/screenshot");
@@ -94,7 +94,7 @@ void ScreenGrabber::captureAndSave()
94QString ScreenGrabber::makeFileName() const
94QString ScreenGrabber::makeFileName() const
95{
95{
96 QString fileName(fileNamePrefix);
96 QString fileName(fileNamePrefix);
97− fileName.append(QDateTime::currentDateTime().toString("yyyyMMdd_hhmmsszzz"));
97+ fileName.append(QDateTime::currentDateTime().toString(QStringLiteral("yyyyMMdd_hhmmsszzz")));
98 fileName.append(".");
98 fileName.append(".");
99 fileName.append(getFormat());
99 fileName.append(getFormat());
100 return fileName;
100 return fileName;
@@ -103,5 +103,5 @@ QString ScreenGrabber::makeFileName() const
103QString ScreenGrabber::getFormat() const
103QString ScreenGrabber::getFormat() const
104{
104{
105 //TODO: This should be configurable (perhaps through gsettings?)
105 //TODO: This should be configurable (perhaps through gsettings?)
106− return "png";
106+ return QStringLiteral("png");
107}
107}
plugins/SessionBroadcast/SessionBroadcast.cpp+4−4
@@ -24,10 +24,10 @@ SessionBroadcast::SessionBroadcast(QObject* parent)
24{
24{
25 auto connection = QDBusConnection::SM_BUSNAME();
25 auto connection = QDBusConnection::SM_BUSNAME();
26
26
27− connection.connect("com.canonical.Unity.Greeter.Broadcast",
27+ connection.connect(QStringLiteral("com.canonical.Unity.Greeter.Broadcast"),
28− "/com/canonical/Unity/Greeter/Broadcast",
28+ QStringLiteral("/com/canonical/Unity/Greeter/Broadcast"),
29− "com.canonical.Unity.Greeter.Broadcast",
29+ QStringLiteral("com.canonical.Unity.Greeter.Broadcast"),
30− "ShowHome",
30+ QStringLiteral("ShowHome"),
31 this,
31 this,
32 SLOT(onShowHome(const QString &)));
32 SLOT(onShowHome(const QString &)));
33}
33}
plugins/Ubuntu/DownloadDaemonListener/interface/downloadtrackeradaptor.h+11−11
@@ -41,68 +41,68 @@ public Q_SLOTS: // METHODS
41 {
41 {
42 QList<QVariant> argumentList;
42 QList<QVariant> argumentList;
43 argumentList << QVariant::fromValue(allowed);
43 argumentList << QVariant::fromValue(allowed);
44− return asyncCallWithArgumentList(QLatin1String("allowGSMDownload"), argumentList);
44+ return asyncCallWithArgumentList(QStringLiteral("allowGSMDownload"), argumentList);
45 }
45 }
46
46
47 inline QDBusPendingReply<> cancel()
47 inline QDBusPendingReply<> cancel()
48 {
48 {
49 QList<QVariant> argumentList;
49 QList<QVariant> argumentList;
50− return asyncCallWithArgumentList(QLatin1String("cancel"), argumentList);
50+ return asyncCallWithArgumentList(QStringLiteral("cancel"), argumentList);
51 }
51 }
52
52
53 inline QDBusPendingReply<bool> isGSMDownloadAllowed()
53 inline QDBusPendingReply<bool> isGSMDownloadAllowed()
54 {
54 {
55 QList<QVariant> argumentList;
55 QList<QVariant> argumentList;
56− return asyncCallWithArgumentList(QLatin1String("isGSMDownloadAllowed"), argumentList);
56+ return asyncCallWithArgumentList(QStringLiteral("isGSMDownloadAllowed"), argumentList);
57 }
57 }
58
58
59 inline QDBusPendingReply<QVariantMap> metadata()
59 inline QDBusPendingReply<QVariantMap> metadata()
60 {
60 {
61 QList<QVariant> argumentList;
61 QList<QVariant> argumentList;
62− return asyncCallWithArgumentList(QLatin1String("metadata"), argumentList);
62+ return asyncCallWithArgumentList(QStringLiteral("metadata"), argumentList);
63 }
63 }
64
64
65 inline QDBusPendingReply<> pause()
65 inline QDBusPendingReply<> pause()
66 {
66 {
67 QList<QVariant> argumentList;
67 QList<QVariant> argumentList;
68− return asyncCallWithArgumentList(QLatin1String("pause"), argumentList);
68+ return asyncCallWithArgumentList(QStringLiteral("pause"), argumentList);
69 }
69 }
70
70
71 inline QDBusPendingReply<qulonglong> progress()
71 inline QDBusPendingReply<qulonglong> progress()
72 {
72 {
73 QList<QVariant> argumentList;
73 QList<QVariant> argumentList;
74− return asyncCallWithArgumentList(QLatin1String("progress"), argumentList);
74+ return asyncCallWithArgumentList(QStringLiteral("progress"), argumentList);
75 }
75 }
76
76
77 inline QDBusPendingReply<> resume()
77 inline QDBusPendingReply<> resume()
78 {
78 {
79 QList<QVariant> argumentList;
79 QList<QVariant> argumentList;
80− return asyncCallWithArgumentList(QLatin1String("resume"), argumentList);
80+ return asyncCallWithArgumentList(QStringLiteral("resume"), argumentList);
81 }
81 }
82
82
83 inline QDBusPendingReply<> setThrottle(qulonglong speed)
83 inline QDBusPendingReply<> setThrottle(qulonglong speed)
84 {
84 {
85 QList<QVariant> argumentList;
85 QList<QVariant> argumentList;
86 argumentList << QVariant::fromValue(speed);
86 argumentList << QVariant::fromValue(speed);
87− return asyncCallWithArgumentList(QLatin1String("setThrottle"), argumentList);
87+ return asyncCallWithArgumentList(QStringLiteral("setThrottle"), argumentList);
88 }
88 }
89
89
90 inline QDBusPendingReply<> start()
90 inline QDBusPendingReply<> start()
91 {
91 {
92 QList<QVariant> argumentList;
92 QList<QVariant> argumentList;
93− return asyncCallWithArgumentList(QLatin1String("start"), argumentList);
93+ return asyncCallWithArgumentList(QStringLiteral("start"), argumentList);
94 }
94 }
95
95
96 inline QDBusPendingReply<qulonglong> throttle()
96 inline QDBusPendingReply<qulonglong> throttle()
97 {
97 {
98 QList<QVariant> argumentList;
98 QList<QVariant> argumentList;
99− return asyncCallWithArgumentList(QLatin1String("throttle"), argumentList);
99+ return asyncCallWithArgumentList(QStringLiteral("throttle"), argumentList);
100 }
100 }
101
101
102 inline QDBusPendingReply<qulonglong> totalSize()
102 inline QDBusPendingReply<qulonglong> totalSize()
103 {
103 {
104 QList<QVariant> argumentList;
104 QList<QVariant> argumentList;
105− return asyncCallWithArgumentList(QLatin1String("totalSize"), argumentList);
105+ return asyncCallWithArgumentList(QStringLiteral("totalSize"), argumentList);
106 }
106 }
107
107
108Q_SIGNALS: // SIGNALS
108Q_SIGNALS: // SIGNALS
plugins/Ubuntu/SystemImage/SystemImage.cpp+4−4
@@ -25,9 +25,9 @@ SystemImage::SystemImage(QObject *parent)
25
25
26void SystemImage::factoryReset()
26void SystemImage::factoryReset()
27{
27{
28− const QDBusMessage msg = QDBusMessage::createMethodCall("com.canonical.SystemImage",
28+ const QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("com.canonical.SystemImage"),
29− "/Service",
29+ QStringLiteral("/Service"),
30− "com.canonical.SystemImage",
30+ QStringLiteral("com.canonical.SystemImage"),
31− "FactoryReset");
31+ QStringLiteral("FactoryReset"));
32 QDBusConnection::systemBus().asyncCall(msg);
32 QDBusConnection::systemBus().asyncCall(msg);
33}
33}
plugins/Unity/Connectivity/Connectivity.cpp+4−4
@@ -25,9 +25,9 @@ Connectivity::Connectivity(QObject *parent)
25
25
26void Connectivity::unlockAllModems()
26void Connectivity::unlockAllModems()
27{
27{
28− const QDBusMessage msg = QDBusMessage::createMethodCall("com.ubuntu.connectivity1",
28+ const QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("com.ubuntu.connectivity1"),
29− "/com/ubuntu/connectivity1/Private",
29+ QStringLiteral("/com/ubuntu/connectivity1/Private"),
30− "com.ubuntu.connectivity1.Private",
30+ QStringLiteral("com.ubuntu.connectivity1.Private"),
31− "UnlockAllModems");
31+ QStringLiteral("UnlockAllModems"));
32 QDBusConnection::sessionBus().asyncCall(msg);
32 QDBusConnection::sessionBus().asyncCall(msg);
33}
33}
plugins/Unity/DashCommunicator/dashcommunicator.cpp+3−3
@@ -41,9 +41,9 @@ void DashCommunicator::setCurrentScope(int index, bool animate, bool isSwipe)
41
41
42void DashCommunicator::run()
42void DashCommunicator::run()
43{
43{
44− m_dashConnection = new DashConnection("com.canonical.UnityDash",
44+ m_dashConnection = new DashConnection(QStringLiteral("com.canonical.UnityDash"),
45− "/com/canonical/UnityDash",
45+ QStringLiteral("/com/canonical/UnityDash"),
46− "", this);
46+ QLatin1String(""), this);
47 m_mutex.lock();
47 m_mutex.lock();
48 m_created = true;
48 m_created = true;
49 m_mutex.unlock();
49 m_mutex.unlock();
plugins/Unity/DashCommunicator/dashconnection.cpp+1−1
@@ -58,6 +58,6 @@ QDBusAbstractInterface* DashConnection::createInterface(const QString &service,
58void DashConnection::setCurrentScope(int index, bool animate, bool isSwipe)
58void DashConnection::setCurrentScope(int index, bool animate, bool isSwipe)
59{
59{
60 if (dbusInterface()) {
60 if (dbusInterface()) {
61− dbusInterface()->asyncCall("SetCurrentScope", index, animate, isSwipe);
61+ dbusInterface()->asyncCall(QStringLiteral("SetCurrentScope"), index, animate, isSwipe);
62 }
62 }
63}
63}
plugins/Unity/DashCommunicator/dbusdashcommunicatorservice.cpp+1−1
@@ -21,7 +21,7 @@
21#include <QDebug>
21#include <QDebug>
22
22
23DBusDashCommunicatorService::DBusDashCommunicatorService(QObject *parent):
23DBusDashCommunicatorService::DBusDashCommunicatorService(QObject *parent):
24− UnityDBusObject("/com/canonical/UnityDash", "com.canonical.UnityDash", false, parent)
24+ UnityDBusObject(QStringLiteral("/com/canonical/UnityDash"), QStringLiteral("com.canonical.UnityDash"), false, parent)
25{
25{
26}
26}
27
27
plugins/Unity/Indicators/indicator.cpp+8−8
@@ -37,20 +37,20 @@ void Indicator::init(const QString& busName, const QSettings& settings)
37 // that we can't just copy the object.
37 // that we can't just copy the object.
38 m_settings.clear();
38 m_settings.clear();
39 Q_FOREACH(const QString& key, settings.allKeys()) {
39 Q_FOREACH(const QString& key, settings.allKeys()) {
40− if (key.endsWith("/Position") || key.endsWith("/ObjectPath")) {
40+ if (key.endsWith(QLatin1String("/Position")) || key.endsWith(QLatin1String("/ObjectPath"))) {
41 m_settings.insert(key, settings.value(key));
41 m_settings.insert(key, settings.value(key));
42 }
42 }
43 }
43 }
44
44
45− setId(settings.value("Indicator Service/Name").toString());
45+ setId(settings.value(QStringLiteral("Indicator Service/Name")).toString());
46
46
47− QString actionObjectPath = settings.value("Indicator Service/ObjectPath").toString();
47+ QString actionObjectPath = settings.value(QStringLiteral("Indicator Service/ObjectPath")).toString();
48
48
49 QVariantMap properties;
49 QVariantMap properties;
50 properties.clear();
50 properties.clear();
51− properties.insert("busType", 1);
51+ properties.insert(QStringLiteral("busType"), 1);
52− properties.insert("busName", busName);
52+ properties.insert(QStringLiteral("busName"), busName);
53− properties.insert("actionsObjectPath", actionObjectPath);
53+ properties.insert(QStringLiteral("actionsObjectPath"), actionObjectPath);
54 setIndicatorProperties(properties);
54 setIndicatorProperties(properties);
55}
55}
56
56
@@ -84,12 +84,12 @@ void Indicator::setProfile(const QString& profile)
84{
84{
85 QVariant pos = m_settings.value(profile + "/Position");
85 QVariant pos = m_settings.value(profile + "/Position");
86 if (!pos.isValid())
86 if (!pos.isValid())
87− pos = m_settings.value("Indicator Service/Position", QVariant::fromValue(0));
87+ pos = m_settings.value(QStringLiteral("Indicator Service/Position"), QVariant::fromValue(0));
88 setPosition(pos.toInt());
88 setPosition(pos.toInt());
89
89
90 QString menuObjectPath = m_settings.value(profile + "/ObjectPath").toString();
90 QString menuObjectPath = m_settings.value(profile + "/ObjectPath").toString();
91 QVariantMap map = m_properties.toMap();
91 QVariantMap map = m_properties.toMap();
92− map.insert("menuObjectPath", menuObjectPath);
92+ map.insert(QStringLiteral("menuObjectPath"), menuObjectPath);
93 setIndicatorProperties(map);
93 setIndicatorProperties(map);
94}
94}
95
95
plugins/Unity/Indicators/indicatorsmanager.cpp+4−4
@@ -44,7 +44,7 @@ public:
44IndicatorsManager::IndicatorsManager(QObject* parent)
44IndicatorsManager::IndicatorsManager(QObject* parent)
45 : QObject(parent)
45 : QObject(parent)
46 , m_loaded(false)
46 , m_loaded(false)
47− , m_profile("phone")
47+ , m_profile(QStringLiteral("phone"))
48{
48{
49}
49}
50
50
@@ -115,7 +115,7 @@ void IndicatorsManager::loadDir(const QDir& dir)
115void IndicatorsManager::loadFile(const QFileInfo& file_info)
115void IndicatorsManager::loadFile(const QFileInfo& file_info)
116{
116{
117 QSettings indicator_settings(file_info.absoluteFilePath(), QSettings::IniFormat, this);
117 QSettings indicator_settings(file_info.absoluteFilePath(), QSettings::IniFormat, this);
118− QString name = indicator_settings.value("Indicator Service/Name").toString();
118+ QString name = indicator_settings.value(QStringLiteral("Indicator Service/Name")).toString();
119
119
120 auto iter = m_indicatorsData.find(name);
120 auto iter = m_indicatorsData.find(name);
121 if (iter != m_indicatorsData.end())
121 if (iter != m_indicatorsData.end())
@@ -286,9 +286,9 @@ Indicator::Ptr IndicatorsManager::indicator(const QString& indicator_name)
286 return new_indicator;
286 return new_indicator;
287}
287}
288
288
289−QList<Indicator::Ptr> IndicatorsManager::indicators()
289+QVector<Indicator::Ptr> IndicatorsManager::indicators()
290{
290{
291− QList<Indicator::Ptr> list;
291+ QVector<Indicator::Ptr> list;
292 Q_FOREACH(IndicatorData* data, m_indicatorsData)
292 Q_FOREACH(IndicatorData* data, m_indicatorsData)
293 {
293 {
294 Indicator::Ptr ret = indicator(data->m_name);
294 Indicator::Ptr ret = indicator(data->m_name);
plugins/Unity/Indicators/indicatorsmanager.h+1−1
@@ -45,7 +45,7 @@ public:
45
45
46 Indicator::Ptr indicator(const QString& indicator_name);
46 Indicator::Ptr indicator(const QString& indicator_name);
47
47
48− QList<Indicator::Ptr> indicators();
48+ QVector<Indicator::Ptr> indicators();
49
49
50 bool isLoaded() const;
50 bool isLoaded() const;
51
51
plugins/Unity/Indicators/modelprinter.cpp+3−3
@@ -60,7 +60,7 @@ QString ModelPrinter::text()
60
60
61QString tabify(int level) { QString str;
61QString tabify(int level) { QString str;
62 for (int i = 0; i < level; i++) {
62 for (int i = 0; i < level; i++) {
63− str += " ";
63+ str += QLatin1String(" ");
64 }
64 }
65 return str;
65 return str;
66}
66}
@@ -68,7 +68,7 @@ QString tabify(int level) { QString str;
68QString ModelPrinter::getModelDataString(UnityMenuModel* sourceModel, int level)
68QString ModelPrinter::getModelDataString(UnityMenuModel* sourceModel, int level)
69{
69{
70 if (!sourceModel)
70 if (!sourceModel)
71− return "";
71+ return QLatin1String("");
72
72
73 QString str;
73 QString str;
74 QTextStream stream(&str);
74 QTextStream stream(&str);
@@ -110,7 +110,7 @@ QString ModelPrinter::getRowSring(UnityMenuModel* sourceModel, int row, int dept
110 return str;
110 return str;
111}
111}
112
112
113−QString ModelPrinter::getVariantString(const QString& roleName, const QVariant vData ) const
113+QString ModelPrinter::getVariantString(const QString& roleName, const QVariant &vData) const
114{
114{
115 QString str;
115 QString str;
116 QTextStream stream(&str);
116 QTextStream stream(&str);
plugins/Unity/Indicators/modelprinter.h+2−2
@@ -46,10 +46,10 @@ Q_SIGNALS:
46private:
46private:
47 QString getModelDataString(UnityMenuModel* sourceModel, int level);
47 QString getModelDataString(UnityMenuModel* sourceModel, int level);
48 QString getRowSring(UnityMenuModel* sourceModel, int index, int depth) const;
48 QString getRowSring(UnityMenuModel* sourceModel, int index, int depth) const;
49− QString getVariantString(const QString& roleName, const QVariant vData ) const;
49+ QString getVariantString(const QString& roleName, const QVariant &vData) const;
50
50
51 UnityMenuModel* m_model;
51 UnityMenuModel* m_model;
52 QList<UnityMenuModel*> m_children;
52 QList<UnityMenuModel*> m_children;
53};
53};
54
54
55−#endif // MODELPRINTER_H
55+#endif // MODELPRINTER_H
plugins/Unity/Indicators/plugin.cpp+6−6
@@ -58,10 +58,10 @@ void IndicatorsPlugin::registerTypes(const char *uri)
58
58
59 qmlRegisterSingletonType<UnityMenuModelCache>(uri, 0, 1, "UnityMenuModelCache", menuModelCacheSingleton);
59 qmlRegisterSingletonType<UnityMenuModelCache>(uri, 0, 1, "UnityMenuModelCache", menuModelCacheSingleton);
60
60
61− qmlRegisterUncreatableType<MenuContentState>(uri, 0, 1, "MenuContentState", "Can't create MenuContentState class");
61+ qmlRegisterUncreatableType<MenuContentState>(uri, 0, 1, "MenuContentState", QStringLiteral("Can't create MenuContentState class"));
62− qmlRegisterUncreatableType<ActionState>(uri, 0, 1, "ActionState", "Can't create ActionState class");
62+ qmlRegisterUncreatableType<ActionState>(uri, 0, 1, "ActionState", QStringLiteral("Can't create ActionState class"));
63− qmlRegisterUncreatableType<NetworkActionState>(uri, 0, 1, "NetworkActionState", "Can't create NetworkActionState class");
63+ qmlRegisterUncreatableType<NetworkActionState>(uri, 0, 1, "NetworkActionState", QStringLiteral("Can't create NetworkActionState class"));
64− qmlRegisterUncreatableType<NetworkConnection>(uri, 0, 1, "NetworkConnection", "Can't create NetworkConnection class");
64+ qmlRegisterUncreatableType<NetworkConnection>(uri, 0, 1, "NetworkConnection", QStringLiteral("Can't create NetworkConnection class"));
65− qmlRegisterUncreatableType<IndicatorsModelRole>(uri, 0, 1, "IndicatorsModelRole", "Can't create IndicatorsModelRole class");
65+ qmlRegisterUncreatableType<IndicatorsModelRole>(uri, 0, 1, "IndicatorsModelRole", QStringLiteral("Can't create IndicatorsModelRole class"));
66− qmlRegisterUncreatableType<FlatMenuProxyModelRole>(uri, 0, 1, "FlatMenuProxyModelRole", "Can't create FlatMenuProxyModelRole class");
66+ qmlRegisterUncreatableType<FlatMenuProxyModelRole>(uri, 0, 1, "FlatMenuProxyModelRole", QStringLiteral("Can't create FlatMenuProxyModelRole class"));
67}
67}
plugins/Unity/Indicators/rootstateparser.cpp+16−16
@@ -39,7 +39,7 @@ static QString iconUri(GIcon *icon)
39 }
39 }
40
40
41 if (!iconNameList.empty()) {
41 if (!iconNameList.empty()) {
42− uri = QString("image://theme/%1").arg(iconNameList.join(","));
42+ uri = QStringLiteral("image://theme/%1").arg(iconNameList.join(QStringLiteral(",")));
43 }
43 }
44 }
44 }
45 else if (G_IS_FILE_ICON (icon)) {
45 else if (G_IS_FILE_ICON (icon)) {
@@ -63,7 +63,7 @@ static QString iconUri(GIcon *icon)
63 data = g_bytes_get_data (g_bytes_icon_get_bytes (G_BYTES_ICON (icon)), &size);
63 data = g_bytes_get_data (g_bytes_icon_get_bytes (G_BYTES_ICON (icon)), &size);
64 base64 = g_base64_encode ((const guchar *) data, size);
64 base64 = g_base64_encode ((const guchar *) data, size);
65
65
66− uri = QString("data://");
66+ uri = QStringLiteral("data://");
67 uri.append (base64);
67 uri.append (base64);
68
68
69 g_free (base64);
69 g_free (base64);
@@ -88,7 +88,7 @@ QVariant RootStateParser::toQVariant(GVariant* state) const
88 while (g_variant_iter_loop (&iter, "{sv}", &key, &vvalue))
88 while (g_variant_iter_loop (&iter, "{sv}", &key, &vvalue))
89 {
89 {
90 QString str = QString::fromUtf8(key);
90 QString str = QString::fromUtf8(key);
91− if (str == "icon" && !qmap.contains("icons")) {
91+ if (str == QLatin1String("icon") && !qmap.contains(QStringLiteral("icons"))) {
92 QStringList icons;
92 QStringList icons;
93
93
94 // FIXME - should be sending a url.
94 // FIXME - should be sending a url.
@@ -97,9 +97,9 @@ QVariant RootStateParser::toQVariant(GVariant* state) const
97 icons << iconUri(gicon);
97 icons << iconUri(gicon);
98 g_object_unref (gicon);
98 g_object_unref (gicon);
99 }
99 }
100− qmap.insert("icons", icons);
100+ qmap.insert(QStringLiteral("icons"), icons);
101
101
102− } else if (str == "icons") {
102+ } else if (str == QLatin1String("icons")) {
103
103
104 QStringList icons;
104 QStringList icons;
105
105
@@ -118,7 +118,7 @@ QVariant RootStateParser::toQVariant(GVariant* state) const
118 }
118 }
119 }
119 }
120 // will overwrite icon.
120 // will overwrite icon.
121− qmap.insert("icons", icons);
121+ qmap.insert(QStringLiteral("icons"), icons);
122
122
123 } else {
123 } else {
124 qmap.insert(str, ActionStateParser::toQVariant(vvalue));
124 qmap.insert(str, ActionStateParser::toQVariant(vvalue));
@@ -141,13 +141,13 @@ QVariant RootStateParser::toQVariant(GVariant* state) const
141 &accessible_name,
141 &accessible_name,
142 &visible);
142 &visible);
143
143
144− qmap["label"] = label ? QString::fromUtf8(label) : "";
144+ qmap[QStringLiteral("label")] = label ? QString::fromUtf8(label) : QLatin1String("");
145− qmap["accessible-desc"] = accessible_name ? QString::fromUtf8(accessible_name) : "";
145+ qmap[QStringLiteral("accessible-desc")] = accessible_name ? QString::fromUtf8(accessible_name) : QLatin1String("");
146− qmap["visible"] = visible;
146+ qmap[QStringLiteral("visible")] = visible;
147
147
148 gicon = g_icon_new_for_string (icon, nullptr);
148 gicon = g_icon_new_for_string (icon, nullptr);
149 if (gicon) {
149 if (gicon) {
150− qmap["icons"] = QStringList() << iconUri(gicon);
150+ qmap[QStringLiteral("icons")] = QStringList() << iconUri(gicon);
151 g_object_unref (gicon);
151 g_object_unref (gicon);
152 }
152 }
153
153
@@ -170,42 +170,42 @@ QString RootStateObject::title() const
170{
170{
171 if (!valid()) return QString();
171 if (!valid()) return QString();
172
172
173− return m_currentState.value("title", QVariant::fromValue(QString())).toString();
173+ return m_currentState.value(QStringLiteral("title"), QVariant::fromValue(QString())).toString();
174}
174}
175
175
176QString RootStateObject::leftLabel() const
176QString RootStateObject::leftLabel() const
177{
177{
178 if (!valid()) return QString();
178 if (!valid()) return QString();
179
179
180− return m_currentState.value("pre-label", QVariant::fromValue(QString())).toString();
180+ return m_currentState.value(QStringLiteral("pre-label"), QVariant::fromValue(QString())).toString();
181}
181}
182
182
183QString RootStateObject::rightLabel() const
183QString RootStateObject::rightLabel() const
184{
184{
185 if (!valid()) return QString();
185 if (!valid()) return QString();
186
186
187− return m_currentState.value("label", QVariant::fromValue(QString())).toString();
187+ return m_currentState.value(QStringLiteral("label"), QVariant::fromValue(QString())).toString();
188}
188}
189
189
190QStringList RootStateObject::icons() const
190QStringList RootStateObject::icons() const
191{
191{
192 if (!valid()) return QStringList();
192 if (!valid()) return QStringList();
193
193
194− return m_currentState.value("icons", QVariant::fromValue(QStringList())).toStringList();
194+ return m_currentState.value(QStringLiteral("icons"), QVariant::fromValue(QStringList())).toStringList();
195}
195}
196
196
197QString RootStateObject::accessibleName() const
197QString RootStateObject::accessibleName() const
198{
198{
199 if (!valid()) return QString();
199 if (!valid()) return QString();
200
200
201− return m_currentState.value("accessible-desc", QVariant::fromValue(QString())).toString();
201+ return m_currentState.value(QStringLiteral("accessible-desc"), QVariant::fromValue(QString())).toString();
202}
202}
203
203
204bool RootStateObject::indicatorVisible() const
204bool RootStateObject::indicatorVisible() const
205{
205{
206 if (!valid()) return false;
206 if (!valid()) return false;
207
207
208− return m_currentState.value("visible", QVariant::fromValue(true)).toBool();
208+ return m_currentState.value(QStringLiteral("visible"), QVariant::fromValue(true)).toBool();
209}
209}
210
210
211void RootStateObject::setCurrentState(const QVariantMap& newState)
211void RootStateObject::setCurrentState(const QVariantMap& newState)
plugins/Unity/Launcher/asadapter.cpp+10−9
@@ -38,25 +38,26 @@ void ASAdapter::syncItems(const QList<LauncherItem*> &list)
38{
38{
39 if (m_accounts && !m_user.isEmpty()) {
39 if (m_accounts && !m_user.isEmpty()) {
40 QList<QVariantMap> items;
40 QList<QVariantMap> items;
41+ items.reserve(list.count());
41
42
42 Q_FOREACH(LauncherItem *item, list) {
43 Q_FOREACH(LauncherItem *item, list) {
43 items << itemToVariant(item);
44 items << itemToVariant(item);
44 }
45 }
45
46
46− m_accounts->setUserPropertyAsync(m_user, "com.canonical.unity.AccountsService", "LauncherItems", QVariant::fromValue(items));
47+ m_accounts->setUserPropertyAsync(m_user, QStringLiteral("com.canonical.unity.AccountsService"), QStringLiteral("LauncherItems"), QVariant::fromValue(items));
47 }
48 }
48}
49}
49
50
50QVariantMap ASAdapter::itemToVariant(LauncherItem *item) const
51QVariantMap ASAdapter::itemToVariant(LauncherItem *item) const
51{
52{
52 QVariantMap details;
53 QVariantMap details;
53− details.insert("id", item->appId());
54+ details.insert(QStringLiteral("id"), item->appId());
54− details.insert("name", item->name());
55+ details.insert(QStringLiteral("name"), item->name());
55− details.insert("icon", item->icon());
56+ details.insert(QStringLiteral("icon"), item->icon());
56− details.insert("count", item->count());
57+ details.insert(QStringLiteral("count"), item->count());
57− details.insert("countVisible", item->countVisible());
58+ details.insert(QStringLiteral("countVisible"), item->countVisible());
58− details.insert("pinned", item->pinned());
59+ details.insert(QStringLiteral("pinned"), item->pinned());
59− details.insert("running", item->running());
60+ details.insert(QStringLiteral("running"), item->running());
60− details.insert("progress", item->progress());
61+ details.insert(QStringLiteral("progress"), item->progress());
61 return details;
62 return details;
62}
63}
plugins/Unity/Launcher/dbusinterface.cpp+33−33
@@ -27,7 +27,7 @@
27#include <QDebug>
27#include <QDebug>
28
28
29DBusInterface::DBusInterface(LauncherModel *parent):
29DBusInterface::DBusInterface(LauncherModel *parent):
30− UnityDBusVirtualObject("/com/canonical/Unity/Launcher", "com.canonical.Unity.Launcher", true, parent),
30+ UnityDBusVirtualObject(QStringLiteral("/com/canonical/Unity/Launcher"), QStringLiteral("com.canonical.Unity.Launcher"), true, parent),
31 m_launcherModel(parent)
31 m_launcherModel(parent)
32{
32{
33}
33}
@@ -35,13 +35,13 @@ DBusInterface::DBusInterface(LauncherModel *parent):
35QString DBusInterface::introspect(const QString &path) const
35QString DBusInterface::introspect(const QString &path) const
36{
36{
37 /* This case we should just list the nodes */
37 /* This case we should just list the nodes */
38− if (path == "/com/canonical/Unity/Launcher/" || path == "/com/canonical/Unity/Launcher") {
38+ if (path == QLatin1String("/com/canonical/Unity/Launcher/") || path == QLatin1String("/com/canonical/Unity/Launcher")) {
39 QString nodes;
39 QString nodes;
40
40
41 // Add Refresh to introspect
41 // Add Refresh to introspect
42− nodes = "<interface name=\"com.canonical.Unity.Launcher\">"
42+ nodes = QStringLiteral("<interface name=\"com.canonical.Unity.Launcher\">"
43 "<method name=\"Refresh\"/>"
43 "<method name=\"Refresh\"/>"
44− "</interface>";
44+ "</interface>");
45
45
46 // Add dynamic properties for launcher emblems
46 // Add dynamic properties for launcher emblems
47 for (int i = 0; i < m_launcherModel->rowCount(); i++) {
47 for (int i = 0; i < m_launcherModel->rowCount(); i++) {
@@ -53,18 +53,18 @@ QString DBusInterface::introspect(const QString &path) const
53 }
53 }
54
54
55 /* Should not happen, but let's handle it */
55 /* Should not happen, but let's handle it */
56− if (!path.startsWith("/com/canonical/Unity/Launcher")) {
56+ if (!path.startsWith(QLatin1String("/com/canonical/Unity/Launcher"))) {
57− return "";
57+ return QLatin1String("");
58 }
58 }
59
59
60 /* Now we should be looking at a node */
60 /* Now we should be looking at a node */
61 QString nodeiface =
61 QString nodeiface =
62− "<interface name=\"com.canonical.Unity.Launcher.Item\">"
62+ QStringLiteral("<interface name=\"com.canonical.Unity.Launcher.Item\">"
63 "<property name=\"count\" type=\"i\" access=\"readwrite\" />"
63 "<property name=\"count\" type=\"i\" access=\"readwrite\" />"
64 "<property name=\"countVisible\" type=\"b\" access=\"readwrite\" />"
64 "<property name=\"countVisible\" type=\"b\" access=\"readwrite\" />"
65 "<property name=\"progress\" type=\"i\" access=\"readwrite\" />"
65 "<property name=\"progress\" type=\"i\" access=\"readwrite\" />"
66 "<method name=\"Alert\" />"
66 "<method name=\"Alert\" />"
67− "</interface>";
67+ "</interface>");
68 return nodeiface;
68 return nodeiface;
69}
69}
70
70
@@ -109,7 +109,7 @@ QString DBusInterface::encodeAppId(const QString& appId)
109 (chr >= '0' && chr <= '9'&& i != 0)) {
109 (chr >= '0' && chr <= '9'&& i != 0)) {
110 encoded.append(chr);
110 encoded.append(chr);
111 } else {
111 } else {
112− QString hexval = QString("_%1").arg(chr, 2, 16, QChar('0'));
112+ QString hexval = QStringLiteral("_%1").arg(chr, 2, 16, QChar('0'));
113 encoded.append(hexval.toUpper());
113 encoded.append(hexval.toUpper());
114 }
114 }
115 }
115 }
@@ -127,10 +127,10 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
127 /* Break down the path to just the app id */
127 /* Break down the path to just the app id */
128 bool validpath = true;
128 bool validpath = true;
129 QString pathtemp = message.path();
129 QString pathtemp = message.path();
130− if (!pathtemp.startsWith("/com/canonical/Unity/Launcher/")) {
130+ if (!pathtemp.startsWith(QLatin1String("/com/canonical/Unity/Launcher/"))) {
131 validpath = false;
131 validpath = false;
132 }
132 }
133− pathtemp.remove("/com/canonical/Unity/Launcher/");
133+ pathtemp.remove(QStringLiteral("/com/canonical/Unity/Launcher/"));
134 if (pathtemp.indexOf('/') >= 0) {
134 if (pathtemp.indexOf('/') >= 0) {
135 validpath = false;
135 validpath = false;
136 }
136 }
@@ -139,15 +139,15 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
139 QString appid = decodeAppId(pathtemp);
139 QString appid = decodeAppId(pathtemp);
140
140
141 // First handle methods of the Launcher interface
141 // First handle methods of the Launcher interface
142− if (message.interface() == "com.canonical.Unity.Launcher") {
142+ if (message.interface() == QLatin1String("com.canonical.Unity.Launcher")) {
143− if (message.member() == "Refresh") {
143+ if (message.member() == QLatin1String("Refresh")) {
144 QDBusMessage reply = message.createReply();
144 QDBusMessage reply = message.createReply();
145 Q_EMIT refreshCalled();
145 Q_EMIT refreshCalled();
146 return connection.send(reply);
146 return connection.send(reply);
147 }
147 }
148− } else if (message.interface() == "com.canonical.Unity.Launcher.Item") {
148+ } else if (message.interface() == QLatin1String("com.canonical.Unity.Launcher.Item")) {
149 // Handle methods of the Launcher-Item interface
149 // Handle methods of the Launcher-Item interface
150− if (message.member() == "Alert" && validpath) {
150+ if (message.member() == QLatin1String("Alert") && validpath) {
151 QDBusMessage reply = message.createReply();
151 QDBusMessage reply = message.createReply();
152 Q_EMIT alertCalled(appid);
152 Q_EMIT alertCalled(appid);
153 return connection.send(reply);
153 return connection.send(reply);
@@ -155,15 +155,15 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
155 }
155 }
156
156
157 // Now handle dynamic properties (for launcher emblems)
157 // Now handle dynamic properties (for launcher emblems)
158− if (message.interface() != "org.freedesktop.DBus.Properties") {
158+ if (message.interface() != QLatin1String("org.freedesktop.DBus.Properties")) {
159 return false;
159 return false;
160 }
160 }
161
161
162− if (message.member() == "Get" && (message.arguments().count() != 2 || message.arguments()[0].toString() != "com.canonical.Unity.Launcher.Item")) {
162+ if (message.member() == QLatin1String("Get") && (message.arguments().count() != 2 || message.arguments()[0].toString() != QLatin1String("com.canonical.Unity.Launcher.Item"))) {
163 return false;
163 return false;
164 }
164 }
165
165
166− if (message.member() == "Set" && (message.arguments().count() != 3 || message.arguments()[0].toString() != "com.canonical.Unity.Launcher.Item")) {
166+ if (message.member() == QLatin1String("Set") && (message.arguments().count() != 3 || message.arguments()[0].toString() != QLatin1String("com.canonical.Unity.Launcher.Item"))) {
167 return false;
167 return false;
168 }
168 }
169
169
@@ -175,45 +175,45 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
175 LauncherItem *item = static_cast<LauncherItem*>(m_launcherModel->get(index));
175 LauncherItem *item = static_cast<LauncherItem*>(m_launcherModel->get(index));
176
176
177 QVariantList retval;
177 QVariantList retval;
178− if (message.member() == "Get") {
178+ if (message.member() == QLatin1String("Get")) {
179 QString cachedString = message.arguments()[1].toString();
179 QString cachedString = message.arguments()[1].toString();
180 if (!item) {
180 if (!item) {
181 return false;
181 return false;
182 }
182 }
183− if (cachedString == "count") {
183+ if (cachedString == QLatin1String("count")) {
184 retval.append(QVariant::fromValue(QDBusVariant(item->count())));
184 retval.append(QVariant::fromValue(QDBusVariant(item->count())));
185− } else if (cachedString == "countVisible") {
185+ } else if (cachedString == QLatin1String("countVisible")) {
186 retval.append(QVariant::fromValue(QDBusVariant(item->countVisible())));
186 retval.append(QVariant::fromValue(QDBusVariant(item->countVisible())));
187− } else if (cachedString == "progress") {
187+ } else if (cachedString == QLatin1String("progress")) {
188 retval.append(QVariant::fromValue(QDBusVariant(item->progress())));
188 retval.append(QVariant::fromValue(QDBusVariant(item->progress())));
189 }
189 }
190− } else if (message.member() == "Set") {
190+ } else if (message.member() == QLatin1String("Set")) {
191 QString cachedString = message.arguments()[1].toString();
191 QString cachedString = message.arguments()[1].toString();
192− if (cachedString == "count") {
192+ if (cachedString == QLatin1String("count")) {
193 int newCount = message.arguments()[2].value<QDBusVariant>().variant().toInt();
193 int newCount = message.arguments()[2].value<QDBusVariant>().variant().toInt();
194 if (!item || newCount != item->count()) {
194 if (!item || newCount != item->count()) {
195 Q_EMIT countChanged(appid, newCount);
195 Q_EMIT countChanged(appid, newCount);
196− notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "count", QVariant(newCount));
196+ notifyPropertyChanged(QStringLiteral("com.canonical.Unity.Launcher.Item"), encodeAppId(appid), QStringLiteral("count"), QVariant(newCount));
197 }
197 }
198− } else if (cachedString == "countVisible") {
198+ } else if (cachedString == QLatin1String("countVisible")) {
199 bool newVisible = message.arguments()[2].value<QDBusVariant>().variant().toBool();
199 bool newVisible = message.arguments()[2].value<QDBusVariant>().variant().toBool();
200 if (!item || newVisible != item->countVisible()) {
200 if (!item || newVisible != item->countVisible()) {
201 Q_EMIT countVisibleChanged(appid, newVisible);
201 Q_EMIT countVisibleChanged(appid, newVisible);
202− notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "countVisible", newVisible);
202+ notifyPropertyChanged(QStringLiteral("com.canonical.Unity.Launcher.Item"), encodeAppId(appid), QStringLiteral("countVisible"), newVisible);
203 }
203 }
204− } else if (cachedString == "progress") {
204+ } else if (cachedString == QLatin1String("progress")) {
205 int newProgress = message.arguments()[2].value<QDBusVariant>().variant().toInt();
205 int newProgress = message.arguments()[2].value<QDBusVariant>().variant().toInt();
206 if (!item || newProgress != item->progress()) {
206 if (!item || newProgress != item->progress()) {
207 Q_EMIT progressChanged(appid, newProgress);
207 Q_EMIT progressChanged(appid, newProgress);
208− notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "progress", QVariant(newProgress));
208+ notifyPropertyChanged(QStringLiteral("com.canonical.Unity.Launcher.Item"), encodeAppId(appid), QStringLiteral("progress"), QVariant(newProgress));
209 }
209 }
210 }
210 }
211− } else if (message.member() == "GetAll") {
211+ } else if (message.member() == QLatin1String("GetAll")) {
212 if (item) {
212 if (item) {
213 QVariantMap all;
213 QVariantMap all;
214− all.insert("count", item->count());
214+ all.insert(QStringLiteral("count"), item->count());
215− all.insert("countVisible", item->countVisible());
215+ all.insert(QStringLiteral("countVisible"), item->countVisible());
216− all.insert("progress", item->progress());
216+ all.insert(QStringLiteral("progress"), item->progress());
217 retval.append(all);
217 retval.append(all);
218 }
218 }
219 } else {
219 } else {
plugins/Unity/Launcher/desktopfilehandler.cpp+17−16
@@ -70,7 +70,7 @@ void DesktopFileHandler::load()
70
70
71 QStringList searchDirs = QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation);
71 QStringList searchDirs = QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation);
72#ifdef LAUNCHER_TESTING
72#ifdef LAUNCHER_TESTING
73− searchDirs << ".";
73+ searchDirs << QStringLiteral(".");
74#endif
74#endif
75
75
76 QString path;
76 QString path;
@@ -79,14 +79,15 @@ void DesktopFileHandler::load()
79 helper.replace(dashPos, 1, '/');
79 helper.replace(dashPos, 1, '/');
80 }
80 }
81
81
82− if (helper.contains("/")) {
82+ if (helper.contains('/')) {
83− path += helper.split('/').first() + '/';
83+ path += helper.split('/').at(0) + '/';
84 helper.remove(QRegExp("^" + path));
84 helper.remove(QRegExp("^" + path));
85 }
85 }
86
86
87 Q_FOREACH(const QString &searchDirName, searchDirs) {
87 Q_FOREACH(const QString &searchDirName, searchDirs) {
88 QDir searchDir(searchDirName + "/" + path);
88 QDir searchDir(searchDirName + "/" + path);
89+ const QString desktop = QStringLiteral("*.desktop");
89− Q_FOREACH(const QString &desktopFile, searchDir.entryList(QStringList() << "*.desktop")) {
90+ Q_FOREACH(const QString &desktopFile, searchDir.entryList(QStringList() << desktop)) {
90 if (desktopFile.startsWith(helper)) {
91 if (desktopFile.startsWith(helper)) {
91 QFileInfo fileInfo(searchDir, desktopFile);
92 QFileInfo fileInfo(searchDir, desktopFile);
92 m_filename = fileInfo.absoluteFilePath();
93 m_filename = fileInfo.absoluteFilePath();
@@ -95,7 +96,7 @@ void DesktopFileHandler::load()
95 }
96 }
96 }
97 }
97
98
98− dashPos = helper.indexOf("-");
99+ dashPos = helper.indexOf('-');
99 } while (dashPos != -1);
100 } while (dashPos != -1);
100}
101}
101
102
@@ -107,25 +108,25 @@ QString DesktopFileHandler::displayName() const
107
108
108 QSettings settings(m_filename, QSettings::IniFormat);
109 QSettings settings(m_filename, QSettings::IniFormat);
109 settings.setIniCodec("UTF-8");
110 settings.setIniCodec("UTF-8");
110− settings.beginGroup("Desktop Entry");
111+ settings.beginGroup(QStringLiteral("Desktop Entry"));
111
112
112 // First try to find Name[xx_YY] and Name[xx] in .desktop file
113 // First try to find Name[xx_YY] and Name[xx] in .desktop file
113 QString locale = QLocale().name();
114 QString locale = QLocale().name();
114 QString shortLocale = locale.split('_').first();
115 QString shortLocale = locale.split('_').first();
115
116
116− if (locale != shortLocale && settings.contains(QString("Name[%1]").arg(locale))) {
117+ if (locale != shortLocale && settings.contains(QStringLiteral("Name[%1]").arg(locale))) {
117− return settings.value(QString("Name[%1]").arg(locale)).toString();
118+ return settings.value(QStringLiteral("Name[%1]").arg(locale)).toString();
118 }
119 }
119
120
120− if (settings.contains(QString("Name[%1]").arg(shortLocale))) {
121+ if (settings.contains(QStringLiteral("Name[%1]").arg(shortLocale))) {
121− return settings.value(QString("Name[%1]").arg(shortLocale)).toString();
122+ return settings.value(QStringLiteral("Name[%1]").arg(shortLocale)).toString();
122 }
123 }
123
124
124 // No translation found in desktop file. Get the untranslated one and have a go with gettext.
125 // No translation found in desktop file. Get the untranslated one and have a go with gettext.
125− QString displayName = settings.value("Name").toString();
126+ QString displayName = settings.value(QStringLiteral("Name")).toString();
126
127
127− if (settings.contains("X-Ubuntu-Gettext-Domain")) {
128+ if (settings.contains(QStringLiteral("X-Ubuntu-Gettext-Domain"))) {
128− const QString domain = settings.value("X-Ubuntu-Gettext-Domain").toString();
129+ const QString domain = settings.value(QStringLiteral("X-Ubuntu-Gettext-Domain")).toString();
129 return dgettext(domain.toUtf8().constData(), displayName.toUtf8().constData());
130 return dgettext(domain.toUtf8().constData(), displayName.toUtf8().constData());
130 }
131 }
131
132
@@ -140,9 +141,9 @@ QString DesktopFileHandler::icon() const
140
141
141 QSettings settings(m_filename, QSettings::IniFormat);
142 QSettings settings(m_filename, QSettings::IniFormat);
142 settings.setIniCodec("UTF-8");
143 settings.setIniCodec("UTF-8");
143− settings.beginGroup("Desktop Entry");
144+ settings.beginGroup(QStringLiteral("Desktop Entry"));
144− QString iconString = settings.value("Icon").toString();
145+ QString iconString = settings.value(QStringLiteral("Icon")).toString();
145− QString pathString = settings.value("Path").toString();
146+ QString pathString = settings.value(QStringLiteral("Path")).toString();
146
147
147 if (QFileInfo(iconString).exists()) {
148 if (QFileInfo(iconString).exists()) {
148 return QFileInfo(iconString).absoluteFilePath();
149 return QFileInfo(iconString).absoluteFilePath();
plugins/Unity/Launcher/gsettings.cpp+15−12
@@ -32,20 +32,22 @@ QStringList GSettings::storedApplications() const
32{
32{
33 QStringList storedApps;
33 QStringList storedApps;
34
34
35+ const QString items = QStringLiteral("items");
35− Q_FOREACH(const QString &entry, m_gSettings->get("items").toStringList()) {
36+ Q_FOREACH(const QString &entry, m_gSettings->get(items).toStringList()) {
36− if (entry.startsWith("application:///")) {
37+ if (entry.startsWith(QLatin1String("application:///"))) {
37 // convert legacy entries to new world appids
38 // convert legacy entries to new world appids
38 QString appId = entry;
39 QString appId = entry;
39 // Transform "application://foobar.desktop" to "foobar"
40 // Transform "application://foobar.desktop" to "foobar"
40− appId.remove(QRegExp("^application:///"));
41+ appId.remove(QRegExp(QStringLiteral("^application:///")));
41− appId.remove(QRegExp(".desktop$"));
42+ appId.remove(QRegExp(QStringLiteral(".desktop$")));
42 storedApps << appId;
43 storedApps << appId;
43− } else if (entry.startsWith("appid://")) {
44+ } else if (entry.startsWith(QLatin1String("appid://"))) {
44 QString appId = entry;
45 QString appId = entry;
45− appId.remove("appid://");
46+ appId.remove(QStringLiteral("appid://"));
46− if (appId.split('/').count() == 3) {
47+ const QStringList splittedAppId = appId.split('/');
48+ if (splittedAppId.count() == 3) {
47 // Strip current-user-version in case its there
49 // Strip current-user-version in case its there
48− appId = appId.split('/').first() + "_" + appId.split('/').at(1);
50+ appId = splittedAppId.first() + "_" + splittedAppId.at(1);
49 }
51 }
50 storedApps << appId;
52 storedApps << appId;
51 }
53 }
@@ -56,19 +58,20 @@ QStringList GSettings::storedApplications() const
56void GSettings::setStoredApplications(const QStringList &storedApplications)
58void GSettings::setStoredApplications(const QStringList &storedApplications)
57{
59{
58 QStringList gSettingsList;
60 QStringList gSettingsList;
61+ gSettingsList.reserve(storedApplications.count());
59 Q_FOREACH(const QString &entry, storedApplications) {
62 Q_FOREACH(const QString &entry, storedApplications) {
60− gSettingsList << QString("appid://%1").arg(entry);
63+ gSettingsList << QStringLiteral("appid://%1").arg(entry);
61 }
64 }
62 // GSettings will emit a changed signal to ourselves. Let's cache the items
65 // GSettings will emit a changed signal to ourselves. Let's cache the items
63 // and only forward the changed signal when the list did actually change.
66 // and only forward the changed signal when the list did actually change.
64 m_cachedItems = gSettingsList;
67 m_cachedItems = gSettingsList;
65− m_gSettings->set("items", gSettingsList);
68+ m_gSettings->set(QStringLiteral("items"), gSettingsList);
66}
69}
67
70
68void GSettings::onSettingsChanged(const QString &key)
71void GSettings::onSettingsChanged(const QString &key)
69{
72{
70− if (key == "items") {
73+ if (key == QLatin1String("items")) {
71− const QStringList cachedItems = m_gSettings->get("items").toStringList();
74+ const QStringList cachedItems = m_gSettings->get(QStringLiteral("items")).toStringList();
72 if (m_cachedItems != cachedItems) {
75 if (m_cachedItems != cachedItems) {
73 m_cachedItems = cachedItems;
76 m_cachedItems = cachedItems;
74 Q_EMIT changed();
77 Q_EMIT changed();
plugins/Unity/Launcher/launcheritem.cpp+6−6
@@ -38,17 +38,17 @@ LauncherItem::LauncherItem(const QString &appId, const QString &name, const QStr
38 m_quickList(new QuickListModel(this))
38 m_quickList(new QuickListModel(this))
39{
39{
40 QuickListEntry nameAction;
40 QuickListEntry nameAction;
41− nameAction.setActionId("launch_item");
41+ nameAction.setActionId(QStringLiteral("launch_item"));
42 nameAction.setText(m_name);
42 nameAction.setText(m_name);
43 m_quickList->appendAction(nameAction);
43 m_quickList->appendAction(nameAction);
44
44
45 QuickListEntry pinningAction;
45 QuickListEntry pinningAction;
46− pinningAction.setActionId("pin_item");
46+ pinningAction.setActionId(QStringLiteral("pin_item"));
47 pinningAction.setText(gettext("Pin shortcut"));
47 pinningAction.setText(gettext("Pin shortcut"));
48 m_quickList->appendAction(pinningAction);
48 m_quickList->appendAction(pinningAction);
49
49
50− m_quitAction.setActionId("stop_item");
50+ m_quitAction.setActionId(QStringLiteral("stop_item"));
51− m_quitAction.setIcon("application-exit");
51+ m_quitAction.setIcon(QStringLiteral("application-exit"));
52 m_quitAction.setText(gettext("Quit"));
52 m_quitAction.setText(gettext("Quit"));
53}
53}
54
54
@@ -67,7 +67,7 @@ void LauncherItem::setName(const QString &name)
67 if (m_name != name) {
67 if (m_name != name) {
68 m_name = name;
68 m_name = name;
69 QuickListEntry entry;
69 QuickListEntry entry;
70− entry.setActionId("launch_item");
70+ entry.setActionId(QStringLiteral("launch_item"));
71 entry.setText(m_name);
71 entry.setText(m_name);
72 m_quickList->updateAction(entry);
72 m_quickList->updateAction(entry);
73 Q_EMIT nameChanged(name);
73 Q_EMIT nameChanged(name);
@@ -102,7 +102,7 @@ void LauncherItem::setPinned(bool pinned)
102 // Even if pinned status didn't change, we want to update text in case
102 // Even if pinned status didn't change, we want to update text in case
103 // the locale has changed since we last set pinned status.
103 // the locale has changed since we last set pinned status.
104 QuickListEntry entry;
104 QuickListEntry entry;
105− entry.setActionId("pin_item");
105+ entry.setActionId(QStringLiteral("pin_item"));
106 entry.setText(pinned ? gettext("Unpin shortcut") : gettext("Pin shortcut"));
106 entry.setText(pinned ? gettext("Unpin shortcut") : gettext("Pin shortcut"));
107 m_quickList->updateAction(entry);
107 m_quickList->updateAction(entry);
108}
108}
plugins/Unity/Launcher/launchermodel.cpp+6−6
@@ -204,15 +204,15 @@ void LauncherModel::quickListActionInvoked(const QString &appId, int actionIndex
204 const QString actionId = model->get(actionIndex).actionId();
204 const QString actionId = model->get(actionIndex).actionId();
205
205
206 // Check if this is one of the launcher actions we handle ourselves
206 // Check if this is one of the launcher actions we handle ourselves
207− if (actionId == "pin_item") {
207+ if (actionId == QLatin1String("pin_item")) {
208 if (item->pinned()) {
208 if (item->pinned()) {
209 requestRemove(appId);
209 requestRemove(appId);
210 } else {
210 } else {
211 pin(appId);
211 pin(appId);
212 }
212 }
213− } else if (actionId == "launch_item") {
213+ } else if (actionId == QLatin1String("launch_item")) {
214 QDesktopServices::openUrl(getUrlForAppId(appId));
214 QDesktopServices::openUrl(getUrlForAppId(appId));
215− } else if (actionId == "stop_item") { // Quit
215+ } else if (actionId == QLatin1String("stop_item")) { // Quit
216 if (m_appManager) {
216 if (m_appManager) {
217 m_appManager->stopApplication(appId);
217 m_appManager->stopApplication(appId);
218 }
218 }
@@ -236,13 +236,13 @@ QString LauncherModel::getUrlForAppId(const QString &appId) const
236 return QString();
236 return QString();
237 }
237 }
238
238
239− if (!appId.contains("_")) {
239+ if (!appId.contains('_')) {
240 return "application:///" + appId + ".desktop";
240 return "application:///" + appId + ".desktop";
241 }
241 }
242
242
243 QStringList parts = appId.split('_');
243 QStringList parts = appId.split('_');
244 QString package = parts.value(0);
244 QString package = parts.value(0);
245− QString app = parts.value(1, "first-listed-app");
245+ QString app = parts.value(1, QStringLiteral("first-listed-app"));
246 return "appid://" + package + "/" + app + "/current-user-version";
246 return "appid://" + package + "/" + app + "/current-user-version";
247}
247}
248
248
@@ -503,7 +503,7 @@ void LauncherModel::applicationAdded(const QModelIndex &parent, int row)
503 return;
503 return;
504 }
504 }
505
505
506− if (app->appId() == "unity8-dash") {
506+ if (app->appId() == QLatin1String("unity8-dash")) {
507 // Not adding the dash app
507 // Not adding the dash app
508 return;
508 return;
509 }
509 }
plugins/Unity/Launcher/plugin.cpp+5−5
@@ -39,11 +39,11 @@ void UnityLauncherPlugin::registerTypes(const char *uri)
39{
39{
40 Q_ASSERT(uri == QLatin1String("Unity.Launcher"));
40 Q_ASSERT(uri == QLatin1String("Unity.Launcher"));
41
41
42− qmlRegisterUncreatableType<LauncherModelInterface>(uri, 0, 1, "LauncherModelInterface", "Abstract Interface. Cannot be instantiated.");
42+ qmlRegisterUncreatableType<LauncherModelInterface>(uri, 0, 1, "LauncherModelInterface", QStringLiteral("Abstract Interface. Cannot be instantiated."));
43− qmlRegisterUncreatableType<LauncherItemInterface>(uri, 0, 1, "LauncherItemInterface", "Abstract Interface. Cannot be instantiated.");
43+ qmlRegisterUncreatableType<LauncherItemInterface>(uri, 0, 1, "LauncherItemInterface", QStringLiteral("Abstract Interface. Cannot be instantiated."));
44− qmlRegisterUncreatableType<QuickListModelInterface>(uri, 0, 1, "QuickListInterface", "Abstract Interface. Cannot be instantiated.");
44+ qmlRegisterUncreatableType<QuickListModelInterface>(uri, 0, 1, "QuickListInterface", QStringLiteral("Abstract Interface. Cannot be instantiated."));
45
45
46 qmlRegisterSingletonType<LauncherModel>(uri, 0, 1, "LauncherModel", modelProvider);
46 qmlRegisterSingletonType<LauncherModel>(uri, 0, 1, "LauncherModel", modelProvider);
47− qmlRegisterUncreatableType<LauncherItem>(uri, 0, 1, "LauncherItem", "Can't create new Launcher Items in QML. Get them from the LauncherModel.");
47+ qmlRegisterUncreatableType<LauncherItem>(uri, 0, 1, "LauncherItem", QStringLiteral("Can't create new Launcher Items in QML. Get them from the LauncherModel."));
48− qmlRegisterUncreatableType<QuickListModel>(uri, 0, 1, "QuickListModel", "Can't create a QuickListModel in QML. Get them from the LauncherItems.");
48+ qmlRegisterUncreatableType<QuickListModel>(uri, 0, 1, "QuickListModel", QStringLiteral("Can't create a QuickListModel in QML. Get them from the LauncherItems."));
49}
49}
plugins/Unity/Session/dbusunitysessionservice.cpp+41−41
@@ -58,7 +58,7 @@ public:
58 QDBusMessage msg = QDBusMessage::createMethodCall(LOGIN1_SERVICE,
58 QDBusMessage msg = QDBusMessage::createMethodCall(LOGIN1_SERVICE,
59 LOGIN1_PATH,
59 LOGIN1_PATH,
60 LOGIN1_IFACE,
60 LOGIN1_IFACE,
61− "GetSessionByPID");
61+ QStringLiteral("GetSessionByPID"));
62 msg << (quint32) getpid();
62 msg << (quint32) getpid();
63
63
64 QDBusReply<QDBusObjectPath> reply = QDBusConnection::systemBus().asyncCall(msg);
64 QDBusReply<QDBusObjectPath> reply = QDBusConnection::systemBus().asyncCall(msg);
@@ -66,13 +66,13 @@ public:
66 logindSessionPath = reply.value().path();
66 logindSessionPath = reply.value().path();
67
67
68 // start watching the Active property
68 // start watching the Active property
69− QDBusConnection::systemBus().connect(LOGIN1_SERVICE, logindSessionPath, "org.freedesktop.DBus.Properties", "PropertiesChanged",
69+ QDBusConnection::systemBus().connect(LOGIN1_SERVICE, logindSessionPath, QStringLiteral("org.freedesktop.DBus.Properties"), QStringLiteral("PropertiesChanged"),
70 this, SLOT(onPropertiesChanged(QString,QVariantMap,QStringList)));
70 this, SLOT(onPropertiesChanged(QString,QVariantMap,QStringList)));
71
71
72 setupSystemdInhibition();
72 setupSystemdInhibition();
73
73
74 // re-enable the inhibition upon resume from sleep
74 // re-enable the inhibition upon resume from sleep
75− QDBusConnection::systemBus().connect(LOGIN1_SERVICE, LOGIN1_PATH, LOGIN1_IFACE, "PrepareForSleep",
75+ QDBusConnection::systemBus().connect(LOGIN1_SERVICE, LOGIN1_PATH, LOGIN1_IFACE, QStringLiteral("PrepareForSleep"),
76 this, SLOT(onResuming(bool)));
76 this, SLOT(onResuming(bool)));
77 } else {
77 } else {
78 qWarning() << "Failed to get logind session path" << reply.error().message();
78 qWarning() << "Failed to get logind session path" << reply.error().message();
@@ -87,7 +87,7 @@ public:
87 // inhibit systemd handling of power/sleep/lid buttons
87 // inhibit systemd handling of power/sleep/lid buttons
88 // http://www.freedesktop.org/wiki/Software/systemd/inhibit
88 // http://www.freedesktop.org/wiki/Software/systemd/inhibit
89
89
90− QDBusMessage msg = QDBusMessage::createMethodCall(LOGIN1_SERVICE, LOGIN1_PATH, LOGIN1_IFACE, "Inhibit");
90+ QDBusMessage msg = QDBusMessage::createMethodCall(LOGIN1_SERVICE, LOGIN1_PATH, LOGIN1_IFACE, QStringLiteral("Inhibit"));
91 msg << "handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch"; // what
91 msg << "handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch"; // what
92 msg << "Unity"; // who
92 msg << "Unity"; // who
93 msg << "Unity8 handles power events"; // why
93 msg << "Unity8 handles power events"; // why
@@ -128,8 +128,8 @@ public:
128
128
129 QDBusMessage msg = QDBusMessage::createMethodCall(LOGIN1_SERVICE,
129 QDBusMessage msg = QDBusMessage::createMethodCall(LOGIN1_SERVICE,
130 logindSessionPath,
130 logindSessionPath,
131− "org.freedesktop.DBus.Properties",
131+ QStringLiteral("org.freedesktop.DBus.Properties"),
132− "Get");
132+ QStringLiteral("Get"));
133 msg << LOGIN1_SESSION_IFACE;
133 msg << LOGIN1_SESSION_IFACE;
134 msg << ACTIVE_KEY;
134 msg << ACTIVE_KEY;
135
135
@@ -154,8 +154,8 @@ public:
154 {
154 {
155 QDBusMessage msg = QDBusMessage::createMethodCall(LOGIN1_SERVICE,
155 QDBusMessage msg = QDBusMessage::createMethodCall(LOGIN1_SERVICE,
156 logindSessionPath,
156 logindSessionPath,
157− "org.freedesktop.DBus.Properties",
157+ QStringLiteral("org.freedesktop.DBus.Properties"),
158− "Get");
158+ QStringLiteral("Get"));
159 msg << LOGIN1_SESSION_IFACE;
159 msg << LOGIN1_SESSION_IFACE;
160 msg << IDLE_SINCE_KEY;
160 msg << IDLE_SINCE_KEY;
161
161
@@ -174,7 +174,7 @@ public:
174 QDBusMessage msg = QDBusMessage::createMethodCall(LOGIN1_SERVICE,
174 QDBusMessage msg = QDBusMessage::createMethodCall(LOGIN1_SERVICE,
175 logindSessionPath,
175 logindSessionPath,
176 LOGIN1_SESSION_IFACE,
176 LOGIN1_SESSION_IFACE,
177− "SetIdleHint");
177+ QStringLiteral("SetIdleHint"));
178 msg << idle;
178 msg << idle;
179 QDBusConnection::systemBus().asyncCall(msg);
179 QDBusConnection::systemBus().asyncCall(msg);
180 }
180 }
@@ -217,14 +217,14 @@ Q_SIGNALS:
217Q_GLOBAL_STATIC(DBusUnitySessionServicePrivate, d)
217Q_GLOBAL_STATIC(DBusUnitySessionServicePrivate, d)
218
218
219DBusUnitySessionService::DBusUnitySessionService()
219DBusUnitySessionService::DBusUnitySessionService()
220− : UnityDBusObject("/com/canonical/Unity/Session", "com.canonical.Unity")
220+ : UnityDBusObject(QStringLiteral("/com/canonical/Unity/Session"), QStringLiteral("com.canonical.Unity"))
221{
221{
222 if (!d->logindSessionPath.isEmpty()) {
222 if (!d->logindSessionPath.isEmpty()) {
223 // connect our Lock() slot to the logind's session Lock() signal
223 // connect our Lock() slot to the logind's session Lock() signal
224− QDBusConnection::systemBus().connect(LOGIN1_SERVICE, d->logindSessionPath, LOGIN1_SESSION_IFACE, "Lock", this, SLOT(Lock()));
224+ QDBusConnection::systemBus().connect(LOGIN1_SERVICE, d->logindSessionPath, LOGIN1_SESSION_IFACE, QStringLiteral("Lock"), this, SLOT(Lock()));
225 // ... and our Unlocked() signal to the logind's session Unlock() signal
225 // ... and our Unlocked() signal to the logind's session Unlock() signal
226 // (lightdm handles the unlocking by calling logind's Unlock method which in turn emits this signal we connect to)
226 // (lightdm handles the unlocking by calling logind's Unlock method which in turn emits this signal we connect to)
227− QDBusConnection::systemBus().connect(LOGIN1_SERVICE, d->logindSessionPath, LOGIN1_SESSION_IFACE, "Unlock", this, SIGNAL(Unlocked()));
227+ QDBusConnection::systemBus().connect(LOGIN1_SERVICE, d->logindSessionPath, LOGIN1_SESSION_IFACE, QStringLiteral("Unlock"), this, SIGNAL(Unlocked()));
228 } else {
228 } else {
229 qWarning() << "Failed to connect to logind's session Lock/Unlock signals";
229 qWarning() << "Failed to connect to logind's session Lock/Unlock signals";
230 }
230 }
@@ -239,36 +239,36 @@ void DBusUnitySessionService::Logout()
239
239
240void DBusUnitySessionService::EndSession()
240void DBusUnitySessionService::EndSession()
241{
241{
242− const QDBusMessage msg = QDBusMessage::createMethodCall("com.ubuntu.Upstart",
242+ const QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("com.ubuntu.Upstart"),
243− "/com/ubuntu/Upstart",
243+ QStringLiteral("/com/ubuntu/Upstart"),
244− "com.ubuntu.Upstart0_6",
244+ QStringLiteral("com.ubuntu.Upstart0_6"),
245− "EndSession");
245+ QStringLiteral("EndSession"));
246 QDBusConnection::sessionBus().asyncCall(msg);
246 QDBusConnection::sessionBus().asyncCall(msg);
247}
247}
248
248
249bool DBusUnitySessionService::CanHibernate() const
249bool DBusUnitySessionService::CanHibernate() const
250{
250{
251− return d->checkLogin1Call("CanHibernate");
251+ return d->checkLogin1Call(QStringLiteral("CanHibernate"));
252}
252}
253
253
254bool DBusUnitySessionService::CanSuspend() const
254bool DBusUnitySessionService::CanSuspend() const
255{
255{
256− return d->checkLogin1Call("CanSuspend");
256+ return d->checkLogin1Call(QStringLiteral("CanSuspend"));
257}
257}
258
258
259bool DBusUnitySessionService::CanHybridSleep() const
259bool DBusUnitySessionService::CanHybridSleep() const
260{
260{
261− return d->checkLogin1Call("CanHybridSleep");
261+ return d->checkLogin1Call(QStringLiteral("CanHybridSleep"));
262}
262}
263
263
264bool DBusUnitySessionService::CanReboot() const
264bool DBusUnitySessionService::CanReboot() const
265{
265{
266− return d->checkLogin1Call("CanReboot");
266+ return d->checkLogin1Call(QStringLiteral("CanReboot"));
267}
267}
268
268
269bool DBusUnitySessionService::CanShutdown() const
269bool DBusUnitySessionService::CanShutdown() const
270{
270{
271− return d->checkLogin1Call("CanPowerOff");
271+ return d->checkLogin1Call(QStringLiteral("CanPowerOff"));
272}
272}
273
273
274bool DBusUnitySessionService::CanLock() const
274bool DBusUnitySessionService::CanLock() const
@@ -320,10 +320,10 @@ void DBusUnitySessionService::Lock()
320{
320{
321 // lock the session using the org.freedesktop.DisplayManager system DBUS service
321 // lock the session using the org.freedesktop.DisplayManager system DBUS service
322 const QString sessionPath = QString::fromLocal8Bit(qgetenv("XDG_SESSION_PATH"));
322 const QString sessionPath = QString::fromLocal8Bit(qgetenv("XDG_SESSION_PATH"));
323− QDBusMessage msg = QDBusMessage::createMethodCall("org.freedesktop.DisplayManager",
323+ QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DisplayManager"),
324 sessionPath,
324 sessionPath,
325− "org.freedesktop.DisplayManager.Session",
325+ QStringLiteral("org.freedesktop.DisplayManager.Session"),
326− "Lock");
326+ QStringLiteral("Lock"));
327 QDBusReply<void> reply = QDBusConnection::systemBus().asyncCall(msg);
327 QDBusReply<void> reply = QDBusConnection::systemBus().asyncCall(msg);
328 if (!reply.isValid()) {
328 if (!reply.isValid()) {
329 qWarning() << "Lock call failed" << reply.error().message();
329 qWarning() << "Lock call failed" << reply.error().message();
@@ -346,7 +346,7 @@ void DBusUnitySessionService::RequestLogout()
346
346
347void DBusUnitySessionService::Reboot()
347void DBusUnitySessionService::Reboot()
348{
348{
349− d->makeLogin1Call("Reboot", {false});
349+ d->makeLogin1Call(QStringLiteral("Reboot"), {false});
350}
350}
351
351
352void DBusUnitySessionService::RequestReboot()
352void DBusUnitySessionService::RequestReboot()
@@ -357,22 +357,22 @@ void DBusUnitySessionService::RequestReboot()
357
357
358void DBusUnitySessionService::Shutdown()
358void DBusUnitySessionService::Shutdown()
359{
359{
360− d->makeLogin1Call("PowerOff", {false});
360+ d->makeLogin1Call(QStringLiteral("PowerOff"), {false});
361}
361}
362
362
363void DBusUnitySessionService::Suspend()
363void DBusUnitySessionService::Suspend()
364{
364{
365− d->makeLogin1Call("Suspend", {false});
365+ d->makeLogin1Call(QStringLiteral("Suspend"), {false});
366}
366}
367
367
368void DBusUnitySessionService::Hibernate()
368void DBusUnitySessionService::Hibernate()
369{
369{
370− d->makeLogin1Call("Hibernate", {false});
370+ d->makeLogin1Call(QStringLiteral("Hibernate"), {false});
371}
371}
372
372
373void DBusUnitySessionService::HybridSleep()
373void DBusUnitySessionService::HybridSleep()
374{
374{
375− d->makeLogin1Call("HybridSleep", {false});
375+ d->makeLogin1Call(QStringLiteral("HybridSleep"), {false});
376}
376}
377
377
378void DBusUnitySessionService::RequestShutdown()
378void DBusUnitySessionService::RequestShutdown()
@@ -392,16 +392,16 @@ enum class Action : unsigned
392
392
393void performAsyncUnityCall(const QString &method)
393void performAsyncUnityCall(const QString &method)
394{
394{
395− const QDBusMessage msg = QDBusMessage::createMethodCall("com.canonical.Unity",
395+ const QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("com.canonical.Unity"),
396− "/com/canonical/Unity/Session",
396+ QStringLiteral("/com/canonical/Unity/Session"),
397− "com.canonical.Unity.Session",
397+ QStringLiteral("com.canonical.Unity.Session"),
398 method);
398 method);
399 QDBusConnection::sessionBus().asyncCall(msg);
399 QDBusConnection::sessionBus().asyncCall(msg);
400}
400}
401
401
402
402
403DBusGnomeSessionManagerWrapper::DBusGnomeSessionManagerWrapper()
403DBusGnomeSessionManagerWrapper::DBusGnomeSessionManagerWrapper()
404− : UnityDBusObject("/org/gnome/SessionManager/EndSessionDialog", "com.canonical.Unity")
404+ : UnityDBusObject(QStringLiteral("/org/gnome/SessionManager/EndSessionDialog"), QStringLiteral("com.canonical.Unity"))
405{
405{
406}
406}
407
407
@@ -414,15 +414,15 @@ void DBusGnomeSessionManagerWrapper::Open(const unsigned type, const unsigned ar
414 switch (static_cast<Action>(type))
414 switch (static_cast<Action>(type))
415 {
415 {
416 case Action::LOGOUT:
416 case Action::LOGOUT:
417− performAsyncUnityCall("RequestLogout");
417+ performAsyncUnityCall(QStringLiteral("RequestLogout"));
418 break;
418 break;
419
419
420 case Action::REBOOT:
420 case Action::REBOOT:
421− performAsyncUnityCall("RequestReboot");
421+ performAsyncUnityCall(QStringLiteral("RequestReboot"));
422 break;
422 break;
423
423
424 case Action::SHUTDOWN:
424 case Action::SHUTDOWN:
425− performAsyncUnityCall("RequestShutdown");
425+ performAsyncUnityCall(QStringLiteral("RequestShutdown"));
426 break;
426 break;
427
427
428 default:
428 default:
@@ -432,7 +432,7 @@ void DBusGnomeSessionManagerWrapper::Open(const unsigned type, const unsigned ar
432
432
433
433
434DBusGnomeScreensaverWrapper::DBusGnomeScreensaverWrapper()
434DBusGnomeScreensaverWrapper::DBusGnomeScreensaverWrapper()
435− : UnityDBusObject("/org/gnome/ScreenSaver", "org.gnome.ScreenSaver")
435+ : UnityDBusObject(QStringLiteral("/org/gnome/ScreenSaver"), QStringLiteral("org.gnome.ScreenSaver"))
436{
436{
437 connect(d, &DBusUnitySessionServicePrivate::screensaverActiveChanged, this, &DBusGnomeScreensaverWrapper::ActiveChanged);
437 connect(d, &DBusUnitySessionServicePrivate::screensaverActiveChanged, this, &DBusGnomeScreensaverWrapper::ActiveChanged);
438}
438}
@@ -451,7 +451,7 @@ void DBusGnomeScreensaverWrapper::SetActive(bool lock)
451
451
452void DBusGnomeScreensaverWrapper::Lock()
452void DBusGnomeScreensaverWrapper::Lock()
453{
453{
454− performAsyncUnityCall("Lock");
454+ performAsyncUnityCall(QStringLiteral("Lock"));
455}
455}
456
456
457quint32 DBusGnomeScreensaverWrapper::GetActiveTime() const
457quint32 DBusGnomeScreensaverWrapper::GetActiveTime() const
@@ -466,9 +466,9 @@ void DBusGnomeScreensaverWrapper::SimulateUserActivity()
466
466
467
467
468DBusScreensaverWrapper::DBusScreensaverWrapper()
468DBusScreensaverWrapper::DBusScreensaverWrapper()
469− : UnityDBusObject("/org/freedesktop/ScreenSaver", "org.freedesktop.ScreenSaver")
469+ : UnityDBusObject(QStringLiteral("/org/freedesktop/ScreenSaver"), QStringLiteral("org.freedesktop.ScreenSaver"))
470{
470{
471− QDBusConnection::sessionBus().registerObject("/ScreenSaver", this, QDBusConnection::ExportScriptableContents); // compat path, also register here
471+ QDBusConnection::sessionBus().registerObject(QStringLiteral("/ScreenSaver"), this, QDBusConnection::ExportScriptableContents); // compat path, also register here
472 connect(d, &DBusUnitySessionServicePrivate::screensaverActiveChanged, this, &DBusScreensaverWrapper::ActiveChanged);
472 connect(d, &DBusUnitySessionServicePrivate::screensaverActiveChanged, this, &DBusScreensaverWrapper::ActiveChanged);
473}
473}
474
474
@@ -488,7 +488,7 @@ bool DBusScreensaverWrapper::SetActive(bool lock)
488
488
489void DBusScreensaverWrapper::Lock()
489void DBusScreensaverWrapper::Lock()
490{
490{
491− performAsyncUnityCall("Lock");
491+ performAsyncUnityCall(QStringLiteral("Lock"));
492}
492}
493
493
494quint32 DBusScreensaverWrapper::GetActiveTime() const
494quint32 DBusScreensaverWrapper::GetActiveTime() const
plugins/Utils/plugin.cpp+1−1
@@ -74,5 +74,5 @@ void UtilsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
74{
74{
75 QQmlExtensionPlugin::initializeEngine(engine, uri);
75 QQmlExtensionPlugin::initializeEngine(engine, uri);
76
76
77− engine->addImageProvider(QLatin1String("window"), new WindowScreenshotProvider);
77+ engine->addImageProvider(QStringLiteral("window"), new WindowScreenshotProvider);
78}
78}
plugins/Utils/timeformatter.cpp+3−3
@@ -113,7 +113,7 @@ TimeFormatter::TimeFormatter(QObject *parent): QObject(parent)
113 priv = new TimeFormatterPrivate;
113 priv = new TimeFormatterPrivate;
114 priv->formatter = this;
114 priv->formatter = this;
115 priv->time = 0;
115 priv->time = 0;
116− priv->format = "yyyy-MM-dd hh:mm";
116+ priv->format = QStringLiteral("yyyy-MM-dd hh:mm");
117 priv->system_bus = nullptr;
117 priv->system_bus = nullptr;
118 priv->subscription_id = 0;
118 priv->subscription_id = 0;
119 priv->cancellable = g_cancellable_new ();
119 priv->cancellable = g_cancellable_new ();
@@ -182,7 +182,7 @@ QString TimeFormatter::formatTime() const
182}
182}
183
183
184GDateTimeFormatter::GDateTimeFormatter(QObject* parent)
184GDateTimeFormatter::GDateTimeFormatter(QObject* parent)
185−: TimeFormatter("%d-%m-%Y %I:%M%p", parent)
185+: TimeFormatter(QStringLiteral("%d-%m-%Y %I:%M%p"), parent)
186{
186{
187}
187}
188
188
@@ -194,7 +194,7 @@ QString GDateTimeFormatter::formatTime() const
194
194
195 datetime = g_date_time_new_from_unix_local(time());
195 datetime = g_date_time_new_from_unix_local(time());
196 if (!datetime) {
196 if (!datetime) {
197− return "";
197+ return QLatin1String("");
198 }
198 }
199
199
200 time_string = g_date_time_format(datetime, formatBytes.constData());
200 time_string = g_date_time_format(datetime, formatBytes.constData());
plugins/Utils/windowstatestorage.cpp+6−6
@@ -30,7 +30,7 @@ WindowStateStorage::WindowStateStorage(QObject *parent):
30 QObject(parent)
30 QObject(parent)
31{
31{
32 QString dbPath = QDir::homePath() + "/.cache/unity8/";
32 QString dbPath = QDir::homePath() + "/.cache/unity8/";
33− m_db = QSqlDatabase::addDatabase("QSQLITE");
33+ m_db = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"));
34 QDir dir;
34 QDir dir;
35 dir.mkpath(dbPath);
35 dir.mkpath(dbPath);
36 m_db.setDatabaseName(dbPath + "windowstatestorage.sqlite");
36 m_db.setDatabaseName(dbPath + "windowstatestorage.sqlite");
@@ -51,7 +51,7 @@ void WindowStateStorage::saveGeometry(const QString &windowId, const QRect &rect
51{
51{
52 QMutexLocker mutexLocker(&s_mutex);
52 QMutexLocker mutexLocker(&s_mutex);
53
53
54− QString queryString = QString("INSERT OR REPLACE INTO geometry (windowId, x, y, width, height) values ('%1', '%2', '%3', '%4', '%5');")
54+ QString queryString = QStringLiteral("INSERT OR REPLACE INTO geometry (windowId, x, y, width, height) values ('%1', '%2', '%3', '%4', '%5');")
55 .arg(windowId)
55 .arg(windowId)
56 .arg(rect.x())
56 .arg(rect.x())
57 .arg(rect.y())
57 .arg(rect.y())
@@ -85,7 +85,7 @@ void WindowStateStorage::executeAsyncQuery(const QString &queryString)
85QRect WindowStateStorage::getGeometry(const QString &windowId, const QRect &defaultValue)
85QRect WindowStateStorage::getGeometry(const QString &windowId, const QRect &defaultValue)
86{
86{
87 QMutexLocker l(&s_mutex);
87 QMutexLocker l(&s_mutex);
88− QString queryString = QString("SELECT * FROM geometry WHERE windowId = '%1';")
88+ QString queryString = QStringLiteral("SELECT * FROM geometry WHERE windowId = '%1';")
89 .arg(windowId);
89 .arg(windowId);
90 QSqlQuery query;
90 QSqlQuery query;
91
91
@@ -99,7 +99,7 @@ QRect WindowStateStorage::getGeometry(const QString &windowId, const QRect &defa
99 if (!query.first()) {
99 if (!query.first()) {
100 return defaultValue;
100 return defaultValue;
101 }
101 }
102− return QRect(query.value("x").toInt(), query.value("y").toInt(), query.value("width").toInt(), query.value("height").toInt());
102+ return QRect(query.value(QStringLiteral("x")).toInt(), query.value(QStringLiteral("y")).toInt(), query.value(QStringLiteral("width")).toInt(), query.value(QStringLiteral("height")).toInt());
103}
103}
104
104
105void WindowStateStorage::initdb()
105void WindowStateStorage::initdb()
@@ -110,8 +110,8 @@ void WindowStateStorage::initdb()
110 return;
110 return;
111 }
111 }
112
112
113− if (!m_db.tables().contains("geometry")) {
113+ if (!m_db.tables().contains(QStringLiteral("geometry"))) {
114 QSqlQuery query;
114 QSqlQuery query;
115− query.exec("CREATE TABLE geometry(windowId TEXT UNIQUE, x INTEGER, y INTEGER, width INTEGER, height INTEGER);");
115+ query.exec(QStringLiteral("CREATE TABLE geometry(windowId TEXT UNIQUE, x INTEGER, y INTEGER, width INTEGER, height INTEGER);"));
116 }
116 }
117}
117}
plugins/Wizard/PageList.cpp+3−3
@@ -40,8 +40,8 @@ PageList::PageList(QObject *parent)
40 m_index(-1),
40 m_index(-1),
41 m_pages()
41 m_pages()
42{
42{
43− QString qmlSuffix = ".qml";
43+ QString qmlSuffix = QStringLiteral(".qml");
44− QString disabledSuffix = ".disabled";
44+ QString disabledSuffix = QStringLiteral(".disabled");
45 QSet<QString> disabledPages;
45 QSet<QString> disabledPages;
46 QStringList dataDirs;
46 QStringList dataDirs;
47
47
@@ -53,7 +53,7 @@ PageList::PageList(QObject *parent)
53
53
54 Q_FOREACH(const QString &dataDir, dataDirs) {
54 Q_FOREACH(const QString &dataDir, dataDirs) {
55 QDir dir(dataDir + "/Wizard/Pages");
55 QDir dir(dataDir + "/Wizard/Pages");
56− QStringList entries = dir.entryList(QStringList("[0-9]*"), QDir::Files | QDir::Readable);
56+ QStringList entries = dir.entryList(QStringList(QStringLiteral("[0-9]*")), QDir::Files | QDir::Readable);
57 Q_FOREACH(const QString &entry, entries) {
57 Q_FOREACH(const QString &entry, entries) {
58 if (!m_pages.contains(entry) && entry.endsWith(qmlSuffix))
58 if (!m_pages.contains(entry) && entry.endsWith(qmlSuffix))
59 m_pages.insert(entry, dir.absoluteFilePath(entry));
59 m_pages.insert(entry, dir.absoluteFilePath(entry));
plugins/Wizard/System.cpp+12−12
@@ -42,7 +42,7 @@ System::System()
42QString System::wizardEnabledPath()
42QString System::wizardEnabledPath()
43{
43{
44 // Uses ubuntu-system-settings namespace for historic compatibility reasons
44 // Uses ubuntu-system-settings namespace for historic compatibility reasons
45− return QDir::home().filePath(".config/ubuntu-system-settings/wizard-has-run");
45+ return QDir::home().filePath(QStringLiteral(".config/ubuntu-system-settings/wizard-has-run"));
46}
46}
47
47
48bool System::wizardEnabled() const
48bool System::wizardEnabled() const
@@ -58,7 +58,7 @@ void System::setWizardEnabled(bool enabled)
58 if (enabled) {
58 if (enabled) {
59 QFile::remove(wizardEnabledPath());
59 QFile::remove(wizardEnabledPath());
60 } else {
60 } else {
61− QDir(wizardEnabledPath()).mkpath("..");
61+ QDir(wizardEnabledPath()).mkpath(QStringLiteral(".."));
62 QFile(wizardEnabledPath()).open(QIODevice::WriteOnly);
62 QFile(wizardEnabledPath()).open(QIODevice::WriteOnly);
63 m_fsWatcher.addPath(wizardEnabledPath());
63 m_fsWatcher.addPath(wizardEnabledPath());
64 Q_EMIT wizardEnabledChanged();
64 Q_EMIT wizardEnabledChanged();
@@ -79,10 +79,10 @@ void System::setSessionVariable(const QString &variable, const QString &value)
79 QMap<QString,QString> valueMap;
79 QMap<QString,QString> valueMap;
80 valueMap.insert(variable, value);
80 valueMap.insert(variable, value);
81
81
82− QDBusMessage msg = QDBusMessage::createMethodCall("org.freedesktop.DBus",
82+ QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DBus"),
83− "/org/freedesktop/DBus",
83+ QStringLiteral("/org/freedesktop/DBus"),
84− "org.freedesktop.DBus",
84+ QStringLiteral("org.freedesktop.DBus"),
85− "UpdateActivationEnvironment");
85+ QStringLiteral("UpdateActivationEnvironment"));
86
86
87 msg << QVariant::fromValue(valueMap);
87 msg << QVariant::fromValue(valueMap);
88 QDBusConnection::sessionBus().asyncCall(msg);
88 QDBusConnection::sessionBus().asyncCall(msg);
@@ -90,21 +90,21 @@ void System::setSessionVariable(const QString &variable, const QString &value)
90
90
91void System::updateSessionLanguage(const QString &locale)
91void System::updateSessionLanguage(const QString &locale)
92{
92{
93− const QString language = locale.split(".")[0];
93+ const QString language = locale.split(QStringLiteral("."))[0];
94
94
95− setSessionVariable("LANGUAGE", language);
95+ setSessionVariable(QStringLiteral("LANGUAGE"), language);
96− setSessionVariable("LANG", locale);
96+ setSessionVariable(QStringLiteral("LANG"), locale);
97− setSessionVariable("LC_ALL", locale);
97+ setSessionVariable(QStringLiteral("LC_ALL"), locale);
98
98
99 // QLocale caches the default locale on startup, and Qt uses that cached
99 // QLocale caches the default locale on startup, and Qt uses that cached
100 // copy when formatting dates. So manually update it here.
100 // copy when formatting dates. So manually update it here.
101 QLocale::setDefault(QLocale(locale));
101 QLocale::setDefault(QLocale(locale));
102
102
103 // Restart bits of the session to pick up new language.
103 // Restart bits of the session to pick up new language.
104− QProcess::startDetached("sh -c \"initctl emit indicator-services-end; \
104+ QProcess::startDetached(QStringLiteral("sh -c \"initctl emit indicator-services-end; \
105 initctl stop scope-registry; \
105 initctl stop scope-registry; \
106 initctl stop smart-scopes-proxy; \
106 initctl stop smart-scopes-proxy; \
107 initctl emit --no-wait indicator-services-start; \
107 initctl emit --no-wait indicator-services-start; \
108 initctl restart --no-wait maliit-server; \
108 initctl restart --no-wait maliit-server; \
109− initctl restart --no-wait unity8-dash\"");
109+ initctl restart --no-wait unity8-dash\""));
110}
110}
src/ApplicationArguments.h+2−2
@@ -31,10 +31,10 @@ class ApplicationArguments : public QObject
31public:
31public:
32 ApplicationArguments(QObject *parent = nullptr);
32 ApplicationArguments(QObject *parent = nullptr);
33
33
34− void setDeviceName(QString deviceName) { m_deviceName = deviceName; }
34+ void setDeviceName(const QString &deviceName) { m_deviceName = deviceName; }
35 QString deviceName() const { return m_deviceName; }
35 QString deviceName() const { return m_deviceName; }
36
36
37− void setMode(QString mode) { m_mode = mode; }
37+ void setMode(const QString &mode) { m_mode = mode; }
38 QString mode() const { return m_mode; }
38 QString mode() const { return m_mode; }
39
39
40private:
40private:
src/CachingNetworkManagerFactory.cpp+1−1
@@ -46,7 +46,7 @@ QNetworkAccessManager *CachingNetworkManagerFactory::create(QObject *parent) {
46 QNetworkAccessManager *manager = new CachingNetworkAccessManager(parent);
46 QNetworkAccessManager *manager = new CachingNetworkAccessManager(parent);
47
47
48 QNetworkDiskCache* cache = new QNetworkDiskCache(manager);
48 QNetworkDiskCache* cache = new QNetworkDiskCache(manager);
49− cache->setCacheDirectory(QString("%1/network").arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)));
49+ cache->setCacheDirectory(QStringLiteral("%1/network").arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)));
50
50
51 manager->setCache(cache);
51 manager->setCache(cache);
52 return manager;
52 return manager;
src/Dash/main.cpp+10−10
@@ -36,20 +36,20 @@ int main(int argc, const char *argv[])
36 QGuiApplication *application = new QGuiApplication(argc, (char**)argv);
36 QGuiApplication *application = new QGuiApplication(argc, (char**)argv);
37
37
38 QCommandLineParser parser;
38 QCommandLineParser parser;
39− parser.setApplicationDescription("Description: Unity 8 Shell Dash");
39+ parser.setApplicationDescription(QStringLiteral("Description: Unity 8 Shell Dash"));
40 parser.addHelpOption();
40 parser.addHelpOption();
41
41
42− QCommandLineOption mousetouchOption("mousetouch",
42+ QCommandLineOption mousetouchOption(QStringLiteral("mousetouch"),
43− "Allow the mouse to provide touch input");
43+ QStringLiteral("Allow the mouse to provide touch input"));
44 parser.addOption(mousetouchOption);
44 parser.addOption(mousetouchOption);
45
45
46− QCommandLineOption windowGeometryOption(QStringList() << "windowgeometry",
46+ QCommandLineOption windowGeometryOption(QStringList() << QStringLiteral("windowgeometry"),
47− "Specify the window geometry as [<width>x<height>]", "windowgeometry", "1");
47+ QStringLiteral("Specify the window geometry as [<width>x<height>]"), QStringLiteral("windowgeometry"), QStringLiteral("1"));
48 parser.addOption(windowGeometryOption);
48 parser.addOption(windowGeometryOption);
49
49
50 // FIXME Remove once we drop the need of the hint
50 // FIXME Remove once we drop the need of the hint
51− QCommandLineOption desktopFileHintOption("desktop_file_hint",
51+ QCommandLineOption desktopFileHintOption(QStringLiteral("desktop_file_hint"),
52− "The desktop_file_hint option for QtMir", "hint_file");
52+ QStringLiteral("The desktop_file_hint option for QtMir"), QStringLiteral("hint_file"));
53 parser.addOption(desktopFileHintOption);
53 parser.addOption(desktopFileHintOption);
54
54
55 // Treat args with single dashes the same as arguments with two dashes
55 // Treat args with single dashes the same as arguments with two dashes
@@ -60,7 +60,7 @@ int main(int argc, const char *argv[])
60 ApplicationArguments qmlArgs;
60 ApplicationArguments qmlArgs;
61
61
62 if (getenv("QT_LOAD_TESTABILITY")) {
62 if (getenv("QT_LOAD_TESTABILITY")) {
63− QLibrary testLib(QLatin1String("qttestability"));
63+ QLibrary testLib(QStringLiteral("qttestability"));
64 if (testLib.load()) {
64 if (testLib.load()) {
65 typedef void (*TasInitialize)(void);
65 typedef void (*TasInitialize)(void);
66 TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");
66 TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");
@@ -91,8 +91,8 @@ int main(int argc, const char *argv[])
91 }
91 }
92 }
92 }
93
93
94− view->setTitle("Scopes");
94+ view->setTitle(QStringLiteral("Scopes"));
95− view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
95+ view->rootContext()->setContextProperty(QStringLiteral("applicationArguments"), &qmlArgs);
96
96
97 // You will need this if you want to interact with touch-only components using a mouse
97 // You will need this if you want to interact with touch-only components using a mouse
98 // Needed only when manually testing on a desktop.
98 // Needed only when manually testing on a desktop.
src/Panel/Indicators/client/indicatorsclient.cpp+7−7
@@ -40,16 +40,16 @@ IndicatorsClient::IndicatorsClient(int &argc, char **argv)
40 prependImportPaths(m_view->engine(), ::overrideImportPaths());
40 prependImportPaths(m_view->engine(), ::overrideImportPaths());
41 appendImportPaths(m_view->engine(), ::fallbackImportPaths());
41 appendImportPaths(m_view->engine(), ::fallbackImportPaths());
42
42
43− QString profile = "phone";
43+ QString profile = QStringLiteral("phone");
44− if (args.contains(QLatin1String("-profile")) && args.size() > args.indexOf(QLatin1String("-profile")) + 1) {
44+ if (args.contains(QStringLiteral("-profile")) && args.size() > args.indexOf(QStringLiteral("-profile")) + 1) {
45− profile = args.at(args.indexOf(QLatin1String("-profile")) + 1);
45+ profile = args.at(args.indexOf(QStringLiteral("-profile")) + 1);
46 }
46 }
47− m_view->rootContext()->setContextProperty("indicatorProfile", profile);
47+ m_view->rootContext()->setContextProperty(QStringLiteral("indicatorProfile"), profile);
48
48
49− m_view->setSource(QUrl("IndicatorsClient.qml"));
49+ m_view->setSource(QUrl(QStringLiteral("IndicatorsClient.qml")));
50 m_view->setResizeMode(QQuickView::SizeRootObjectToView);
50 m_view->setResizeMode(QQuickView::SizeRootObjectToView);
51− if (args.contains(QLatin1String("-windowgeometry")) && args.size() > args.indexOf(QLatin1String("-windowgeometry")) + 1) {
51+ if (args.contains(QStringLiteral("-windowgeometry")) && args.size() > args.indexOf(QStringLiteral("-windowgeometry")) + 1) {
52− QStringList geometryArg = args.at(args.indexOf(QLatin1String("-windowgeometry")) + 1).split('x');
52+ QStringList geometryArg = args.at(args.indexOf(QStringLiteral("-windowgeometry")) + 1).split('x');
53 if (geometryArg.size() == 2) {
53 if (geometryArg.size() == 2) {
54 m_view->resize(geometryArg.at(0).toInt(), geometryArg.at(1).toInt());
54 m_view->resize(geometryArg.at(0).toInt(), geometryArg.at(1).toInt());
55 }
55 }
src/UnityCommandLineParser.cpp+25−24
@@ -26,36 +26,36 @@ UnityCommandLineParser::UnityCommandLineParser(const QCoreApplication &app)
26 m_gridUnit = getenvFloat(ENV_GRID_UNIT_PX, DEFAULT_GRID_UNIT_PX);
26 m_gridUnit = getenvFloat(ENV_GRID_UNIT_PX, DEFAULT_GRID_UNIT_PX);
27
27
28 QCommandLineParser parser;
28 QCommandLineParser parser;
29− parser.setApplicationDescription("Description: Unity 8 Shell");
29+ parser.setApplicationDescription(QStringLiteral("Description: Unity 8 Shell"));
30 parser.addHelpOption();
30 parser.addHelpOption();
31
31
32− QCommandLineOption fullscreenOption("fullscreen",
32+ QCommandLineOption fullscreenOption(QStringLiteral("fullscreen"),
33− "Run in fullscreen");
33+ QStringLiteral("Run in fullscreen"));
34 parser.addOption(fullscreenOption);
34 parser.addOption(fullscreenOption);
35
35
36− QCommandLineOption framelessOption("frameless",
36+ QCommandLineOption framelessOption(QStringLiteral("frameless"),
37− "Run without window borders");
37+ QStringLiteral("Run without window borders"));
38 parser.addOption(framelessOption);
38 parser.addOption(framelessOption);
39
39
40− QCommandLineOption mousetouchOption("mousetouch",
40+ QCommandLineOption mousetouchOption(QStringLiteral("mousetouch"),
41− "Allow the mouse to provide touch input");
41+ QStringLiteral("Allow the mouse to provide touch input"));
42 parser.addOption(mousetouchOption);
42 parser.addOption(mousetouchOption);
43
43
44− QCommandLineOption windowGeometryOption(QStringList() << "windowgeometry",
44+ QCommandLineOption windowGeometryOption(QStringList() << QStringLiteral("windowgeometry"),
45− "Specify the window geometry as [<width>x<height>]", "windowgeometry", "1");
45+ QStringLiteral("Specify the window geometry as [<width>x<height>]"), QStringLiteral("windowgeometry"), QStringLiteral("1"));
46 parser.addOption(windowGeometryOption);
46 parser.addOption(windowGeometryOption);
47
47
48− QCommandLineOption testabilityOption("testability",
48+ QCommandLineOption testabilityOption(QStringLiteral("testability"),
49− "DISCOURAGED: Please set QT_LOAD_TESTABILITY instead.\nLoad the testability driver");
49+ QStringLiteral("DISCOURAGED: Please set QT_LOAD_TESTABILITY instead.\nLoad the testability driver"));
50 parser.addOption(testabilityOption);
50 parser.addOption(testabilityOption);
51
51
52− QCommandLineOption devicenameOption(QStringList() << "devicename",
52+ QCommandLineOption devicenameOption(QStringList() << QStringLiteral("devicename"),
53− "Specify the device name instead of letting Unity 8 find it out", "devicename", "");
53+ QStringLiteral("Specify the device name instead of letting Unity 8 find it out"), QStringLiteral("devicename"), QLatin1String(""));
54 parser.addOption(devicenameOption);
54 parser.addOption(devicenameOption);
55
55
56− QCommandLineOption modeOption("mode",
56+ QCommandLineOption modeOption(QStringLiteral("mode"),
57− "Whether to run greeter and/or shell [full-greeter, full-shell, greeter, shell]",
57+ QStringLiteral("Whether to run greeter and/or shell [full-greeter, full-shell, greeter, shell]"),
58− "mode", "full-greeter");
58+ QStringLiteral("mode"), QStringLiteral("full-greeter"));
59 parser.addOption(modeOption);
59 parser.addOption(modeOption);
60
60
61 // Treat args with single dashes the same as arguments with two dashes
61 // Treat args with single dashes the same as arguments with two dashes
@@ -83,7 +83,7 @@ UnityCommandLineParser::UnityCommandLineParser(const QCoreApplication &app)
83
83
84int UnityCommandLineParser::parsePixelsValue(const QString &str)
84int UnityCommandLineParser::parsePixelsValue(const QString &str)
85{
85{
86− if (str.endsWith("gu", Qt::CaseInsensitive)) {
86+ if (str.endsWith(QLatin1String("gu"), Qt::CaseInsensitive)) {
87 QString numStr = str;
87 QString numStr = str;
88 numStr.remove(numStr.size() - 2, 2);
88 numStr.remove(numStr.size() - 2, 2);
89 return numStr.toInt() * m_gridUnit;
89 return numStr.toInt() * m_gridUnit;
@@ -105,13 +105,14 @@ void UnityCommandLineParser::resolveMode(QCommandLineParser &parser, QCommandLin
105 // If an invalid option was specified, set it to the default
105 // If an invalid option was specified, set it to the default
106 // If no default was provided in the QCommandLineOption constructor, abort.
106 // If no default was provided in the QCommandLineOption constructor, abort.
107 if (!parser.isSet(modeOption) ||
107 if (!parser.isSet(modeOption) ||
108− (parser.value(modeOption) != "full-greeter" &&
108+ (parser.value(modeOption) != QLatin1String("full-greeter") &&
109− parser.value(modeOption) != "full-shell" &&
109+ parser.value(modeOption) != QLatin1String("full-shell") &&
110− parser.value(modeOption) != "greeter" &&
110+ parser.value(modeOption) != QLatin1String("greeter") &&
111− parser.value(modeOption) != "shell")) {
111+ parser.value(modeOption) != QLatin1String("shell"))) {
112−
112+
113+ const QStringList defaultValues = modeOption.defaultValues();
113− if (modeOption.defaultValues().first() != nullptr) {
114+ if (!defaultValues.isEmpty()) {
114− m_mode = modeOption.defaultValues().first();
115+ m_mode = defaultValues.first();
115 qWarning() << "Mode argument was not provided or was set to an illegal value."
116 qWarning() << "Mode argument was not provided or was set to an illegal value."
116 " Using default value of --mode=" << m_mode;
117 " Using default value of --mode=" << m_mode;
117 } else {
118 } else {
src/libunity8-private/unitydbusobject.cpp+2−2
@@ -64,8 +64,8 @@ void UnityDBusObject::notifyPropertyChanged(const QString& propertyName, const Q
64 changedProps.insert(propertyName, value);
64 changedProps.insert(propertyName, value);
65
65
66 message = QDBusMessage::createSignal(path(),
66 message = QDBusMessage::createSignal(path(),
67− "org.freedesktop.DBus.Properties",
67+ QStringLiteral("org.freedesktop.DBus.Properties"),
68− "PropertiesChanged");
68+ QStringLiteral("PropertiesChanged"));
69 message << interface;
69 message << interface;
70 message << changedProps;
70 message << changedProps;
71 message << QStringList();
71 message << QStringList();
src/libunity8-private/unitydbusvirtualobject.cpp+2−2
@@ -61,8 +61,8 @@ void UnityDBusVirtualObject::notifyPropertyChanged(const QString& interface, con
61 changedProps.insert(propertyName, value);
61 changedProps.insert(propertyName, value);
62
62
63 message = QDBusMessage::createSignal(path() + "/" + node,
63 message = QDBusMessage::createSignal(path() + "/" + node,
64− "org.freedesktop.DBus.Properties",
64+ QStringLiteral("org.freedesktop.DBus.Properties"),
65− "PropertiesChanged");
65+ QStringLiteral("PropertiesChanged"));
66 message << interface;
66 message << interface;
67 message << changedProps;
67 message << changedProps;
68 message << QStringList();
68 message << QStringList();
src/main.cpp+4−4
@@ -43,7 +43,7 @@ int main(int argc, const char *argv[])
43 isMirServer = true;
43 isMirServer = true;
44 }
44 }
45
45
46− QGuiApplication::setApplicationName("unity8");
46+ QGuiApplication::setApplicationName(QStringLiteral("unity8"));
47 QGuiApplication *application;
47 QGuiApplication *application;
48
48
49 application = new QGuiApplication(argc, (char**)argv);
49 application = new QGuiApplication(argc, (char**)argv);
@@ -65,7 +65,7 @@ int main(int argc, const char *argv[])
65 // The testability driver is only loaded by QApplication but not by QGuiApplication.
65 // The testability driver is only loaded by QApplication but not by QGuiApplication.
66 // However, QApplication depends on QWidget which would add some unneeded overhead => Let's load the testability driver on our own.
66 // However, QApplication depends on QWidget which would add some unneeded overhead => Let's load the testability driver on our own.
67 if (parser.hasTestability() || getenv("QT_LOAD_TESTABILITY")) {
67 if (parser.hasTestability() || getenv("QT_LOAD_TESTABILITY")) {
68− QLibrary testLib(QLatin1String("qttestability"));
68+ QLibrary testLib(QStringLiteral("qttestability"));
69 if (testLib.load()) {
69 if (testLib.load()) {
70 typedef void (*TasInitialize)(void);
70 typedef void (*TasInitialize)(void);
71 TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");
71 TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");
@@ -85,7 +85,7 @@ int main(int argc, const char *argv[])
85 QQuickView* view = new QQuickView();
85 QQuickView* view = new QQuickView();
86 view->setResizeMode(QQuickView::SizeRootObjectToView);
86 view->setResizeMode(QQuickView::SizeRootObjectToView);
87 view->setColor("black");
87 view->setColor("black");
88− view->setTitle("Unity8 Shell");
88+ view->setTitle(QStringLiteral("Unity8 Shell"));
89
89
90 if (parser.windowGeometry().isValid()) {
90 if (parser.windowGeometry().isValid()) {
91 view->setWidth(parser.windowGeometry().width());
91 view->setWidth(parser.windowGeometry().width());
@@ -93,7 +93,7 @@ int main(int argc, const char *argv[])
93 }
93 }
94
94
95 view->engine()->setBaseUrl(QUrl::fromLocalFile(::qmlDirectory()));
95 view->engine()->setBaseUrl(QUrl::fromLocalFile(::qmlDirectory()));
96− view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
96+ view->rootContext()->setContextProperty(QStringLiteral("applicationArguments"), &qmlArgs);
97 if (parser.hasFrameless()) {
97 if (parser.hasFrameless()) {
98 view->setFlags(Qt::FramelessWindowHint);
98 view->setFlags(Qt::FramelessWindowHint);
99 }
99 }