Skip to content

Commit db9b827

Browse files
committed
Fix regression for HLL support
1 parent 04585b2 commit db9b827

3 files changed

Lines changed: 19 additions & 25 deletions

File tree

src/qml/value-editor/ValueTableActions.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ ColumnLayout {
5454
source: keyTab.keyModel ? Editor.getEditorByTypeString(keyType) : ""
5555

5656
onLoaded: {
57-
item.state = "add"
57+
item.state = "add"
5858
item.initEmpty()
59+
keyTab.addRowDialog = addRowDialog
5960
}
6061
}
6162
}

src/qml/value-editor/ValueTabs.qml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Repeater {
5454
property var tabButton
5555
property bool loadingModel: showLoader
5656
property variant keyModel: keyViewModel
57+
property var addRowDialog
5758

5859
onKeyModelChanged: {
5960
console.log("keyModel changed")
@@ -447,11 +448,7 @@ Repeater {
447448
function clear() {
448449
if (valueEditor.item) {
449450
currentRow = -1
450-
451-
if (valueEditor.item.keyType !== undefined) {
452-
valueEditor.item.keyType = keyType
453-
}
454-
451+
valueEditor.item.keyType = Qt.binding(function() { return keyType });
455452
valueEditor.item.reset()
456453
}
457454
}

src/qml/value-editor/editors/MultilineEditor.qml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,8 @@ Item
413413
textRole: "text"
414414

415415
visible: {
416-
return binaryFlag.visible && qmlUtils.binaryStringLength(root.value) <= appSettings.valueSizeLimit
416+
console.log("keyType:", keyType)
417+
return binaryFlag.visible && keyType != "hyperloglog" && qmlUtils.binaryStringLength(root.value) <= appSettings.valueSizeLimit
417418
|| root.valueCompression > 0
418419
}
419420

@@ -505,34 +506,29 @@ Item
505506
color: "red"
506507
}
507508

509+
BetterButton {
510+
iconSource: PlatformUtils.getThemeIcon("add.svg")
511+
Layout.alignment: Qt.AlignHCenter
512+
513+
text: qsTranslate("RESP","Add Element to HLL");
514+
visible: keyType === "hyperloglog"
515+
516+
onClicked: {
517+
keyTab.addRowDialog.open()
518+
}
519+
}
520+
508521
RowLayout {
509522
id: valueEditorToolBar
510523
Layout.preferredWidth: isMultiRow ? 200 : 208
511524
Layout.maximumWidth: isMultiRow ? 200 : 208
512525

513-
visible: showToolBar
526+
visible: showToolBar
514527

515528
RowLayout {
516529
Layout.fillWidth: true
517530
Layout.preferredWidth: 98
518531

519-
ImageButton {
520-
iconSource: PlatformUtils.getThemeIcon("add.svg")
521-
implicitWidth: imgBtnWidth
522-
implicitHeight: imgBtnHeight
523-
imgWidth: imgBtnWidth
524-
imgHeight: imgBtnHeight
525-
526-
Layout.alignment: Qt.AlignHCenter
527-
528-
tooltip: qsTranslate("RESP","Add Element to HLL");
529-
visible: keyType === "hyperloglog"
530-
531-
onClicked: {
532-
addRowDialog.open()
533-
}
534-
}
535-
536532
ImageButton {
537533
id: copyValueToClipboardBtn
538534
iconSource: PlatformUtils.getThemeIcon("copy_2.svg")

0 commit comments

Comments
 (0)