fix(warnings): Rid off warnings

Fixes: #8293
This commit is contained in:
Boris Melnik 2022-12-14 18:40:00 +03:00
parent 0ff0047167
commit f35468963c
12 changed files with 66 additions and 55 deletions

View File

@ -62,7 +62,7 @@ Item {
ringPxSize: 1.5
}
visible: settings.ringSpecModel !== undefined
visible: settings && settings.ringSpecModel !== undefined
Loader {
anchors.fill: parent

View File

@ -38,29 +38,29 @@ MenuItem {
readonly property int letterSize: 11
//icon
readonly property string name: d.originalAssetSettings.name
readonly property url source: d.originalAssetSettings.source
readonly property real width: d.originalAssetSettings.width
readonly property real height: d.originalAssetSettings.height
readonly property color color: d.originalAssetSettings.color
readonly property color hoverColor: d.originalAssetSettings.hoverColor
readonly property color disabledColor: d.originalAssetSettings.disabledColor
readonly property int rotation: d.originalAssetSettings.rotation
readonly property bool isLetterIdenticon: d.originalAssetSettings.isLetterIdenticon
readonly property int charactersLen: d.originalAssetSettings.charactersLen
readonly property string emoji: d.originalAssetSettings.emoji
readonly property string emojiSize: d.originalAssetSettings.emojiSize
readonly property string name: d.originalAssetSettings ? d.originalAssetSettings.name : d.defaultAssetSettings.name
readonly property url source: d.originalAssetSettings ? d.originalAssetSettings.source : d.defaultAssetSettings.source
readonly property real width: d.originalAssetSettings ? d.originalAssetSettings.width : d.defaultAssetSettings.width
readonly property real height: d.originalAssetSettings ? d.originalAssetSettings.height : d.defaultAssetSettings.height
readonly property color color: d.originalAssetSettings ? d.originalAssetSettings.color : d.defaultAssetSettings.color
readonly property color hoverColor: d.originalAssetSettings ? d.originalAssetSettings.hoverColor : d.defaultAssetSettings.hoverColor
readonly property color disabledColor: d.originalAssetSettings ? d.originalAssetSettings.disabledColor : d.defaultAssetSettings.disabledColor
readonly property int rotation: d.originalAssetSettings ? d.originalAssetSettings.rotation : d.defaultAssetSettings.rotation
readonly property bool isLetterIdenticon: d.originalAssetSettings ? d.originalAssetSettings.isLetterIdenticon : d.defaultAssetSettings.isLetterIdenticon
readonly property int charactersLen: d.originalAssetSettings ? d.originalAssetSettings.charactersLen : d.defaultAssetSettings.charactersLen
readonly property string emoji: d.originalAssetSettings ? d.originalAssetSettings.emoji : d.defaultAssetSettings.emoji
readonly property string emojiSize: d.originalAssetSettings ? d.originalAssetSettings.emojiSize : d.defaultAssetSettings.emojiSize
//icon b
readonly property real bgWidth: d.originalAssetSettings.bgWidth
readonly property real bgHeight: d.originalAssetSettings.bgHeight
readonly property int bgRadius: d.originalAssetSettings.bgRadius
readonly property color bgColor: d.originalAssetSettings.bgColor
readonly property real bgWidth: d.originalAssetSettings ? d.originalAssetSettings.bgWidth : d.defaultAssetSettings.bgWidth
readonly property real bgHeight: d.originalAssetSettings ? d.originalAssetSettings.bgHeight : d.defaultAssetSettings.bgHeight
readonly property int bgRadius: d.originalAssetSettings ? d.originalAssetSettings.bgRadius : d.defaultAssetSettings.bgRadius
readonly property color bgColor: d.originalAssetSettings ? d.originalAssetSettings.bgColor : d.defaultAssetSettings.bgColor
//image
readonly property bool isImage: d.originalAssetSettings.isImage
readonly property int imgStatus: d.originalAssetSettings.imgStatus
readonly property bool imgIsIdenticon: d.originalAssetSettings.imgIsIdenticon
readonly property bool isImage: d.originalAssetSettings ? d.originalAssetSettings.isImage : d.defaultAssetSettings.isImage
readonly property int imgStatus: d.originalAssetSettings ? d.originalAssetSettings.imgStatus : d.defaultAssetSettings.imgStatus
readonly property bool imgIsIdenticon: d.originalAssetSettings ? d.originalAssetSettings.imgIsIdenticon : d.defaultAssetSettings.imgIsIdenticon
}
readonly property StatusFontSettings fontSettings: d.isStatusSubMenu
@ -132,9 +132,9 @@ MenuItem {
color: !root.enabled ? Theme.palette.baseColor1
: d.isStatusDangerAction ? Theme.palette.dangerColor1 : Theme.palette.directColor1
font.pixelSize: d.fontSettings.pixelSize
font.bold: d.fontSettings.bold
font.italic: d.fontSettings.italic
font.pixelSize: d.fontSettings ? d.fontSettings.pixelSize : d.defaultFontSettings.pixelSize
font.bold: d.fontSettings ? d.fontSettings.bold : d.defaultFontSettings.bold
font.italic: d.fontSettings ? d.fontSettings.italic : d.defaultFontSettings.italic
elide: Text.ElideRight
}

View File

@ -72,7 +72,7 @@ StatusMenu {
assetSettings.name: !!model.imageSource ? !!model.imageSource : model.iconName
assetSettings.isImage: !!model.imageSource
assetSettings.isLetterIdenticon: !model.imageSource && !model.iconName
assetSettings.imgIsIdenticon: model.isIdenticon
assetSettings.imgIsIdenticon: false
onTriggered: {
root.resetSearchSelection()
root.setSearchSelection(text,
@ -96,13 +96,13 @@ StatusMenu {
readonly property string parentIconName: model.iconName
readonly property string parentImageSource: model.imageSource
readonly property string parentIdenticonColor: !!model.iconColor ? model.iconColor : defaultIconColor
readonly property bool parentIsIdenticon: model.isIdenticon
readonly property bool parentIsIdenticon: false
title: model.title
assetSettings.name: !!model.iconName ? model.iconName : model.imageSource
assetSettings.color: !!model.iconColor ? model.iconColor : defaultIconColor
assetSettings.isImage: !!model.imageSource
assetSettings.imgIsIdenticon: model.isIdenticon
assetSettings.imgIsIdenticon: false
assetSettings.isLetterIdenticon: !model.imageSource && !model.iconName
StatusMenuInstantiator {
@ -134,7 +134,7 @@ StatusMenu {
root.setSearchSelection(model.text,
"",
model.imageSource,
model.isIdenticon,
false,
model.iconName,
model.iconColor,
model.isUserIcon,

View File

@ -17,7 +17,7 @@ Rectangle {
signal addMembersClicked()
signal addCategoriesClicked()
height: childrenRect.height + Style.current.padding
implicitHeight: childrenRect.height + Style.current.padding
anchors.left: parent.left
anchors.leftMargin: Style.current.padding
anchors.right: parent.right

View File

@ -1,30 +1,36 @@
import QtQuick 2.12
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.14
import QtQml.Models 2.14
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Core.Utils 0.1
import StatusQ.Controls 0.1
import StatusQ.Popups 0.1
import StatusQ.Popups.Dialog 0.1
import utils 1.0
import shared.controls 1.0
import shared 1.0
StatusModal {
StatusDialog {
id: root
property string privateKey
property var store
header.title: qsTr("Transfer ownership")
padding: 16
title: qsTr("Transfer ownership")
padding: Style.current.padding
width: 480
ColumnLayout {
anchors.fill: parent
id: layout
anchors.left: parent.left
anchors.right: parent.right
spacing: 16
spacing: Style.current.padding
StatusInput {
id: pKeyInput
@ -75,12 +81,14 @@ StatusModal {
}
}
leftButtons: [
StatusBackButton {
onClicked: {
root.close()
footer: StatusDialogFooter {
leftButtons: ObjectModel {
StatusBackButton {
onClicked: {
root.close()
}
}
}
]
}
}

View File

@ -239,8 +239,8 @@ Item {
// }
Connections {
target: chatLogView.model
onDataChanged: {
target: chatLogView.model || null
function onDataChanged(topLeft, bottomRight, roles) {
if (roles.indexOf(Constants.messageModelRoles.responseToMessageWithId) !== -1) {
let item = chatLogView.itemAtIndex(topLeft.row)
if (item) {
@ -249,7 +249,7 @@ Item {
}
}
onReplyDeleted: {
function onReplyDeleted(messageIndex) {
let item = chatLogView.itemAtIndex(messageIndex)
if (item) {
item.replyDeleted()

View File

@ -218,6 +218,7 @@ Item {
width: parent.width
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
contentWidth: communityChatListAndCategories.implicitWidth
contentHeight: communityChatListAndCategories.height
+ bannerColumn.height
+ Style.current.bigPadding

View File

@ -45,12 +45,17 @@ StatusSectionLayout {
readonly property string filteredSelectedTags: {
if (!community || !community.tags)
return "";
const json = JSON.parse(community.tags);
const tagsArray = json.map(tag => {
return tag.name;
});
return JSON.stringify(tagsArray);
try {
const json = JSON.parse(community.tags);
const tagsArray = json.map(tag => {
return tag.name;
});
return JSON.stringify(tagsArray);
}
catch (e) {
console.warn("Error parsing community tags: ", community.tags, " error: ", e.message)
return ""
}
}
signal backToCommunityClicked

View File

@ -73,7 +73,7 @@ StatusScrollView {
name: model.name
description: model.description
members: model.members
activeUsers: model.activeMembers
activeUsers: model.activeMembers ? model.activeMembers : 0
popularity: model.popularity
categories: tagsJson.model

View File

@ -73,12 +73,6 @@ SettingsContentBase {
onDestroyKeycardSharedModuleFlow: {
keycardPopup.active = false
}
onKeycardUidChanged: {
if (d.observedKeycardUid === oldKcUid) {
d.observedKeycardUid = newKcUid
}
}
}
Loader {

View File

@ -100,7 +100,8 @@ ColumnLayout {
}
StatusListItem {
visible: root.keycardStore.keycardModule.keycardDetailsModel.anyOfItemsLocked
visible: typeof root.keycardStore.keycardModule.keycardDetailsModel !== "undefined"
&& root.keycardStore.keycardModule.keycardDetailsModel.anyOfItemsLocked
Layout.fillWidth: true
title: qsTr("Unlock Keycard")
components: [

View File

@ -1181,6 +1181,8 @@ Rectangle {
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
padding: 0
contentWidth: availableWidth
contentHeight: messageInputField.implicitHeight
TextArea {
id: messageInputField