aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-11-07 07:57:28 +0000
committersaturneric <[email protected]>2023-11-07 07:57:28 +0000
commit4dcd2ac8c4f673fc21c4cf0072d6cb648ca64e7e (patch)
treed5e09d3170922aa288877344a8a90905b0c02d62
parentrefactor: remove CommonUtils at core (diff)
downloadGpgFrontend-4dcd2ac8c4f673fc21c4cf0072d6cb648ca64e7e.tar.gz
GpgFrontend-4dcd2ac8c4f673fc21c4cf0072d6cb648ca64e7e.zip
refactor: separate typedef and impl
-rw-r--r--.clang-tidy1
-rw-r--r--src/core/GpgModel.h26
-rw-r--r--src/core/function/CacheManager.cpp2
-rw-r--r--src/core/function/KeyPackageOperator.cpp1
-rw-r--r--src/core/function/KeyPackageOperator.h3
-rw-r--r--src/core/function/gpg/GpgBasicOperator.cpp1
-rw-r--r--src/core/function/gpg/GpgBasicOperator.h3
-rw-r--r--src/core/function/gpg/GpgFileOpera.h2
-rw-r--r--src/core/function/gpg/GpgKeyGetter.cpp1
-rw-r--r--src/core/function/gpg/GpgKeyGetter.h2
-rw-r--r--src/core/function/gpg/GpgKeyImportExporter.cpp53
-rw-r--r--src/core/function/gpg/GpgKeyImportExporter.h3
-rw-r--r--src/core/function/gpg/GpgKeyManager.cpp1
-rw-r--r--src/core/function/gpg/GpgKeyManager.h6
-rw-r--r--src/core/function/gpg/GpgKeyOpera.cpp1
-rw-r--r--src/core/function/gpg/GpgKeyOpera.h6
-rw-r--r--src/core/function/gpg/GpgUIDOperator.cpp23
-rw-r--r--src/core/function/gpg/GpgUIDOperator.h2
-rw-r--r--src/core/function/result_analyse/GpgResultAnalyse.h2
-rw-r--r--src/core/function/result_analyse/GpgSignResultAnalyse.cpp17
-rw-r--r--src/core/function/result_analyse/GpgVerifyResultAnalyse.cpp1
-rw-r--r--src/core/model/GpgData.h2
-rw-r--r--src/core/typedef/CoreTypedef.h (renamed from src/core/CoreTypedef.h)0
-rw-r--r--src/core/typedef/GpgTypedef.h56
-rw-r--r--src/core/utils/CommonUtils.h2
-rw-r--r--src/core/utils/GpgUtils.cpp2
-rw-r--r--src/core/utils/GpgUtils.h3
-rw-r--r--src/ui/UserInterfaceUtils.h2
-rw-r--r--src/ui/dialog/SignersPicker.cpp1
-rw-r--r--src/ui/dialog/SignersPicker.h2
-rw-r--r--src/ui/dialog/Wizard.cpp1
-rw-r--r--src/ui/dialog/details/VerifyDetailsDialog.cpp2
-rw-r--r--src/ui/dialog/gnupg/GnuPGControllerDialog.cpp3
-rw-r--r--src/ui/dialog/import_export/ExportKeyPackageDialog.cpp1
-rw-r--r--src/ui/dialog/import_export/ExportKeyPackageDialog.h2
-rw-r--r--src/ui/dialog/import_export/KeyImportDetailDialog.cpp1
-rw-r--r--src/ui/dialog/import_export/KeyServerImportDialog.cpp3
-rw-r--r--src/ui/dialog/import_export/KeyUploadDialog.cpp1
-rw-r--r--src/ui/dialog/import_export/KeyUploadDialog.h5
-rw-r--r--src/ui/dialog/key_generate/KeygenDialog.cpp1
-rw-r--r--src/ui/dialog/key_generate/SubkeyGenerateDialog.h3
-rw-r--r--src/ui/dialog/keypair_details/KeyDetailsDialog.cpp15
-rw-r--r--src/ui/dialog/keypair_details/KeyDetailsDialog.h2
-rw-r--r--src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp1
-rw-r--r--src/ui/dialog/keypair_details/KeyNewUIDDialog.h3
-rw-r--r--src/ui/dialog/keypair_details/KeyPairDetailTab.cpp1
-rw-r--r--src/ui/dialog/keypair_details/KeyPairOperaTab.h1
-rw-r--r--src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp1
-rw-r--r--src/ui/dialog/keypair_details/KeyPairUIDTab.cpp1
-rw-r--r--src/ui/dialog/keypair_details/KeySetExpireDateDialog.h3
-rw-r--r--src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp10
-rw-r--r--src/ui/dialog/settings/SettingsDialog.cpp11
-rw-r--r--src/ui/dialog/settings/SettingsGeneral.cpp3
-rw-r--r--src/ui/main_window/MainWindow.cpp2
-rw-r--r--src/ui/widgets/FilePage.cpp1
-rw-r--r--src/ui/widgets/InfoBoardWidget.cpp1
-rw-r--r--src/ui/widgets/TOFUInfoPage.cpp2
-rw-r--r--src/ui/widgets/TOFUInfoPage.h2
-rw-r--r--src/ui/widgets/TextEdit.cpp1
-rw-r--r--src/ui/widgets/VerifyKeyDetailBox.cpp1
60 files changed, 201 insertions, 111 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 6ea462ca..eec3aa21 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -36,6 +36,7 @@ Checks: >
-readability-named-parameter
-readability-identifier-length
-bugprone-easily-swappable-parameters
+ -readability-redundant-access-specifiers
CheckOptions:
- { key: readability-identifier-naming.NamespaceCase, value: CamelCase }
diff --git a/src/core/GpgModel.h b/src/core/GpgModel.h
index facb1f72..72574988 100644
--- a/src/core/GpgModel.h
+++ b/src/core/GpgModel.h
@@ -28,28 +28,12 @@
#pragma once
+//
+#include "core/typedef/GpgTypedef.h"
+
+//
#include "core/model/GpgData.h"
#include "core/model/GpgKey.h"
#include "core/model/GpgSignature.h"
-namespace GpgFrontend {
-
-using GpgError = gpgme_error_t; ///<
-
-using KeyId = std::string; ///<
-using SubkeyId = std::string; ///<
-using KeyIdArgsList = std::vector<KeyId>; ///<
-using KeyIdArgsListPtr = std::unique_ptr<KeyIdArgsList>; ///<
-using UIDArgsList = std::vector<std::string>; ///<
-using UIDArgsListPtr = std::unique_ptr<UIDArgsList>; ///<
-using SignIdArgsList = std::vector<std::pair<std::string, std::string>>; ///<
-using SignIdArgsListPtr = std::unique_ptr<SignIdArgsList>; ///<
-using KeyFprArgsListPtr = std::unique_ptr<std::vector<std::string>>; ///<
-using KeyArgsList = std::vector<GpgKey>; ///<
-using KeyListPtr = std::shared_ptr<KeyArgsList>; ///<
-using GpgKeyLinkList = std::list<GpgKey>; ///<
-using KeyLinkListPtr = std::unique_ptr<GpgKeyLinkList>; ///<
-using KeyPtr = std::unique_ptr<GpgKey>; ///<
-using KeyPtrArgsList = const std::initializer_list<KeyPtr>; ///<
-
-} // namespace GpgFrontend
+// namespace GpgFrontend
diff --git a/src/core/function/CacheManager.cpp b/src/core/function/CacheManager.cpp
index 161f9a0c..a5eac78e 100644
--- a/src/core/function/CacheManager.cpp
+++ b/src/core/function/CacheManager.cpp
@@ -33,7 +33,7 @@
#include <shared_mutex>
#include <utility>
-#include "function/DataObjectOperator.h"
+#include "core/function/DataObjectOperator.h"
namespace GpgFrontend {
diff --git a/src/core/function/KeyPackageOperator.cpp b/src/core/function/KeyPackageOperator.cpp
index 6452c91e..e986ef44 100644
--- a/src/core/function/KeyPackageOperator.cpp
+++ b/src/core/function/KeyPackageOperator.cpp
@@ -36,6 +36,7 @@
#include "core/function/PassphraseGenerator.h"
#include "core/function/gpg/GpgKeyGetter.h"
#include "core/function/gpg/GpgKeyImportExporter.h"
+#include "core/typedef/CoreTypedef.h"
#include "core/utils/IOUtils.h"
namespace GpgFrontend {
diff --git a/src/core/function/KeyPackageOperator.h b/src/core/function/KeyPackageOperator.h
index 26939271..e2fcc3e4 100644
--- a/src/core/function/KeyPackageOperator.h
+++ b/src/core/function/KeyPackageOperator.h
@@ -83,8 +83,7 @@ class GPGFRONTEND_CORE_EXPORT KeyPackageOperator {
*/
static auto ImportKeyPackage(const std::filesystem::path &key_package_path,
const std::filesystem::path &phrase_path,
- GpgFrontend::GpgImportInformation &import_info)
- -> bool;
+ GpgImportInformation &import_info) -> bool;
private:
/**
diff --git a/src/core/function/gpg/GpgBasicOperator.cpp b/src/core/function/gpg/GpgBasicOperator.cpp
index 836dafaa..4f524d3d 100644
--- a/src/core/function/gpg/GpgBasicOperator.cpp
+++ b/src/core/function/gpg/GpgBasicOperator.cpp
@@ -28,6 +28,7 @@
#include "GpgBasicOperator.h"
+#include "core/GpgModel.h"
#include "core/utils/GpgUtils.h"
GpgFrontend::GpgBasicOperator::GpgBasicOperator(int channel)
diff --git a/src/core/function/gpg/GpgBasicOperator.h b/src/core/function/gpg/GpgBasicOperator.h
index 581b6b95..e72db861 100644
--- a/src/core/function/gpg/GpgBasicOperator.h
+++ b/src/core/function/gpg/GpgBasicOperator.h
@@ -28,10 +28,11 @@
#pragma once
-#include "core/GpgModel.h"
#include "core/function/basic/GpgFunctionObject.h"
#include "core/function/gpg/GpgContext.h"
#include "core/function/result_analyse/GpgResultAnalyse.h"
+#include "core/typedef/CoreTypedef.h"
+#include "core/typedef/GpgTypedef.h"
namespace GpgFrontend {
diff --git a/src/core/function/gpg/GpgFileOpera.h b/src/core/function/gpg/GpgFileOpera.h
index 722555fc..b20fa7db 100644
--- a/src/core/function/gpg/GpgFileOpera.h
+++ b/src/core/function/gpg/GpgFileOpera.h
@@ -28,8 +28,8 @@
#pragma once
-#include "core/GpgModel.h"
#include "core/function/result_analyse/GpgResultAnalyse.h"
+#include "core/typedef/GpgTypedef.h"
namespace GpgFrontend {
diff --git a/src/core/function/gpg/GpgKeyGetter.cpp b/src/core/function/gpg/GpgKeyGetter.cpp
index 73d40a0a..0b1c7c44 100644
--- a/src/core/function/gpg/GpgKeyGetter.cpp
+++ b/src/core/function/gpg/GpgKeyGetter.cpp
@@ -33,6 +33,7 @@
#include <mutex>
#include <shared_mutex>
+#include "core/GpgModel.h"
#include "core/function/gpg/GpgContext.h"
#include "core/utils/GpgUtils.h"
diff --git a/src/core/function/gpg/GpgKeyGetter.h b/src/core/function/gpg/GpgKeyGetter.h
index fabd1e4e..287c062a 100644
--- a/src/core/function/gpg/GpgKeyGetter.h
+++ b/src/core/function/gpg/GpgKeyGetter.h
@@ -28,8 +28,8 @@
#pragma once
-#include "core/GpgModel.h"
#include "core/function/basic/GpgFunctionObject.h"
+#include "core/typedef/GpgTypedef.h"
namespace GpgFrontend {
diff --git a/src/core/function/gpg/GpgKeyImportExporter.cpp b/src/core/function/gpg/GpgKeyImportExporter.cpp
index 29bbf60e..c0d578c8 100644
--- a/src/core/function/gpg/GpgKeyImportExporter.cpp
+++ b/src/core/function/gpg/GpgKeyImportExporter.cpp
@@ -28,10 +28,13 @@
#include "GpgKeyImportExporter.h"
+#include "core/GpgModel.h"
#include "core/function/gpg/GpgKeyGetter.h"
#include "core/utils/GpgUtils.h"
-GpgFrontend::GpgKeyImportExporter::GpgKeyImportExporter(int channel)
+namespace GpgFrontend {
+
+GpgKeyImportExporter::GpgKeyImportExporter(int channel)
: SingletonFunctionObject<GpgKeyImportExporter>(channel),
ctx_(GpgContext::GetInstance(SingletonFunctionObject::GetChannel())) {}
@@ -40,8 +43,8 @@ GpgFrontend::GpgKeyImportExporter::GpgKeyImportExporter(int channel)
* @param inBuffer input byte array
* @return Import information
*/
-auto GpgFrontend::GpgKeyImportExporter::ImportKey(StdBypeArrayPtr in_buffer)
- -> GpgFrontend::GpgImportInformation {
+auto GpgKeyImportExporter::ImportKey(StdBypeArrayPtr in_buffer)
+ -> GpgImportInformation {
if (in_buffer->empty()) return {};
GpgData data_in(in_buffer->data(), in_buffer->size());
@@ -69,9 +72,9 @@ auto GpgFrontend::GpgKeyImportExporter::ImportKey(StdBypeArrayPtr in_buffer)
* @param out_buffer output byte array
* @return if success
*/
-auto GpgFrontend::GpgKeyImportExporter::ExportKeys(KeyIdArgsListPtr& uid_list,
- ByteArrayPtr& out_buffer,
- bool secret) const -> bool {
+auto GpgKeyImportExporter::ExportKeys(KeyIdArgsListPtr& uid_list,
+ ByteArrayPtr& out_buffer,
+ bool secret) const -> bool {
if (uid_list->empty()) return false;
int mode = 0;
@@ -108,9 +111,9 @@ auto GpgFrontend::GpgKeyImportExporter::ExportKeys(KeyIdArgsListPtr& uid_list,
* @param outBuffer output byte array
* @return if success
*/
-auto GpgFrontend::GpgKeyImportExporter::ExportKeys(const KeyArgsList& keys,
- ByteArrayPtr& out_buffer,
- bool secret) const -> bool {
+auto GpgKeyImportExporter::ExportKeys(const KeyArgsList& keys,
+ ByteArrayPtr& out_buffer,
+ bool secret) const -> bool {
KeyIdArgsListPtr key_ids = std::make_unique<std::vector<std::string>>();
for (const auto& key : keys) key_ids->push_back(key.GetId());
return ExportKeys(key_ids, out_buffer, secret);
@@ -122,9 +125,9 @@ auto GpgFrontend::GpgKeyImportExporter::ExportKeys(const KeyArgsList& keys,
* @param out_buffer output byte array
* @return if success
*/
-auto GpgFrontend::GpgKeyImportExporter::ExportAllKeys(
- KeyIdArgsListPtr& uid_list, ByteArrayPtr& out_buffer, bool secret) const
- -> bool {
+auto GpgKeyImportExporter::ExportAllKeys(KeyIdArgsListPtr& uid_list,
+ ByteArrayPtr& out_buffer,
+ bool secret) const -> bool {
bool result = true;
result = ((static_cast<int>(ExportKeys(uid_list, out_buffer, false)) &
static_cast<int>(result)) != 0);
@@ -144,8 +147,9 @@ auto GpgFrontend::GpgKeyImportExporter::ExportAllKeys(
* @param outBuffer output byte array
* @return if successful
*/
-auto GpgFrontend::GpgKeyImportExporter::ExportSecretKey(
- const GpgKey& key, ByteArrayPtr& out_buffer) const -> bool {
+auto GpgKeyImportExporter::ExportSecretKey(const GpgKey& key,
+ ByteArrayPtr& out_buffer) const
+ -> bool {
SPDLOG_DEBUG("export secret key: {}", key.GetId().c_str());
gpgme_key_t target_key[2] = {static_cast<gpgme_key_t>(key), nullptr};
@@ -161,9 +165,8 @@ auto GpgFrontend::GpgKeyImportExporter::ExportSecretKey(
return CheckGpgError(err) == GPG_ERR_NO_ERROR;
}
-auto GpgFrontend::GpgKeyImportExporter::ExportKey(
- const GpgFrontend::GpgKey& key, GpgFrontend::ByteArrayPtr& out_buffer) const
- -> bool {
+auto GpgKeyImportExporter::ExportKey(const GpgKey& key,
+ ByteArrayPtr& out_buffer) const -> bool {
GpgData data_out;
auto err = gpgme_op_export(ctx_, key.GetId().c_str(), 0, data_out);
@@ -175,8 +178,8 @@ auto GpgFrontend::GpgKeyImportExporter::ExportKey(
return CheckGpgError(err) == GPG_ERR_NO_ERROR;
}
-auto GpgFrontend::GpgKeyImportExporter::ExportKeyOpenSSH(
- const GpgFrontend::GpgKey& key, GpgFrontend::ByteArrayPtr& out_buffer) const
+auto GpgKeyImportExporter::ExportKeyOpenSSH(const GpgKey& key,
+ ByteArrayPtr& out_buffer) const
-> bool {
GpgData data_out;
auto err = gpgme_op_export(ctx_, key.GetId().c_str(), GPGME_EXPORT_MODE_SSH,
@@ -189,9 +192,8 @@ auto GpgFrontend::GpgKeyImportExporter::ExportKeyOpenSSH(
return CheckGpgError(err) == GPG_ERR_NO_ERROR;
}
-auto GpgFrontend::GpgKeyImportExporter::ExportSecretKeyShortest(
- const GpgFrontend::GpgKey& key, GpgFrontend::ByteArrayPtr& out_buffer) const
- -> bool {
+auto GpgKeyImportExporter::ExportSecretKeyShortest(
+ const GpgKey& key, ByteArrayPtr& out_buffer) const -> bool {
GpgData data_out;
auto err = gpgme_op_export(ctx_, key.GetId().c_str(),
GPGME_EXPORT_MODE_MINIMAL, data_out);
@@ -203,10 +205,9 @@ auto GpgFrontend::GpgKeyImportExporter::ExportSecretKeyShortest(
return CheckGpgError(err) == GPG_ERR_NO_ERROR;
}
-GpgFrontend::GpgImportInformation::GpgImportInformation() = default;
+GpgImportInformation::GpgImportInformation() = default;
-GpgFrontend::GpgImportInformation::GpgImportInformation(
- gpgme_import_result_t result) {
+GpgImportInformation::GpgImportInformation(gpgme_import_result_t result) {
if (result->unchanged != 0) unchanged = result->unchanged;
if (result->considered != 0) considered = result->considered;
if (result->no_user_id != 0) no_user_id = result->no_user_id;
@@ -224,3 +225,5 @@ GpgFrontend::GpgImportInformation::GpgImportInformation(
}
if (result->not_imported != 0) not_imported = result->not_imported;
}
+
+} // namespace GpgFrontend
diff --git a/src/core/function/gpg/GpgKeyImportExporter.h b/src/core/function/gpg/GpgKeyImportExporter.h
index 75d65ada..20eacd71 100644
--- a/src/core/function/gpg/GpgKeyImportExporter.h
+++ b/src/core/function/gpg/GpgKeyImportExporter.h
@@ -28,9 +28,10 @@
#pragma once
-#include "core/GpgModel.h"
#include "core/function/basic/GpgFunctionObject.h"
#include "core/function/gpg/GpgContext.h"
+#include "core/typedef/CoreTypedef.h"
+#include "core/typedef/GpgTypedef.h"
namespace GpgFrontend {
diff --git a/src/core/function/gpg/GpgKeyManager.cpp b/src/core/function/gpg/GpgKeyManager.cpp
index 3e27f946..726b2b66 100644
--- a/src/core/function/gpg/GpgKeyManager.cpp
+++ b/src/core/function/gpg/GpgKeyManager.cpp
@@ -31,6 +31,7 @@
#include <boost/algorithm/string.hpp>
#include <boost/date_time/posix_time/conversion.hpp>
+#include "core/GpgModel.h"
#include "core/function/gpg/GpgBasicOperator.h"
#include "core/function/gpg/GpgKeyGetter.h"
#include "core/utils/GpgUtils.h"
diff --git a/src/core/function/gpg/GpgKeyManager.h b/src/core/function/gpg/GpgKeyManager.h
index c263032f..bf0f5c02 100644
--- a/src/core/function/gpg/GpgKeyManager.h
+++ b/src/core/function/gpg/GpgKeyManager.h
@@ -31,9 +31,13 @@
#include <functional>
#include <utility>
-#include "core/GpgModel.h"
#include "core/function/basic/GpgFunctionObject.h"
#include "core/function/gpg/GpgContext.h"
+#include "core/typedef/GpgTypedef.h"
+
+namespace boost::posix_time {
+class ptime;
+}
namespace GpgFrontend {
diff --git a/src/core/function/gpg/GpgKeyOpera.cpp b/src/core/function/gpg/GpgKeyOpera.cpp
index c31a79e3..e48a84d8 100644
--- a/src/core/function/gpg/GpgKeyOpera.cpp
+++ b/src/core/function/gpg/GpgKeyOpera.cpp
@@ -35,6 +35,7 @@
#include <boost/process/async_pipe.hpp>
#include "core/GpgConstants.h"
+#include "core/GpgModel.h"
#include "core/function/gpg/GpgCommandExecutor.h"
#include "core/function/gpg/GpgKeyGetter.h"
#include "core/function/result_analyse/GpgResultAnalyse.h"
diff --git a/src/core/function/gpg/GpgKeyOpera.h b/src/core/function/gpg/GpgKeyOpera.h
index 2c92b9b0..0186cdbb 100644
--- a/src/core/function/gpg/GpgKeyOpera.h
+++ b/src/core/function/gpg/GpgKeyOpera.h
@@ -28,9 +28,13 @@
#pragma once
-#include "core/GpgModel.h"
#include "core/function/gpg/GpgContext.h"
#include "core/function/result_analyse/GpgResultAnalyse.h"
+#include "core/typedef/GpgTypedef.h"
+
+namespace boost::posix_time {
+class ptime;
+} // namespace boost::posix_time
namespace GpgFrontend {
/**
diff --git a/src/core/function/gpg/GpgUIDOperator.cpp b/src/core/function/gpg/GpgUIDOperator.cpp
index 2c0445b1..a614d2ee 100644
--- a/src/core/function/gpg/GpgUIDOperator.cpp
+++ b/src/core/function/gpg/GpgUIDOperator.cpp
@@ -30,37 +30,38 @@
#include <boost/format.hpp>
+#include "core/GpgModel.h"
#include "core/utils/GpgUtils.h"
-GpgFrontend::GpgUIDOperator::GpgUIDOperator(int channel)
+namespace GpgFrontend {
+
+GpgUIDOperator::GpgUIDOperator(int channel)
: SingletonFunctionObject<GpgUIDOperator>(channel) {}
-auto GpgFrontend::GpgUIDOperator::AddUID(const GpgFrontend::GpgKey& key,
- const std::string& uid) -> bool {
+auto GpgUIDOperator::AddUID(const GpgKey& key, const std::string& uid) -> bool {
auto err =
gpgme_op_adduid(ctx_, static_cast<gpgme_key_t>(key), uid.c_str(), 0);
return CheckGpgError(err) == GPG_ERR_NO_ERROR;
}
-auto GpgFrontend::GpgUIDOperator::RevUID(const GpgFrontend::GpgKey& key,
- const std::string& uid) -> bool {
+auto GpgUIDOperator::RevUID(const GpgKey& key, const std::string& uid) -> bool {
auto err = CheckGpgError(
gpgme_op_revuid(ctx_, static_cast<gpgme_key_t>(key), uid.c_str(), 0));
return CheckGpgError(err) == GPG_ERR_NO_ERROR;
}
-auto GpgFrontend::GpgUIDOperator::SetPrimaryUID(const GpgFrontend::GpgKey& key,
- const std::string& uid)
+auto GpgUIDOperator::SetPrimaryUID(const GpgKey& key, const std::string& uid)
-> bool {
auto err = CheckGpgError(gpgme_op_set_uid_flag(
ctx_, static_cast<gpgme_key_t>(key), uid.c_str(), "primary", nullptr));
return CheckGpgError(err) == GPG_ERR_NO_ERROR;
}
-auto GpgFrontend::GpgUIDOperator::AddUID(const GpgFrontend::GpgKey& key,
- const std::string& name,
- const std::string& comment,
- const std::string& email) -> bool {
+auto GpgUIDOperator::AddUID(const GpgKey& key, const std::string& name,
+ const std::string& comment,
+ const std::string& email) -> bool {
SPDLOG_DEBUG("new uuid: {} {} {}", name, comment, email);
auto uid = boost::format("%1%(%2%)<%3%>") % name % comment % email;
return AddUID(key, uid.str());
}
+
+} // namespace GpgFrontend
diff --git a/src/core/function/gpg/GpgUIDOperator.h b/src/core/function/gpg/GpgUIDOperator.h
index 02ea7b5f..982f8d08 100644
--- a/src/core/function/gpg/GpgUIDOperator.h
+++ b/src/core/function/gpg/GpgUIDOperator.h
@@ -28,8 +28,8 @@
#pragma once
-#include "core/GpgModel.h"
#include "core/function/gpg/GpgContext.h"
+#include "core/typedef/GpgTypedef.h"
namespace GpgFrontend {
/**
diff --git a/src/core/function/result_analyse/GpgResultAnalyse.h b/src/core/function/result_analyse/GpgResultAnalyse.h
index b95eb2f0..b034f40a 100644
--- a/src/core/function/result_analyse/GpgResultAnalyse.h
+++ b/src/core/function/result_analyse/GpgResultAnalyse.h
@@ -29,7 +29,7 @@
#include <sstream>
-#include "core/GpgModel.h"
+#include "core/typedef/GpgTypedef.h"
namespace GpgFrontend {
diff --git a/src/core/function/result_analyse/GpgSignResultAnalyse.cpp b/src/core/function/result_analyse/GpgSignResultAnalyse.cpp
index 5925ced9..bb24c40f 100644
--- a/src/core/function/result_analyse/GpgSignResultAnalyse.cpp
+++ b/src/core/function/result_analyse/GpgSignResultAnalyse.cpp
@@ -28,13 +28,15 @@
#include "GpgSignResultAnalyse.h"
-#include "function/gpg/GpgKeyGetter.h"
+#include "core/GpgModel.h"
+#include "core/function/gpg/GpgKeyGetter.h"
-GpgFrontend::GpgSignResultAnalyse::GpgSignResultAnalyse(GpgError error,
- GpgSignResult result)
+namespace GpgFrontend {
+
+GpgSignResultAnalyse::GpgSignResultAnalyse(GpgError error, GpgSignResult result)
: error_(error), result_(std::move(result)) {}
-void GpgFrontend::GpgSignResultAnalyse::doAnalyse() {
+void GpgSignResultAnalyse::doAnalyse() {
SPDLOG_DEBUG("start sign result analyse");
stream_ << "[#] " << _("Sign Operation") << " ";
@@ -69,8 +71,7 @@ void GpgFrontend::GpgSignResultAnalyse::doAnalyse() {
stream_ << std::endl;
- auto singer_key =
- GpgFrontend::GpgKeyGetter::GetInstance().GetKey(new_sign->fpr);
+ auto singer_key = GpgKeyGetter::GetInstance().GetKey(new_sign->fpr);
if (singer_key.IsGood()) {
stream_ << " " << _("Signer") << ": "
<< singer_key.GetUIDs()->front().GetUID() << std::endl;
@@ -114,4 +115,6 @@ void GpgFrontend::GpgSignResultAnalyse::doAnalyse() {
}
stream_ << "<------------" << std::endl;
}
-} \ No newline at end of file
+}
+
+} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/function/result_analyse/GpgVerifyResultAnalyse.cpp b/src/core/function/result_analyse/GpgVerifyResultAnalyse.cpp
index fd80c6bb..e9c922ac 100644
--- a/src/core/function/result_analyse/GpgVerifyResultAnalyse.cpp
+++ b/src/core/function/result_analyse/GpgVerifyResultAnalyse.cpp
@@ -32,6 +32,7 @@
#include "GpgFrontend.h"
#include "core/GpgConstants.h"
+#include "core/GpgModel.h"
#include "core/function/gpg/GpgKeyGetter.h"
#include "core/utils/CommonUtils.h"
diff --git a/src/core/model/GpgData.h b/src/core/model/GpgData.h
index 39097b0c..eb9bd723 100644
--- a/src/core/model/GpgData.h
+++ b/src/core/model/GpgData.h
@@ -28,7 +28,7 @@
#pragma once
-#include "core/CoreTypedef.h"
+#include "core/typedef/CoreTypedef.h"
namespace GpgFrontend {
/**
diff --git a/src/core/CoreTypedef.h b/src/core/typedef/CoreTypedef.h
index fe2ed87b..fe2ed87b 100644
--- a/src/core/CoreTypedef.h
+++ b/src/core/typedef/CoreTypedef.h
diff --git a/src/core/typedef/GpgTypedef.h b/src/core/typedef/GpgTypedef.h
new file mode 100644
index 00000000..d4d3d956
--- /dev/null
+++ b/src/core/typedef/GpgTypedef.h
@@ -0,0 +1,56 @@
+/**
+ * Copyright (C) 2021 Saturneric <[email protected]>
+ *
+ * This file is part of GpgFrontend.
+ *
+ * GpgFrontend is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GpgFrontend is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GpgFrontend. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * The initial version of the source code is inherited from
+ * the gpg4usb project, which is under GPL-3.0-or-later.
+ *
+ * All the source code of GpgFrontend was modified and released by
+ * Saturneric <[email protected]> starting on May 12, 2021.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ */
+
+#pragma once
+
+namespace GpgFrontend {
+
+class GpgKey; ///< forward declaration
+class GpgSubKey;
+class GpgSignature;
+class GpgTOFUInfo;
+
+using GpgError = gpgme_error_t; ///< gpgme error code
+
+using KeyId = std::string; ///<
+using SubkeyId = std::string; ///<
+using KeyIdArgsList = std::vector<KeyId>; ///<
+using KeyIdArgsListPtr = std::unique_ptr<KeyIdArgsList>; ///<
+using UIDArgsList = std::vector<std::string>; ///<
+using UIDArgsListPtr = std::unique_ptr<UIDArgsList>; ///<
+using SignIdArgsList = std::vector<std::pair<std::string, std::string>>; ///<
+using SignIdArgsListPtr = std::unique_ptr<SignIdArgsList>; ///<
+using KeyFprArgsListPtr = std::unique_ptr<std::vector<std::string>>; ///<
+using KeyArgsList = std::vector<GpgKey>; ///<
+using KeyListPtr = std::shared_ptr<KeyArgsList>; ///<
+using GpgKeyLinkList = std::list<GpgKey>; ///<
+using KeyLinkListPtr = std::unique_ptr<GpgKeyLinkList>; ///<
+using KeyPtr = std::unique_ptr<GpgKey>; ///<
+using KeyPtrArgsList = const std::initializer_list<KeyPtr>; ///<
+ ///
+} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/CommonUtils.h b/src/core/utils/CommonUtils.h
index 94a727e9..0f8b9454 100644
--- a/src/core/utils/CommonUtils.h
+++ b/src/core/utils/CommonUtils.h
@@ -28,7 +28,7 @@
#pragma once
-#include "core/CoreTypedef.h"
+#include "core/typedef/CoreTypedef.h"
namespace GpgFrontend {
diff --git a/src/core/utils/GpgUtils.cpp b/src/core/utils/GpgUtils.cpp
index a8e15e31..287d06ba 100644
--- a/src/core/utils/GpgUtils.cpp
+++ b/src/core/utils/GpgUtils.cpp
@@ -28,6 +28,8 @@
#include "GpgUtils.h"
+#include <boost/algorithm/string.hpp>
+
#include "core/utils/IOUtils.h"
namespace GpgFrontend {
diff --git a/src/core/utils/GpgUtils.h b/src/core/utils/GpgUtils.h
index a617ba11..90096ae2 100644
--- a/src/core/utils/GpgUtils.h
+++ b/src/core/utils/GpgUtils.h
@@ -28,8 +28,9 @@
#pragma once
-#include "core/GpgModel.h"
#include "core/function/result_analyse/GpgResultAnalyse.h"
+#include "core/typedef/CoreTypedef.h"
+#include "core/typedef/GpgTypedef.h"
namespace GpgFrontend {
diff --git a/src/ui/UserInterfaceUtils.h b/src/ui/UserInterfaceUtils.h
index 9356e459..4b6ed359 100644
--- a/src/ui/UserInterfaceUtils.h
+++ b/src/ui/UserInterfaceUtils.h
@@ -28,10 +28,10 @@
#pragma once
-#include "core/GpgModel.h"
#include "core/function/result_analyse/GpgVerifyResultAnalyse.h"
#include "core/model/GpgKey.h"
#include "core/thread/ThreadingModel.h"
+#include "core/typedef/GpgTypedef.h"
#include "ui/GpgFrontendUI.h"
namespace GpgFrontend {
diff --git a/src/ui/dialog/SignersPicker.cpp b/src/ui/dialog/SignersPicker.cpp
index 49f5f482..93f13471 100644
--- a/src/ui/dialog/SignersPicker.cpp
+++ b/src/ui/dialog/SignersPicker.cpp
@@ -28,6 +28,7 @@
#include "SignersPicker.h"
+#include "core/GpgModel.h"
#include "ui/widgets/KeyList.h"
namespace GpgFrontend::UI {
diff --git a/src/ui/dialog/SignersPicker.h b/src/ui/dialog/SignersPicker.h
index 6768b816..c7e1bfa5 100644
--- a/src/ui/dialog/SignersPicker.h
+++ b/src/ui/dialog/SignersPicker.h
@@ -29,7 +29,7 @@
#pragma once
#include "GpgFrontendUI.h"
-#include "core/GpgModel.h"
+#include "core/typedef/GpgTypedef.h"
#include "ui/dialog//GeneralDialog.h"
namespace GpgFrontend::UI {
diff --git a/src/ui/dialog/Wizard.cpp b/src/ui/dialog/Wizard.cpp
index 24ffe496..f379ffb0 100644
--- a/src/ui/dialog/Wizard.cpp
+++ b/src/ui/dialog/Wizard.cpp
@@ -28,6 +28,7 @@
#include "Wizard.h"
+#include "core/GpgModel.h"
#include "core/function/GlobalSettingStation.h"
namespace GpgFrontend::UI {
diff --git a/src/ui/dialog/details/VerifyDetailsDialog.cpp b/src/ui/dialog/details/VerifyDetailsDialog.cpp
index fe09c262..9cb61963 100644
--- a/src/ui/dialog/details/VerifyDetailsDialog.cpp
+++ b/src/ui/dialog/details/VerifyDetailsDialog.cpp
@@ -30,6 +30,8 @@
#include <boost/format.hpp>
+#include "core/GpgModel.h"
+
namespace GpgFrontend::UI {
VerifyDetailsDialog::VerifyDetailsDialog(QWidget* parent, GpgError error,
diff --git a/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp b/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp
index dda37014..92b4201d 100644
--- a/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp
+++ b/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp
@@ -28,9 +28,10 @@
#include "GnuPGControllerDialog.h"
-#include "SignalStation.h"
+#include "core/GpgModel.h"
#include "core/function/GlobalSettingStation.h"
#include "core/module/ModuleManager.h"
+#include "ui/SignalStation.h"
#include "ui/dialog/GeneralDialog.h"
#include "ui_GnuPGControllerDialog.h"
diff --git a/src/ui/dialog/import_export/ExportKeyPackageDialog.cpp b/src/ui/dialog/import_export/ExportKeyPackageDialog.cpp
index a63438f6..854152ae 100644
--- a/src/ui/dialog/import_export/ExportKeyPackageDialog.cpp
+++ b/src/ui/dialog/import_export/ExportKeyPackageDialog.cpp
@@ -30,6 +30,7 @@
#include <boost/format.hpp>
+#include "core/GpgModel.h"
#include "core/function/KeyPackageOperator.h"
#include "core/function/gpg/GpgKeyGetter.h"
#include "ui_ExportKeyPackageDialog.h"
diff --git a/src/ui/dialog/import_export/ExportKeyPackageDialog.h b/src/ui/dialog/import_export/ExportKeyPackageDialog.h
index 72f5b09e..678db8ff 100644
--- a/src/ui/dialog/import_export/ExportKeyPackageDialog.h
+++ b/src/ui/dialog/import_export/ExportKeyPackageDialog.h
@@ -29,7 +29,7 @@
#pragma once
#include "GpgFrontendUI.h"
-#include "core/GpgModel.h"
+#include "core/typedef/GpgTypedef.h"
#include "ui/dialog/GeneralDialog.h"
class Ui_exportKeyPackageDialog;
diff --git a/src/ui/dialog/import_export/KeyImportDetailDialog.cpp b/src/ui/dialog/import_export/KeyImportDetailDialog.cpp
index af50cbaf..6a66d8ef 100644
--- a/src/ui/dialog/import_export/KeyImportDetailDialog.cpp
+++ b/src/ui/dialog/import_export/KeyImportDetailDialog.cpp
@@ -28,6 +28,7 @@
#include "KeyImportDetailDialog.h"
+#include "core/GpgModel.h"
#include "core/function/gpg/GpgKeyGetter.h"
namespace GpgFrontend::UI {
diff --git a/src/ui/dialog/import_export/KeyServerImportDialog.cpp b/src/ui/dialog/import_export/KeyServerImportDialog.cpp
index f6feba1a..09943098 100644
--- a/src/ui/dialog/import_export/KeyServerImportDialog.cpp
+++ b/src/ui/dialog/import_export/KeyServerImportDialog.cpp
@@ -32,11 +32,12 @@
#include <string>
#include <utility>
+#include "core/GpgModel.h"
#include "core/function/GlobalSettingStation.h"
#include "core/function/gpg/GpgKeyImportExporter.h"
-#include "thread/KeyServerImportTask.h"
#include "ui/SignalStation.h"
#include "ui/struct/SettingsObject.h"
+#include "ui/thread/KeyServerImportTask.h"
#include "ui/thread/KeyServerSearchTask.h"
namespace GpgFrontend::UI {
diff --git a/src/ui/dialog/import_export/KeyUploadDialog.cpp b/src/ui/dialog/import_export/KeyUploadDialog.cpp
index 8c5552ae..dbf9dd00 100644
--- a/src/ui/dialog/import_export/KeyUploadDialog.cpp
+++ b/src/ui/dialog/import_export/KeyUploadDialog.cpp
@@ -31,6 +31,7 @@
#include <QtNetwork>
#include <algorithm>
+#include "core/GpgModel.h"
#include "core/function/GlobalSettingStation.h"
#include "core/function/gpg/GpgKeyGetter.h"
#include "core/function/gpg/GpgKeyImportExporter.h"
diff --git a/src/ui/dialog/import_export/KeyUploadDialog.h b/src/ui/dialog/import_export/KeyUploadDialog.h
index 52c9b205..099382b9 100644
--- a/src/ui/dialog/import_export/KeyUploadDialog.h
+++ b/src/ui/dialog/import_export/KeyUploadDialog.h
@@ -28,8 +28,9 @@
#pragma once
-#include "core/GpgModel.h"
#include "core/function/gpg/GpgContext.h"
+#include "core/typedef/CoreTypedef.h"
+#include "core/typedef/GpgTypedef.h"
#include "ui/GpgFrontendUI.h"
#include "ui/dialog/GeneralDialog.h"
@@ -65,7 +66,7 @@ class KeyUploadDialog : public GeneralDialog {
*
* @param keys_data
*/
- void slot_upload_key_to_server(const GpgFrontend::ByteArray& keys_data);
+ void slot_upload_key_to_server(const ByteArray& keys_data);
/**
* @brief
diff --git a/src/ui/dialog/key_generate/KeygenDialog.cpp b/src/ui/dialog/key_generate/KeygenDialog.cpp
index 0fd7b6c4..33d7c2f9 100644
--- a/src/ui/dialog/key_generate/KeygenDialog.cpp
+++ b/src/ui/dialog/key_generate/KeygenDialog.cpp
@@ -30,6 +30,7 @@
#include <qobject.h>
+#include "core/GpgModel.h"
#include "core/function/GlobalSettingStation.h"
#include "core/function/gpg/GpgKeyOpera.h"
#include "core/utils/CacheUtils.h"
diff --git a/src/ui/dialog/key_generate/SubkeyGenerateDialog.h b/src/ui/dialog/key_generate/SubkeyGenerateDialog.h
index e0a2ed2f..9a121286 100644
--- a/src/ui/dialog/key_generate/SubkeyGenerateDialog.h
+++ b/src/ui/dialog/key_generate/SubkeyGenerateDialog.h
@@ -28,9 +28,10 @@
#pragma once
-#include "core/GpgModel.h"
#include "core/function/gpg/GpgContext.h"
#include "core/model/GpgGenKeyInfo.h"
+#include "core/model/GpgKey.h"
+#include "core/typedef/GpgTypedef.h"
#include "ui/GpgFrontendUI.h"
#include "ui/dialog/GeneralDialog.h"
diff --git a/src/ui/dialog/keypair_details/KeyDetailsDialog.cpp b/src/ui/dialog/keypair_details/KeyDetailsDialog.cpp
index 4d07232b..012d2a24 100644
--- a/src/ui/dialog/keypair_details/KeyDetailsDialog.cpp
+++ b/src/ui/dialog/keypair_details/KeyDetailsDialog.cpp
@@ -28,10 +28,11 @@
#include "KeyDetailsDialog.h"
-#include "KeyPairDetailTab.h"
-#include "KeyPairOperaTab.h"
-#include "KeyPairSubkeyTab.h"
-#include "KeyPairUIDTab.h"
+#include "core/GpgModel.h"
+#include "ui/dialog/keypair_details/KeyPairDetailTab.h"
+#include "ui/dialog/keypair_details/KeyPairOperaTab.h"
+#include "ui/dialog/keypair_details/KeyPairSubkeyTab.h"
+#include "ui/dialog/keypair_details/KeyPairUIDTab.h"
namespace GpgFrontend::UI {
KeyDetailsDialog::KeyDetailsDialog(const GpgKey& key, QWidget* parent)
@@ -45,14 +46,14 @@ KeyDetailsDialog::KeyDetailsDialog(const GpgKey& key, QWidget* parent)
tab_widget_->addTab(new KeyPairOperaTab(key.GetId(), tab_widget_),
_("Operations"));
- auto* mainLayout = new QVBoxLayout;
- mainLayout->addWidget(tab_widget_);
+ auto* main_layout = new QVBoxLayout;
+ main_layout->addWidget(tab_widget_);
#ifdef MACOS
setAttribute(Qt::WA_LayoutUsesWidgetRect);
#endif
this->setAttribute(Qt::WA_DeleteOnClose, true);
- this->setLayout(mainLayout);
+ this->setLayout(main_layout);
this->setWindowTitle(_("Key Details"));
this->setModal(true);
diff --git a/src/ui/dialog/keypair_details/KeyDetailsDialog.h b/src/ui/dialog/keypair_details/KeyDetailsDialog.h
index bb5cc3dc..1c72ce98 100644
--- a/src/ui/dialog/keypair_details/KeyDetailsDialog.h
+++ b/src/ui/dialog/keypair_details/KeyDetailsDialog.h
@@ -28,8 +28,8 @@
#pragma once
-#include "core/GpgModel.h"
#include "core/function/gpg/GpgContext.h"
+#include "core/typedef/GpgTypedef.h"
#include "ui/GpgFrontendUI.h"
#include "ui/dialog/GeneralDialog.h"
diff --git a/src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp b/src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp
index f6d081f3..78706059 100644
--- a/src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp
+++ b/src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp
@@ -28,6 +28,7 @@
#include "KeyNewUIDDialog.h"
+#include "core/GpgModel.h"
#include "core/function/gpg/GpgKeyGetter.h"
#include "core/function/gpg/GpgUIDOperator.h"
#include "ui/SignalStation.h"
diff --git a/src/ui/dialog/keypair_details/KeyNewUIDDialog.h b/src/ui/dialog/keypair_details/KeyNewUIDDialog.h
index 62fabeb8..ab1bb5e1 100644
--- a/src/ui/dialog/keypair_details/KeyNewUIDDialog.h
+++ b/src/ui/dialog/keypair_details/KeyNewUIDDialog.h
@@ -28,8 +28,9 @@
#pragma once
-#include "core/GpgModel.h"
#include "core/function/gpg/GpgContext.h"
+#include "core/model/GpgKey.h"
+#include "core/typedef/GpgTypedef.h"
#include "ui/GpgFrontendUI.h"
#include "ui/dialog/GeneralDialog.h"
diff --git a/src/ui/dialog/keypair_details/KeyPairDetailTab.cpp b/src/ui/dialog/keypair_details/KeyPairDetailTab.cpp
index b3002b3d..114f5df7 100644
--- a/src/ui/dialog/keypair_details/KeyPairDetailTab.cpp
+++ b/src/ui/dialog/keypair_details/KeyPairDetailTab.cpp
@@ -28,6 +28,7 @@
#include "KeyPairDetailTab.h"
+#include "core/GpgModel.h"
#include "core/function/gpg/GpgKeyGetter.h"
#include "core/function/gpg/GpgKeyImportExporter.h"
#include "core/model/GpgKey.h"
diff --git a/src/ui/dialog/keypair_details/KeyPairOperaTab.h b/src/ui/dialog/keypair_details/KeyPairOperaTab.h
index 1533bf7c..4dee9e8d 100644
--- a/src/ui/dialog/keypair_details/KeyPairOperaTab.h
+++ b/src/ui/dialog/keypair_details/KeyPairOperaTab.h
@@ -29,6 +29,7 @@
#pragma once
#include "core/function/gpg/GpgKeyGetter.h"
+#include "core/model/GpgKey.h"
#include "ui/GpgFrontendUI.h"
namespace GpgFrontend::UI {
diff --git a/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp b/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp
index aa2a2ad6..852897c7 100644
--- a/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp
+++ b/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp
@@ -28,6 +28,7 @@
#include "KeyPairSubkeyTab.h"
+#include "core/GpgModel.h"
#include "core/function/gpg/GpgKeyGetter.h"
#include "core/utils/CommonUtils.h"
#include "ui/SignalStation.h"
diff --git a/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp b/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp
index 5c0cb54d..08e9aa9b 100644
--- a/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp
+++ b/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp
@@ -28,6 +28,7 @@
#include "KeyPairUIDTab.h"
+#include "core/GpgModel.h"
#include "core/function/gpg/GpgKeyGetter.h"
#include "core/function/gpg/GpgKeyManager.h"
#include "core/function/gpg/GpgUIDOperator.h"
diff --git a/src/ui/dialog/keypair_details/KeySetExpireDateDialog.h b/src/ui/dialog/keypair_details/KeySetExpireDateDialog.h
index 7bce70bd..bd4647e9 100644
--- a/src/ui/dialog/keypair_details/KeySetExpireDateDialog.h
+++ b/src/ui/dialog/keypair_details/KeySetExpireDateDialog.h
@@ -28,8 +28,9 @@
#pragma once
-#include "core/GpgModel.h"
#include "core/function/gpg/GpgContext.h"
+#include "core/model/GpgKey.h"
+#include "core/typedef/GpgTypedef.h"
#include "ui/GpgFrontendUI.h"
#include "ui/dialog/GeneralDialog.h"
diff --git a/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp b/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp
index b2f5eb10..6afaa510 100644
--- a/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp
+++ b/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp
@@ -28,6 +28,7 @@
#include "KeyUIDSignDialog.h"
+#include "core/GpgModel.h"
#include "core/function/gpg/GpgKeyGetter.h"
#include "core/function/gpg/GpgKeyManager.h"
#include "ui/SignalStation.h"
@@ -45,12 +46,9 @@ KeyUIDSignDialog::KeyUIDSignDialog(const GpgKey& key, UIDArgsListPtr uid,
_("Signers"), "signers", KeyListRow::ONLY_SECRET_KEY,
KeyListColumn::NAME | KeyListColumn::EmailAddress,
[key_id](const GpgKey& key, const KeyTable&) -> bool {
- if (key.IsDisabled() || !key.IsHasCertificationCapability() ||
- !key.IsHasMasterKey() || key.IsExpired() || key.IsRevoked() ||
- key_id == key.GetId())
- return false;
- else
- return true;
+ return !(key.IsDisabled() || !key.IsHasCertificationCapability() ||
+ !key.IsHasMasterKey() || key.IsExpired() || key.IsRevoked() ||
+ key_id == key.GetId());
});
m_key_list_->SlotRefresh();
diff --git a/src/ui/dialog/settings/SettingsDialog.cpp b/src/ui/dialog/settings/SettingsDialog.cpp
index 9b70df45..5f083408 100644
--- a/src/ui/dialog/settings/SettingsDialog.cpp
+++ b/src/ui/dialog/settings/SettingsDialog.cpp
@@ -28,13 +28,14 @@
#include "SettingsDialog.h"
-#include "SettingsAdvanced.h"
-#include "SettingsAppearance.h"
-#include "SettingsGeneral.h"
-#include "SettingsKeyServer.h"
-#include "SettingsNetwork.h"
#include "core/GpgConstants.h"
+#include "core/GpgModel.h"
#include "core/function/GlobalSettingStation.h"
+#include "ui/dialog/settings/SettingsAdvanced.h"
+#include "ui/dialog/settings/SettingsAppearance.h"
+#include "ui/dialog/settings/SettingsGeneral.h"
+#include "ui/dialog/settings/SettingsKeyServer.h"
+#include "ui/dialog/settings/SettingsNetwork.h"
#include "ui/main_window/MainWindow.h"
namespace GpgFrontend::UI {
diff --git a/src/ui/dialog/settings/SettingsGeneral.cpp b/src/ui/dialog/settings/SettingsGeneral.cpp
index bbcb9603..25c318a3 100644
--- a/src/ui/dialog/settings/SettingsGeneral.cpp
+++ b/src/ui/dialog/settings/SettingsGeneral.cpp
@@ -28,6 +28,8 @@
#include "SettingsGeneral.h"
+#include "core/GpgModel.h"
+#include "core/function/GlobalSettingStation.h"
#include "core/function/gpg/GpgContext.h"
#ifdef SUPPORT_MULTI_LANG
@@ -36,7 +38,6 @@
#include <boost/format.hpp>
-#include "core/function/GlobalSettingStation.h"
#include "ui_GeneralSettings.h"
namespace GpgFrontend::UI {
diff --git a/src/ui/main_window/MainWindow.cpp b/src/ui/main_window/MainWindow.cpp
index 1ea706ef..cbe27ffb 100644
--- a/src/ui/main_window/MainWindow.cpp
+++ b/src/ui/main_window/MainWindow.cpp
@@ -28,11 +28,11 @@
#include "MainWindow.h"
+#include "core/GpgModel.h"
#include "core/function/CacheManager.h"
#include "core/function/GlobalSettingStation.h"
#include "core/function/gpg/GpgAdvancedOperator.h"
#include "core/module/ModuleManager.h"
-#include "main_window/GeneralMainWindow.h"
#include "ui/SignalStation.h"
#include "ui/main_window/GeneralMainWindow.h"
#include "ui/struct/SettingsObject.h"
diff --git a/src/ui/widgets/FilePage.cpp b/src/ui/widgets/FilePage.cpp
index c4ada5f7..a0477fa1 100644
--- a/src/ui/widgets/FilePage.cpp
+++ b/src/ui/widgets/FilePage.cpp
@@ -30,6 +30,7 @@
#include <string>
+#include "core/GpgModel.h"
#include "core/function/ArchiveFileOperator.h"
#include "core/function/gpg/GpgFileOpera.h"
#include "ui/SignalStation.h"
diff --git a/src/ui/widgets/InfoBoardWidget.cpp b/src/ui/widgets/InfoBoardWidget.cpp
index d26a145e..9a243da8 100644
--- a/src/ui/widgets/InfoBoardWidget.cpp
+++ b/src/ui/widgets/InfoBoardWidget.cpp
@@ -28,6 +28,7 @@
#include "ui/widgets/InfoBoardWidget.h"
+#include "core/GpgModel.h"
#include "core/function/GlobalSettingStation.h"
#include "ui/SignalStation.h"
#include "ui/struct/SettingsObject.h"
diff --git a/src/ui/widgets/TOFUInfoPage.cpp b/src/ui/widgets/TOFUInfoPage.cpp
index 8080cfb4..502fed44 100644
--- a/src/ui/widgets/TOFUInfoPage.cpp
+++ b/src/ui/widgets/TOFUInfoPage.cpp
@@ -29,7 +29,7 @@
#include "TOFUInfoPage.h"
GpgFrontend::UI::TOFUInfoPage::TOFUInfoPage(
- const GpgFrontend::GpgTOFUInfo &tofu_info, QWidget *parent)
+ const GpgFrontend::GpgTOFUInfo & /*tofu_info*/, QWidget *parent)
: QWidget(parent) {
auto grid_layout = new QGridLayout();
diff --git a/src/ui/widgets/TOFUInfoPage.h b/src/ui/widgets/TOFUInfoPage.h
index eb076398..4bd9b89a 100644
--- a/src/ui/widgets/TOFUInfoPage.h
+++ b/src/ui/widgets/TOFUInfoPage.h
@@ -28,7 +28,7 @@
#pragma once
-#include "core/GpgModel.h"
+#include "core/typedef/GpgTypedef.h"
#include "ui/GpgFrontendUI.h"
namespace GpgFrontend::UI {
diff --git a/src/ui/widgets/TextEdit.cpp b/src/ui/widgets/TextEdit.cpp
index f27bab7c..24a2bd27 100644
--- a/src/ui/widgets/TextEdit.cpp
+++ b/src/ui/widgets/TextEdit.cpp
@@ -34,6 +34,7 @@
#include <tuple>
#include <vector>
+#include "core/GpgModel.h"
#include "core/function/CacheManager.h"
#include "core/function/GlobalSettingStation.h"
diff --git a/src/ui/widgets/VerifyKeyDetailBox.cpp b/src/ui/widgets/VerifyKeyDetailBox.cpp
index 4eff6584..54f5cf9e 100644
--- a/src/ui/widgets/VerifyKeyDetailBox.cpp
+++ b/src/ui/widgets/VerifyKeyDetailBox.cpp
@@ -28,6 +28,7 @@
#include "ui/widgets/VerifyKeyDetailBox.h"
+#include "core/GpgModel.h"
#include "core/function/GlobalSettingStation.h"
#include "core/function/gpg/GpgKeyGetter.h"
#include "core/utils/CommonUtils.h"