From 30bb84c4a999432ef2ae0d6c4f7aa22285d904bd Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Wed, 19 Apr 2017 14:23:29 +0200 Subject: [PATCH] Save persistently that default identity is created In 943a4213fbba409d930e1542ef895264c6a79bb2 default identity creation burst has been solved but some times the duplication happens in sequent instances of the app, now te app store permanently if default identity has been created so this other kind of duplication is avoided too (hopefully) --- retroshare-qml-app/src/Contacts.qml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index aa34cb1b7..3d90acffa 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -20,6 +20,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import org.retroshare.qml_components.LibresapiLocalClient 1.0 import "." //Needed for TokensManager singleton +import Qt.labs.settings 1.0 Item { @@ -63,7 +64,6 @@ Item rsApi.request("/identity/*/", "", refreshContactsCallback) } - property bool _refreshOwnCallback_creating: false function refreshOwnCallback(par) { console.log("contactsView.refreshOwnCallback(par)", visible) @@ -76,10 +76,10 @@ Item contactsView.own_gxs_id = json.data[0].gxs_id contactsView.own_nick = json.data[0].name } - else if (!_refreshOwnCallback_creating) + else if (!settings.defaultIdentityCreated) { console.log("refreshOwnCallback(par)", "creating new identity" ) - _refreshOwnCallback_creating = true + settings.defaultIdentityCreated = true var jsonData = { "name": mainWindow.pgp_name, "pgp_linked": false } rsApi.request( @@ -203,4 +203,12 @@ Item "" } } + + Settings + { + id: settings + category: "contactsView" + + property bool defaultIdentityCreated: false + } }