~cimi/unity8/sdk1.3_newUbuntuShape

« back to all changes in this revision

Viewing changes to plugins/Unity/Indicators/rootstateparser.cpp

  • Committer: Andrea Cimitan
  • Date: 2015-10-23 10:05:59 UTC
  • mfrom: (1821.1.36 use_sdk_13)
  • Revision ID: andrea.cimitan@gmail.com-20151023100559-fi60ots87umsplq1
[ CI Train Bot ]
* New rebuild forced.
[ Pawel Stolowski ]
* Store unity8 package version in /var/lib/.../version file for fast
  retrieval from the shell plugin.
[ Lukáš Tinkl ]
* Revert to using plaintext instead of HTML-like markup for the
  notifications (LP: #1504256)
[ CI Train Bot ]
* Resync trunk.
[ Lukáš Tinkl ]
* Wizard: skip the reporting page if the system is configured not to
  report crashes (LP: #1494442)
[ Alexandros Frantzis ]
* Use power state change reason SnapDecision to turn screen on when a
  SnapDecision arrives (LP: #1291455)
[ CI Train Bot ]
* New rebuild forced.
[ Albert Astals Cid ]
* Make Launcher::test_quickListMenuOnRMB stable (LP: #1500359)
[ CI Train Bot ]
* New rebuild forced.
[ Michael Zanetti ]
* Stabilize Launcher DND test
[ Albert Astals Cid ]
* Improvements from running clazy over the code
[ Daniel d'Andrada ]
* PhoneStage: ensure you're left in a consistent state after being
  reset (LP: #1476757)
[ Lukáš Tinkl ]
* Improve the appearance and functionality of datetime and session
  indicators in Unity8 desktop.
* Using InputInfo, determine if we need swipe or click to dismiss the
  notifications (e.g. incoming phone call)
[ Michael Zanetti ]
* further development on the Desktop Spread (LP: #1488147)
[ Michał Sawicz ]
* Bump application API version
* Skip bluetooth check under wily, use expectFailure to notice when
  it's back
[ Richard Somlói ]
* Fix translator comments in time formatter
[ Albert Astals Cid ]
* Adapt test to code changes
* Add DEP-8 test for all our UI and unit tests
* Keep the PreviewStack around to avoid mem leaks (LP: #1495467)
[ CI Train Bot ]
* Resync trunk.
[ Michael Terry ]
* When libusermetrics gives us an empty string, still show the
  infographic circle rather than hiding it.  This is a follow-on to a
  branch [1] that changes the "no data available" label to the empty
  string.
[ Michał Sawicz ]
* Add DEP-8 test for all our UI and unit tests
* Fix integrated LightDM path
* Resync trunk
[ Albert Astals Cid ]
* Fix testNotifications
* Make the wait longer to make tests pass in CI
* New simplified CroppedImageMinimumSourceSize (LP: #1467740)
* Stop animateTimer when starting the fadeOutAnimation
* Use  AlreadyLaunchedUpstart so that tests passes
* Workaround keyboard issues and make test pass again
[ Daniel d'Andrada ]
* DesktopStage: Refactor focus handling
* Stabilize tstShell.test_launchedAppHasActiveFocus
[ Gary.Wzl ]
* Add widgetData["expanded"] property for expandable widget.
[ Michael Terry ]
* Fix typo that caused the tutorial to tease the launcher on top of
  the greeter.
* Fix typo that caused the tutorial to tease the launcher on top of
  the greeter.
[ Michal Sawicz ]
* Resync wily with vivid
[ Albert Astals Cid ]
* Accomodate header height when using a card carousel with non
  overlayed header (LP: #1489309)
* Fix restart unity8 from inside the phone more than two times (LP:
  #1487946)
[ Gary.Wzl ]
* Move textarea up automatically when inputmethod popup. (LP:
  #1485947)
[ Lukáš Tinkl ]
* Introduce a GlobalShortcut QML component for handling global
  keyboard shortcuts
[ Michael Terry ]
* Fix the fact that a user that is locked out from their account for
  five minutes after entering too many wrong passwords can simply
  reboot to try again. (LP: #1383086)
* Fix the fact that a user that is locked out from their account for
  five minutes after entering too many wrong passwords can simply
  reboot to try again. (LP: #1383086)
[ Michael Zanetti ]
* Implement progressive autoscrolling in desktop spread
* add an animation transition when invoking the spread by hitting the
  right edge
[ Michael Zanetti ]
* release for wily
[ CI Train Bot ]
* New rebuild forced.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        }
40
40
 
41
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
45
    else if (G_IS_FILE_ICON (icon)) {
63
63
        data = g_bytes_get_data (g_bytes_icon_get_bytes (G_BYTES_ICON (icon)), &size);
64
64
        base64 = g_base64_encode ((const guchar *) data, size);
65
65
 
66
 
        uri = QString("data://");
 
66
        uri = QStringLiteral("data://");
67
67
        uri.append (base64);
68
68
 
69
69
        g_free (base64);
88
88
        while (g_variant_iter_loop (&iter, "{sv}", &key, &vvalue))
89
89
        {
90
90
            QString str = QString::fromUtf8(key);
91
 
            if (str == "icon" && !qmap.contains("icons")) {
 
91
            if (str == QLatin1String("icon") && !qmap.contains(QStringLiteral("icons"))) {
92
92
                QStringList icons;
93
93
 
94
94
                // FIXME - should be sending a url.
97
97
                    icons << iconUri(gicon);
98
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
104
                QStringList icons;
105
105
 
118
118
                    }
119
119
                }
120
120
                // will overwrite icon.
121
 
                qmap.insert("icons", icons);
 
121
                qmap.insert(QStringLiteral("icons"), icons);
122
122
 
123
123
            } else {
124
124
                qmap.insert(str, ActionStateParser::toQVariant(vvalue));
141
141
                                       &accessible_name,
142
142
                                       &visible);
143
143
 
144
 
        qmap["label"] = label ? QString::fromUtf8(label) : "";
145
 
        qmap["accessible-desc"] = accessible_name ? QString::fromUtf8(accessible_name) : "";
146
 
        qmap["visible"] = visible;
 
144
        qmap[QStringLiteral("label")] = label ? QString::fromUtf8(label) : QLatin1String("");
 
145
        qmap[QStringLiteral("accessible-desc")] = accessible_name ? QString::fromUtf8(accessible_name) : QLatin1String("");
 
146
        qmap[QStringLiteral("visible")] = visible;
147
147
 
148
148
        gicon = g_icon_new_for_string (icon, nullptr);
149
149
        if (gicon) {
150
 
            qmap["icons"] = QStringList() << iconUri(gicon);
 
150
            qmap[QStringLiteral("icons")] = QStringList() << iconUri(gicon);
151
151
            g_object_unref (gicon);
152
152
        }
153
153
 
170
170
{
171
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
 
176
176
QString RootStateObject::leftLabel() const
177
177
{
178
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
 
183
183
QString RootStateObject::rightLabel() const
184
184
{
185
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
 
190
190
QStringList RootStateObject::icons() const
191
191
{
192
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
 
197
197
QString RootStateObject::accessibleName() const
198
198
{
199
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
 
204
204
bool RootStateObject::indicatorVisible() const
205
205
{
206
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
 
211
211
void RootStateObject::setCurrentState(const QVariantMap& newState)