diff --git a/qml/Main.qml b/qml/Main.qml index deb7b0d1..908d0a49 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -141,8 +141,8 @@ ApplicationWindow { anchors.top: appWindow.top Repeater { - id: repeater1 - model: credentials + id: repeater + model: filteredCredentials(credentials, search.text) Rectangle { id: credentialRectangle @@ -198,6 +198,7 @@ ApplicationWindow { Layout.fillWidth: true } } + MessageDialog { id: touchYourYubikey icon: StandardIcon.Information @@ -273,6 +274,20 @@ ApplicationWindow { standardButtons: StandardButton.Ok } + function filteredCredentials(creds, search) { + var result = [] + if (creds != null) { + for (var i = 0; i < creds.length; i++) { + var cred = creds[i] + if (cred.name.toLowerCase().indexOf(search.toLowerCase( + )) !== -1) { + result.push(creds[i]) + } + } + } + return result + } + function hasIssuer(name) { return name.indexOf(':') !== -1 }