on xenial help sign in
Fixed qml warnings in 'make tryShell'

Approved by: Mirco Müller

commitae9d424c680beb2dd91ff97e79e7af9060cd2221 authorNick Dedekind <nick.dedekind@canonical.com> dateFri 17 Jul 2015, 15:52 (11 years ago) parent79200fce1060d2
6 files changed+11−9
qml/Launcher/LauncherPanel.qml+4−3 qml/Notifications/Notifications.qml+1−1 qml/Panel/IndicatorItem.qml+1−1 qml/Panel/Indicators/IndicatorBase.qml−1 tests/mocks/QMenuModel/QDBusActionGroup.qml+2−2 tests/mocks/QMenuModel/actiondata.h+3−1
qml/Launcher/LauncherPanel.qml+4−3
@@ -521,7 +521,7 @@ Rectangle {
521521 Image {
522522 anchors {
523523 left: parent.left
524− leftMargin: (quickList.item.width - units.gu(1)) / 2 - width / 2
524+ leftMargin: quickList.item ? (quickList.item.width - units.gu(1)) / 2 - width / 2 : 0
525525 verticalCenter: parent.verticalCenter
526526 verticalCenterOffset: (parent.height / 2 + units.dp(3)) * (quickList.offset > 0 ? 1 : -1) * (root.inverted ? 1 : -1)
527527 }
@@ -564,9 +564,10 @@ Rectangle {
564564
565565 // internal
566566 property int itemCenter: item ? root.mapFromItem(quickList.item).y + (item.height / 2) : units.gu(1)
567− property int offset: itemCenter + (item.height/2) + height + units.gu(1) > parent.height ?
567+ property int offset: item ? itemCenter + (item.height/2) + height + units.gu(1) > parent.height ?
568568 -(item.height/2) - height - units.gu(.5) :
569− (item.height/2) + units.gu(.5)
569+ (item.height/2) + units.gu(.5) :
570+ 0
570571
571572 Column {
572573 id: quickListColumn
qml/Notifications/Notifications.qml+1−1
@@ -33,7 +33,7 @@ ListView {
3333 id: snapDecisionProxyModel
3434 objectName: "snapDecisionProxyModel"
3535
36− model: notificationList.model
36+ model: notificationList.model ? notificationList.model : null
3737 filterRole: UnityNotifications.ModelInterface != undefined ? UnityNotifications.ModelInterface.RoleType : 0
3838 filterRegExp: RegExp(UnityNotifications.Notification.SnapDecision)
3939 }
qml/Panel/IndicatorItem.qml+1−1
@@ -234,7 +234,7 @@ IndicatorDelegate {
234234 ]
235235 }
236236
237− onRootActionStateChanged: {
237+ rootActionState.onUpdated: {
238238 if (rootActionState == undefined) {
239239 title = "";
240240 leftLabel = "";
qml/Panel/Indicators/IndicatorBase.qml−1
@@ -43,6 +43,5 @@ Item {
4343 ModelActionRootState {
4444 id: rootAction
4545 menu: menuModel ? menuModel : null
46− onUpdated: indicatorItem.rootActionStateChanged()
4746 }
4847}
tests/mocks/QMenuModel/QDBusActionGroup.qml+2−2
@@ -41,8 +41,8 @@ QtObject {
4141 signal activated
4242
4343 property string actionName: \"" + actionName + "\"
44− property bool valid: ActionData.data[actionName] != undefined ? ActionData.data[actionName].valid : false
45− property var state: ActionData.data[actionName] != undefined ? ActionData.data[actionName].state : undefined
44+ property bool valid: ActionData.data.hasOwnProperty(actionName) ? ActionData.data[actionName].valid : false
45+ property var state: ActionData.data.hasOwnProperty(actionName) ? ActionData.data[actionName].state : undefined
4646
4747 function activate() {
4848 activated();
tests/mocks/QMenuModel/actiondata.h+3−1
@@ -31,7 +31,9 @@ class Q_DECL_EXPORT ActionData : public QObject
3131public:
3232 ActionData(QObject* parent = 0)
3333 : QObject(parent)
34− {}
34+ , m_data(QVariantMap())
35+ {
36+ }
3537
3638 QVariant data() const { return m_data; }
3739 void setData(const QVariant& data)