aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/keypair_details
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-01-05 12:55:15 +0000
committersaturneric <[email protected]>2024-01-05 12:55:15 +0000
commit644aa4397b03dbef73f8bfedc13925b51cad836b (patch)
tree7788d1cd2f0687dd8e576b111d9990c580092e7a /src/ui/dialog/keypair_details
parentfix: slove some known issues (diff)
downloadGpgFrontend-644aa4397b03dbef73f8bfedc13925b51cad836b.tar.gz
GpgFrontend-644aa4397b03dbef73f8bfedc13925b51cad836b.zip
feat: integrate logging api to core
Diffstat (limited to 'src/ui/dialog/keypair_details')
-rw-r--r--src/ui/dialog/keypair_details/KeyPairDetailTab.cpp4
-rw-r--r--src/ui/dialog/keypair_details/KeyPairOperaTab.cpp4
-rw-r--r--src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp14
-rw-r--r--src/ui/dialog/keypair_details/KeyPairUIDTab.cpp4
-rw-r--r--src/ui/dialog/keypair_details/KeySetExpireDateDialog.cpp15
-rw-r--r--src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp6
6 files changed, 24 insertions, 23 deletions
diff --git a/src/ui/dialog/keypair_details/KeyPairDetailTab.cpp b/src/ui/dialog/keypair_details/KeyPairDetailTab.cpp
index 286192f2..673ff889 100644
--- a/src/ui/dialog/keypair_details/KeyPairDetailTab.cpp
+++ b/src/ui/dialog/keypair_details/KeyPairDetailTab.cpp
@@ -39,8 +39,8 @@
namespace GpgFrontend::UI {
KeyPairDetailTab::KeyPairDetailTab(const std::string& key_id, QWidget* parent)
: QWidget(parent), key_(GpgKeyGetter::GetInstance().GetKey(key_id)) {
- SPDLOG_DEBUG(key_.GetEmail(), key_.IsPrivateKey(), key_.IsHasMasterKey(),
- key_.GetSubKeys()->front().IsPrivateKey());
+ GF_UI_LOG_DEBUG(key_.GetEmail(), key_.IsPrivateKey(), key_.IsHasMasterKey(),
+ key_.GetSubKeys()->front().IsPrivateKey());
owner_box_ = new QGroupBox(_("Owner"));
key_box_ = new QGroupBox(_("Primary Key"));
diff --git a/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp b/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp
index 8fa7eb9c..9513c3c4 100644
--- a/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp
+++ b/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp
@@ -89,7 +89,7 @@ KeyPairOperaTab::KeyPairOperaTab(const std::string& key_id, QWidget* parent)
forbid_all_gnupg_connection =
settings.lookup("network.forbid_all_gnupg_connection");
} catch (...) {
- SPDLOG_ERROR("setting operation error: forbid_all_gnupg_connection");
+ GF_UI_LOG_ERROR("setting operation error: forbid_all_gnupg_connection");
}
auto* key_server_opera_button =
@@ -369,7 +369,7 @@ void KeyPairOperaTab::slot_modify_tofu_policy() {
this, _("Modify TOFU Policy(Default is Auto)"),
_("Policy for the Key Pair:"), items, 0, false, &ok);
if (ok && !item.isEmpty()) {
- SPDLOG_DEBUG("selected policy: {}", item.toStdString());
+ GF_UI_LOG_DEBUG("selected policy: {}", item.toStdString());
gpgme_tofu_policy_t tofu_policy = GPGME_TOFU_POLICY_AUTO;
if (item == _("Policy Auto")) {
tofu_policy = GPGME_TOFU_POLICY_AUTO;
diff --git a/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp b/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp
index d7b4e47b..f6a5410e 100644
--- a/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp
+++ b/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp
@@ -37,8 +37,8 @@ namespace GpgFrontend::UI {
KeyPairSubkeyTab::KeyPairSubkeyTab(const std::string& key_id, QWidget* parent)
: QWidget(parent), key_(GpgKeyGetter::GetInstance().GetKey(key_id)) {
- SPDLOG_DEBUG(key_.GetEmail(), key_.IsPrivateKey(), key_.IsHasMasterKey(),
- key_.GetSubKeys()->front().IsPrivateKey());
+ GF_UI_LOG_DEBUG(key_.GetEmail(), key_.IsPrivateKey(), key_.IsHasMasterKey(),
+ key_.GetSubKeys()->front().IsPrivateKey());
create_subkey_list();
create_subkey_opera_menu();
@@ -178,8 +178,8 @@ void KeyPairSubkeyTab::slot_refresh_subkey_list() {
this->buffered_subkeys_.push_back(std::move(sub_key));
}
- SPDLOG_DEBUG("buffered_subkeys_ refreshed size",
- this->buffered_subkeys_.size());
+ GF_UI_LOG_DEBUG("buffered_subkeys_ refreshed size",
+ this->buffered_subkeys_.size());
subkey_list_->setRowCount(buffered_subkeys_.size());
@@ -216,12 +216,12 @@ void KeyPairSubkeyTab::slot_refresh_subkey_list() {
}
}
- SPDLOG_DEBUG("subkey_list_ item {} refreshed", row);
+ GF_UI_LOG_DEBUG("subkey_list_ item {} refreshed", row);
row++;
}
- SPDLOG_DEBUG("subkey_list_ refreshed");
+ GF_UI_LOG_DEBUG("subkey_list_ refreshed");
if (subkey_list_->rowCount() > 0) {
subkey_list_->selectRow(0);
@@ -327,7 +327,7 @@ void KeyPairSubkeyTab::create_subkey_opera_menu() {
}
void KeyPairSubkeyTab::slot_edit_subkey() {
- SPDLOG_DEBUG("fpr {}", get_selected_subkey().GetFingerprint());
+ GF_UI_LOG_DEBUG("fpr {}", get_selected_subkey().GetFingerprint());
auto dialog = new KeySetExpireDateDialog(
key_.GetId(), get_selected_subkey().GetFingerprint(), this);
diff --git a/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp b/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp
index 1738be7a..20d47137 100644
--- a/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp
+++ b/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp
@@ -228,7 +228,7 @@ void KeyPairUIDTab::slot_refresh_tofu_info() {
continue;
}
auto tofu_infos = uid.GetTofuInfos();
- SPDLOG_DEBUG("tofu info size: {}", tofu_infos->size());
+ GF_UI_LOG_DEBUG("tofu info size: {}", tofu_infos->size());
if (tofu_infos->empty()) {
tofu_tabs_->hide();
} else {
@@ -400,7 +400,7 @@ void KeyPairUIDTab::slot_del_uid() {
if (ret == QMessageBox::Yes) {
for (const auto& uid : *selected_uids) {
- SPDLOG_DEBUG("uid: {}", uid);
+ GF_UI_LOG_DEBUG("uid: {}", uid);
if (!GpgUIDOperator::GetInstance().RevUID(m_key_, uid)) {
QMessageBox::critical(
nullptr, _("Operation Failed"),
diff --git a/src/ui/dialog/keypair_details/KeySetExpireDateDialog.cpp b/src/ui/dialog/keypair_details/KeySetExpireDateDialog.cpp
index 7730b25b..f81b85e9 100644
--- a/src/ui/dialog/keypair_details/KeySetExpireDateDialog.cpp
+++ b/src/ui/dialog/keypair_details/KeySetExpireDateDialog.cpp
@@ -60,8 +60,9 @@ KeySetExpireDateDialog::KeySetExpireDateDialog(const KeyId& key_id,
}
void KeySetExpireDateDialog::slot_confirm() {
- SPDLOG_DEBUG("called: {} {}", ui_->dateEdit->date().toString().toStdString(),
- ui_->timeEdit->time().toString().toStdString());
+ GF_UI_LOG_DEBUG("called: {} {}",
+ ui_->dateEdit->date().toString().toStdString(),
+ ui_->timeEdit->time().toString().toStdString());
auto datetime = QDateTime(ui_->dateEdit->date(), ui_->timeEdit->time());
std::unique_ptr<boost::posix_time::ptime> expires = nullptr;
if (ui_->noExpirationCheckBox->checkState() == Qt::Unchecked) {
@@ -73,10 +74,10 @@ void KeySetExpireDateDialog::slot_confirm() {
expires = std::make_unique<boost::posix_time::ptime>(
boost::posix_time::from_time_t(datetime.toLocalTime().toTime_t()));
#endif
- SPDLOG_DEBUG("keyid: {}", m_key_.GetId(), m_subkey_,
- to_iso_string(*expires));
+ GF_UI_LOG_DEBUG("keyid: {}", m_key_.GetId(), m_subkey_,
+ to_iso_string(*expires));
} else {
- SPDLOG_DEBUG("keyid: {}", m_key_.GetId(), m_subkey_, "Non Expired");
+ GF_UI_LOG_DEBUG("keyid: {}", m_key_.GetId(), m_subkey_, "Non Expired");
}
auto err = GpgKeyOpera::GetInstance().SetExpire(m_key_, m_subkey_, expires);
@@ -108,10 +109,10 @@ void KeySetExpireDateDialog::init() {
bool longer_expiration_date = false;
try {
longer_expiration_date = settings.lookup("general.longer_expiration_date");
- SPDLOG_DEBUG("longer_expiration_date: {}", longer_expiration_date);
+ GF_UI_LOG_DEBUG("longer_expiration_date: {}", longer_expiration_date);
} catch (...) {
- SPDLOG_ERROR("setting operation error: longer_expiration_date");
+ GF_UI_LOG_ERROR("setting operation error: longer_expiration_date");
}
auto max_date_time =
diff --git a/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp b/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp
index 54b6298a..97f20289 100644
--- a/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp
+++ b/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp
@@ -108,7 +108,7 @@ void KeyUIDSignDialog::slot_sign_key(bool clicked) {
auto key_ids = m_key_list_->GetChecked();
auto keys = GpgKeyGetter::GetInstance().GetKeys(key_ids);
- SPDLOG_DEBUG("key info got");
+ GF_UI_LOG_DEBUG("key info got");
#ifdef GPGFRONTEND_GUI_QT6
auto expires =
std::make_unique<boost::posix_time::ptime>(boost::posix_time::from_time_t(
@@ -118,9 +118,9 @@ void KeyUIDSignDialog::slot_sign_key(bool clicked) {
boost::posix_time::from_time_t(expires_edit_->dateTime().toTime_t()));
#endif
- SPDLOG_DEBUG("sign start");
+ GF_UI_LOG_DEBUG("sign start");
for (const auto& uid : *m_uids_) {
- SPDLOG_DEBUG("sign uid: {}", uid);
+ GF_UI_LOG_DEBUG("sign uid: {}", uid);
// Sign For mKey
if (!GpgKeyManager::GetInstance().SignKey(m_key_, *keys, uid, expires)) {
QMessageBox::critical(