From 87d543c8f870850ebe730ba9ec6d5c5edce65bf6 Mon Sep 17 00:00:00 2001 From: SET Date: Sun, 28 Feb 2021 19:02:44 +0100 Subject: [PATCH] Prefer setObjectName to setId. Wt discourages the use of setId(). See Wt commit 9eed80087aab34831932fa5a28751c137971b427. --- K7Main.cpp | 4 ++-- PopupCertifyUserId.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/K7Main.cpp b/K7Main.cpp index edf150e..264c81b 100644 --- a/K7Main.cpp +++ b/K7Main.cpp @@ -277,7 +277,7 @@ void K7Main::DisplayKeys(const vector& kList, const WString& grpLabe WLink ln; ln.setUrl(WString(L"javascript:void(0)").toUTF8()); WAnchor * anc = new WAnchor(ln, k.shortKeyID()); - anc->setId(k.primaryFingerprint()); + anc->setObjectName(k.primaryFingerprint()); // We use widget attribute values to buffer properties. anc->setAttributeValue("hasSecret", k.hasSecret() ? "1" : "0"); anc->clicked().connect(std::bind(&K7Main::OnKeyAnchorClicked, this, anc)); @@ -316,7 +316,7 @@ void K7Main::OnKeyAnchorClicked(WAnchor * source) bool secret = true; if (hasSecret == WString("0")) secret = false; - const string id = source->id(); + const string id = source->objectName(); // With secret = false, key signatures can be retrieved. DisplayUids(id); DisplaySubKeys(id, secret); diff --git a/PopupCertifyUserId.cpp b/PopupCertifyUserId.cpp index 8be0ebe..dcfc9d1 100644 --- a/PopupCertifyUserId.cpp +++ b/PopupCertifyUserId.cpp @@ -196,7 +196,7 @@ void PopupCertifyUserId::PresentEmail() { WCheckBox * cbEmail = new WCheckBox(it->email()); m_vblEmail->addWidget(unique_ptr (cbEmail)); - cbEmail->setId(std::to_string(id)); + cbEmail->setObjectName(std::to_string(id)); cbEmail->checked().connect(std::bind(&PopupCertifyUserId::OnEmailChecked, this, cbEmail, (*it))); cbEmail->unChecked().connect(std::bind(&PopupCertifyUserId::OnEmailUnChecked, this, cbEmail, (*it))); id++; @@ -244,14 +244,14 @@ void PopupCertifyUserId::ShowPassphrase(bool show) void PopupCertifyUserId::OnEmailChecked(WCheckBox* cb, GpgME::UserID& uid) { - int id = Tools::ToInt(cb->id()); + int id = Tools::ToInt(cb->objectName()); m_uidsToSign.push_back(id); m_uidsToRevokeCertification.push_back(uid); } void PopupCertifyUserId::OnEmailUnChecked(WCheckBox* cb, GpgME::UserID& uid) { - const uint id = Tools::ToInt(cb->id()); + const uint id = Tools::ToInt(cb->objectName()); vector::iterator it = std::find(m_uidsToSign.begin(), m_uidsToSign.end(), id); if (it != m_uidsToSign.end())