From ed55e5839762f5a3967ec41b9f634a091116e2c3 Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Sun, 9 Oct 2016 09:43:02 +0200 Subject: [PATCH] Bugfix: Refresh HOTP-Token from Cover. Closes Github Issue #11 --- qml/cover/CoverPage.qml | 4 +++- qml/pages/AddOTP.qml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/qml/cover/CoverPage.qml b/qml/cover/CoverPage.qml index f0012ac..ba7d9a0 100644 --- a/qml/cover/CoverPage.qml +++ b/qml/cover/CoverPage.qml @@ -103,7 +103,9 @@ CoverBackground { iconSource: appWin.coverType == "HOTP" ? "image://theme/icon-cover-refresh" : "image://theme/icon-cover-previous" onTriggered: { if (appWin.coverType == "HOTP") { - appWin.coverOTP = OTP.calcOTP(appWin.coverSecret, "HOTP", appWin.CoverLen, 0, DB.getCounter(appWin.coverTitle, appWin.coverSecret, true)); + appWin.listModel.setProperty(appWin.coverIndex, "counter", DB.getCounter(appWin.coverTitle, appWin.coverSecret, true)); + appWin.listModel.setProperty(appWin.coverIndex, "otp", OTP.calcOTP(appWin.coverSecret, "HOTP", appWin.coverLen, 0, appWin.listModel.get(appWin.coverIndex).counter)); + appWin.coverOTP = appWin.listModel.get(appWin.coverIndex).otp; } else { var index = appWin.coverIndex - 1 if (index < 0) index = appWin.listModel.count - 1 diff --git a/qml/pages/AddOTP.qml b/qml/pages/AddOTP.qml index f4d895a..ac33528 100644 --- a/qml/pages/AddOTP.qml +++ b/qml/pages/AddOTP.qml @@ -124,6 +124,7 @@ Dialog { TextField { id: otpLen width: parent.width + visible: paramType != "TOTP_STEAM" ? true : false label: qsTr("Length") text: paramLen placeholderText: qsTr("Length of the Token")